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

seperate load and execution region for LPC24xx project ...

Hi everyone,

I have a need to store my program in the internal flash memory of the LPC24xx but execute the code from RAM. I tried to use scatter-loading. The problem is that I cannot get my complete memory image copied to RAM. The linker puts my provided sections only in one of the required regions.
Could I get a example of how to generate a project that loads the image to flash but at execution time copies the image to RAM and executes from RAM

Thank you,
Frank

  • Hi,
    so far I did not get any feedback! Here is my new attempt to get some input.

    Is it possible with the current concept of the Keil tools to setup a project to be stored in Flash memory (load region) but exectued from RAM (execution region)?

    Is the standard startup code in conjunction with the C library able to perform all necessary tasks like code copying and branching to the correct execution region or is it necessary to implement the required functionality?

    Is there any example code available?

    Thank you,
    Frank

  • Here is my scatterloading description file I use for my project:

    LR_IROM1 0x00000000 0x00080000  {    ; load region size_region
      ER_IROM1 0x00000000 0x00080000  {  ; load address = execution address
       LPC2400_RTX.o (RESET, +First)
       *(InRoot$$Sections)
      }
      ER_ROM1 0xA1000000 0x00080000   {  ; RO data
       *.o (+RO)
      }
      RW_IRAM1 0xA1080000 0x00080000  {  ; RW data
       .ANY (+RW +ZI)
      }
    }
    

  • Automatic copying of load region in Flash to execution region in RAM is performed in the pre-main (library function) which is called from startup. Therefore you need to place the startup code and this library code (InRoot$$Sections) into the region which has the same load and execution address (just like in your scatter file).

    The standard startup file with the mentioned scatter file is all what you need to make an application which is stored in flash and runs from RAM.

  • Hi Robert,

    this is exactly what I do but the library code always crashed.
    Now I found the reason. I accidentally selected MicroLib in my project and this causes the crash in the library code. After deselecting the MicroLib my scatterloading works.

    Frank