Help In Assembler

I work with at91sam7X512
In my trying to ran from the RAM I decide to do memcopy from the FLASH to the RAM,
I saw in assembler that the code copied to the RAM,
but it doesn't succeed to run back to the program.
I look on the assembler and I found the problem,
I have this line:

0x00010FFC 0xEB0001D2 bl __aeabi_memcpy

I understand that bl command supposed to places the return address in the link register, and set the PC to the address of the subroutine.
It's set the PC to the address of the subroutine but in the Link register It's put undefined address 0xEB0001F5, and then to prefetch abort.

What's go wrong?
thanks all, chiko.

Parents
  • the problem is that you are not using the provisions of the linker to do it. This scatter load file will map anything in the execution region "ER_NOR_FLASH_RAM_ZONE" into RAM:

    ; ********************************************************************
    ; * ACCESS TO THE NOR FLASH IS SLOWER THAN TO LPC2478 INTERNAL FLASH *
    ; * DO NO MAP ANY TIME CRITICAL CODE HERE (COMPRESSOR CONTROL ETC.)  *
    ; * USE RAM REGION "ER_NOR_FLASH_RAM_ZONE" TO MAP MODULES TO RAM FOR *
    ; * FAST EXECUTION                                                                                                       *
    ; ********************************************************************
    LR_IROM2 0x80000000 0x400000  {    ; load region size_region
      FMMAPP2 0x80000000 0x00400000  {  ; load address = execution address
            SYSTEM_ERROR_CODES.o
      }
    
    ; *********************************************************************
    ; * These modules are executed in RAM (but stored in the NOR flash)   *
    ; * This code is copied into RAM by overriding the "__main" function  *
    ; * so that the scatter loading process of the application can access *
    ; * the NOR flash. See "main.c"                                                                             *
    ; *********************************************************************
      ER_NOR_FLASH_RAM_ZONE 0xA1100000 0x10400  {
            APP_MACHINE_ID.o
            APP_SOFTWARE_UPDATE.o
            APP_IO_CFG.o
            APP_VAR_INIT.o
            SOFTWARE_EVENT.o
            APP_OPTION_MODULE.o
            APP_FEATURE_LST.o
      }
    

Reply
  • the problem is that you are not using the provisions of the linker to do it. This scatter load file will map anything in the execution region "ER_NOR_FLASH_RAM_ZONE" into RAM:

    ; ********************************************************************
    ; * ACCESS TO THE NOR FLASH IS SLOWER THAN TO LPC2478 INTERNAL FLASH *
    ; * DO NO MAP ANY TIME CRITICAL CODE HERE (COMPRESSOR CONTROL ETC.)  *
    ; * USE RAM REGION "ER_NOR_FLASH_RAM_ZONE" TO MAP MODULES TO RAM FOR *
    ; * FAST EXECUTION                                                                                                       *
    ; ********************************************************************
    LR_IROM2 0x80000000 0x400000  {    ; load region size_region
      FMMAPP2 0x80000000 0x00400000  {  ; load address = execution address
            SYSTEM_ERROR_CODES.o
      }
    
    ; *********************************************************************
    ; * These modules are executed in RAM (but stored in the NOR flash)   *
    ; * This code is copied into RAM by overriding the "__main" function  *
    ; * so that the scatter loading process of the application can access *
    ; * the NOR flash. See "main.c"                                                                             *
    ; *********************************************************************
      ER_NOR_FLASH_RAM_ZONE 0xA1100000 0x10400  {
            APP_MACHINE_ID.o
            APP_SOFTWARE_UPDATE.o
            APP_IO_CFG.o
            APP_VAR_INIT.o
            SOFTWARE_EVENT.o
            APP_OPTION_MODULE.o
            APP_FEATURE_LST.o
      }
    

Children
More questions in this forum