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 Startup Fails with CRP

Hallo

Im search for a solution with the keil startup LPC2400.S with EMC enable.
I think all users with LPC24xx must have the same ISSUE.

The problem ist the asm code length and the scatter loader.

The ASM code is too long to place it between
0x0 and 0x1FC.

If I split it into 2 Parts.
Then parts of the scatter loader is placed into the
space between 0x0 and 0c1fc.

The Scatterloader then fails to boot the system.
I think a jump is out of range..

Anyone an Idea.

Thanks

------------------------------------------------------------------

Reset_Addr DCD Reset_Handler
Undef_Addr DCD Undef_Handler
SWI_Addr DCD SWI_Handler
PAbt_Addr DCD PAbt_Handler
DAbt_Addr DCD DAbt_Handler DCD 0 ; Reserved Address

IMPORT Undef_Handler IMPORT SWI_Handler IMPORT PAbt_Handler IMPORT DAbt_Handler IMPORT FIQ_Handler ;C FIQ_Handler im C file IMPORT _Z11FIQ_Handlerv ;C++ FIQ_Handler im CPP file

------------------------------------------------------------------

AREA |.text|, CODE, READONLY

EXPORT Reset_Handler
Reset_Handler
; Clock Setup ------------------------------------------------------------------ IF (:LNOT:(:DEF:NO_CLOCK_SETUP)):LAND:(CLOCK_SETUP != 0) LDR R0, =SCB_BASE

  • ...
    Undef_Handler   B       Undef_Handler
    SWI_Handler     B       SWI_Handler
    PAbt_Handler    B       PAbt_Handler
    DAbt_Handler    B       DAbt_Handler
    IRQ_Handler     B       IRQ_Handler
    FIQ_Handler     B       FIQ_Handler
    
                    AREA    |.ARM.__at_0x01FC|, CODE, READONLY
    CRP_Key         DCD     0xFFFFFFFF
    
                                    AREA    |.text|, CODE, READONLY
    
    ; Reset Handler
    ...
    

  • it dit not work

    the disassemly window steps in rt_lib_shutdown and then moves in the middle of a c case switch an then in
    undef_handler.

    I try a little more and

    ----------------------------
    Undef_Handler B Undef_Handler
    SWI_Handler B SWI_Handler
    PAbt_Handler B PAbt_Handler
    DAbt_Handler B DAbt_Handler
    IRQ_Handler B IRQ_Handler
    FIQ_Handler B FIQ_Handler

    ; Fill up To CPR ----------------------------
    ; FILL 0x1B8,0xDEADAFFE,4 ; defines Fill bytes upto CPR

    AREA |.ARM.__at_0x01FC|, CODE, READONLY
    CRP_Key DCD 0xFFFFFFFF

    AREA |.text|, CODE, READONLY

    ; Reset Handler
    -----------------------------------

    then it worked.

    I think i can use it as a workaround.

    without
    FILL 0x1B8,0xDEADAFFE,4 ; defines
    the linker

    placed 0x000001ed Thumb Code 0 libshutdown.o(.ARM.Collect$$libshutdown$$00000000) Inline Thumb to ARM Veneer to __rt_exit 0x000001f1 Thumb Code 4 rtexit.o(.ARM.Collect$$rtexit$$00000000) __rt_exit 0x000001f4 ARM Code 0 rtexit.o(.ARM.Collect$$rtexit$$00000000) __rt_exit_ls 0x000001f4 ARM Code 0 rtexit2.o(.ARM.Collect$$rtexit$$00000003) __rt_exit_prels_1 0x000001f4 ARM Code 0 rtexit2.o(.ARM.Collect$$rtexit$$00000002) __rt_exit_exit 0x000001f8 ARM Code 0 rtexit2.o(.ARM.Collect$$rtexit$$00000004)

    befor the crp and the __rt_exit_exit seems to fail.

    If I fill up this area it workd.
    I thing the scatter loader is buggy.

    Thank YOU