This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LPC2400.s - Startup code too long for CRP

Hi,

when using the setup options for setting up e.g. the external memory controller stuff, the startup code of Keil's lpc2400.s becomes so long, that one can not insert the code protection at address 0x1FC via a scatter file anmyore.

Any idea how to solve this issue?

Regards
Herbert

Parents
  • You can configure the CRP (Code Read Protection) key directly from your C Code:

    #include <absacc.h>
    
    const unsigned long CRP_Key __at (0x1fc) = 0x87654321;
    

    The Linker will place the code correctly (also splitting the startup code).

    But be careful since once programmed the JTAG is disabled and debugger won't work anymore (ISP can still be used to erase the chip).

Reply
  • You can configure the CRP (Code Read Protection) key directly from your C Code:

    #include <absacc.h>
    
    const unsigned long CRP_Key __at (0x1fc) = 0x87654321;
    

    The Linker will place the code correctly (also splitting the startup code).

    But be careful since once programmed the JTAG is disabled and debugger won't work anymore (ISP can still be used to erase the chip).

Children
  • Robert,

    thanks for your input.

    I've not tried to do so, but I doubt, how this could work. The lpc2400.s startup code has no subroutines, but one contigous chunk of assembler instructions; so the linker would have to insert branches to free the space needed for the CRP, and I don't think this is what a linker is made for.

    I'm aware of the problems caused with CRP, anyway, thank you for mentioning it.

    Regards
    Herbert