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

Memory remmaping and RL-ARM

I'm using a LPC2129, with Realview MDK-ARM 3.11 and RealView RL-ARM 3.10

I'm trying to run an application loaded by a user bootloader. So I have a bootloader code in 0x0000 0000 who uses a USB connection to load an application code in 0x0000 4000. The program runs fine. The problem is when I jump to the application code, when I have to remmap the interrupt vectors.

I've tried using REMAP RAM_MODE for Startup.s file in the application, but it seems that the interrupts still go to the Flash Vectors.

Besides, the SWI handler is configured by the OS (RL-ARM) and the Dabt handler by the Real Time Agent

I appreciate any help or useful link

Parents
  • the scatter-loading file

    LR_IROM1 0x00004000 0x0003C000  {    ; load region size_region
      ER_IROM1 0x00004000 0x0003C000  {  ; load address = execution address
       *.o (RESET, +First)
       *(InRoot$$Sections)
       .ANY (+RO)
      }
      RW_IRAM1 0x40000050 0x00003FB0  {  ; RW data
       .ANY (+RW +ZI)
      }
      RW_IRAM2 0x40000000 0x00000050  {
        Vectors.o
      }
    }
    
    LR_IROM2 0x00000000 0x00004000  {
      ER_IROM2 0x00000000 0x00004000  {  ; load address = execution address
        CodeInit.o
      }
    }
    

    is it for the bootloader or the application ?

Reply
  • the scatter-loading file

    LR_IROM1 0x00004000 0x0003C000  {    ; load region size_region
      ER_IROM1 0x00004000 0x0003C000  {  ; load address = execution address
       *.o (RESET, +First)
       *(InRoot$$Sections)
       .ANY (+RO)
      }
      RW_IRAM1 0x40000050 0x00003FB0  {  ; RW data
       .ANY (+RW +ZI)
      }
      RW_IRAM2 0x40000000 0x00000050  {
        Vectors.o
      }
    }
    
    LR_IROM2 0x00000000 0x00004000  {
      ER_IROM2 0x00000000 0x00004000  {  ; load address = execution address
        CodeInit.o
      }
    }
    

    is it for the bootloader or the application ?

Children
  • Ok I guess the scatter file is for the application
    actually you are loading only the application in your target and you start with a jump to address 0x4000 in CodeInit.s which simulate the bootloader

    can you please show us the files
    Startup.s
    Vectors.s

    because it doesnot work for me ?
    did you use REMAP RAM_MODE ?

    thank you

  • The Vectors.s is part of the original Startup.s which is separated to run on RAM

    ; Area Definition and Entry Point
    ;  Startup Code must be linked first at Address at which it expects to run.
    
                                    AREA    RAMVECT, CODE, READONLY
    ; Exception Vectors
    ;  Mapped to Address 0.
    ;  Absolute addressing mode must be used.
    ;  Dummy Handlers are implemented as infinite loops which can be modified.
    
    Vectors         LDR     PC, Reset_Addr
                    LDR     PC, Undef_Addr
                    LDR     PC, SWI_Addr
                    LDR     PC, PAbt_Addr
                    LDR     PC, DAbt_Addr
                    NOP                            ; Reserved Vector
                    ;LDR     PC, IRQ_Addr
                    LDR     PC, [PC, #-0x0FF0]     ; Vector from VicVectAddr
                    LDR     PC, FIQ_Addr
    
    
    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
    IRQ_Addr        DCD     IRQ_Handler
    FIQ_Addr        DCD     FIQ_Handler
    
                                    IMPORT SWI_Handler
                                    IMPORT DAbt_Handler
                                    IMPORT Reset_Handler
                                    IMPORT Undef_Handler
                                    IMPORT PAbt_Handler
                                    IMPORT IRQ_Handler
                                    IMPORT FIQ_Handler
                                    END
    


    The startup is almost the same, just without this part of the code.

    To use the Scatter-File you have to deselect "Use Memory Layout from Target Dialog" from Linker options