lpcxpresso CRP problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lpcxpresso CRP problem

1,597 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by euripedes on Wed Jan 25 08:30:08 MST 2012
Hi,
I want to use CRP in my project, but I´m getting problems when using a custom link script. I have the definitions suggested by code red:

#include <NXP/crp.h>
// Variable to store CRP value in. Will be placed automatically
// by the linker when "Enable Code Read Protect" selected.
// See crp.h header for more information
__CRP const unsigned int CRP_WORD = CRP_NO_CRP ;


But when i build the project the linker give me an error like this:

CRP Enabled, but no CRP_WORD provided within application

this happens only when using a custom link script, and I don´t know how to solve this.

Anyone had this same problem?

Thanks in advance
0 Kudos
Reply
2 Replies

1,361 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by euripedes on Wed Jan 25 12:15:28 MST 2012
Extending my previous post, the ld file i´m using was generated by lpcxpresso automatically. I made few modifications on the file, to have the project working with my bootloader, then my ld file have this section, the error came from the assert part of it.


When I commented the assert part everything goes fine, but i´m not secure if doing this is the right way to solve the problem.
0 Kudos
Reply

1,361 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Jan 25 08:56:41 MST 2012
If you create a new LPCXpresso project you can find the difference to your ld file :rolleyes:

It has to provide a CRP_WORD at 0x02FC :eek:
/* MAIN TEXT SECTION */    
    .text : ALIGN(4)
    {
        FILL(0xff)
        KEEP(*(.isr_vector))
        /* Global Section Table */
        . = ALIGN(4) ;
        __section_table_start = .;
        __data_section_table = .;
        LONG(LOADADDR(.data));
        LONG(    ADDR(.data)) ;
        LONG(  SIZEOF(.data));
        __data_section_table_end = .;
        __bss_section_table = .;
        LONG(    ADDR(.bss));
        LONG(  SIZEOF(.bss));
        __bss_section_table_end = .;
        __section_table_end = . ;
        /* End of Global Section Table */
        *(.after_vectors*)
[COLOR=Red]       /* Code Read Protect data */
        . = 0x000002FC ;
        PROVIDE(__CRP_WORD_START__ = .) ;
        KEEP(*(.crp))
        PROVIDE(__CRP_WORD_END__ = .) ;
        ASSERT(!(__CRP_WORD_START__ == __CRP_WORD_END__), "Linker CRP Enabled, but no CRP_WORD provided within application");
        /* End of Code Read Protect */
[/COLOR]         *(.text*)
        *(.rodata .rodata.*)
        . = ALIGN(4);
    } > MFlash32
0 Kudos
Reply