This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Execution from FLASH

Hi,

 

I'm trying to execute my program from FLASH memory because the code is bigger than the internal RAM memory (SARAM + DARAM). My .cmd command for memory space configuration is:

 

-stack          0x01000   /* PRIMARY STACK SIZE    */

-sysstack       0x01000   /* SECONDARY STACK SIZE  */

-heap       0x4CA00   /* HEAP AREA SIZE        */


MEMORY

{

    MMR     (RW) : origin = 0000000h length = 0000C0h /* MMRs */

    VEC     (RX) : origin = 00000C0h length = 000300h /* on-chip ROM vectors */

    RAM     (RW) : origin = 0000400h length = 04FC00h /* on-chip DARAM+SARAM  */

    FLASH   (RX) : origin = 0800000h length = 400000h /* external NOR Flash  */

}


SECTIONS

{

    vectors     : > VEC    ALIGN = 256

    .text       : > FLASH  ALIGN = 2

    .stack      : > RAM    ALIGN = 4

    .sysstack   : > RAM    ALIGN = 4

    .data       : > RAM

    .bss        : > RAM,   fill = 0

    .cinit      : > RAM

    .const      : > FLASH


    .sysmem     : > RAM

    .cio        : > RAM

}

Note that the boot address (from the .map file) is pointing to a FLASH memory address:

...

ENTRY POINT SYMBOL: "_c_int00"  address: 00818a39

...


I can burn the program at the FLASH memory but I can't execute it.

 

Can you help me?

 

Thanks.

  • Hi,

    How did you program the .text section into the flash? Did you configure EMIF for the NOR flash before accessing the program area? 

     

    Regards,

    Peter Chung

     

     

  • Hi Peter,

     

    Answer to the first question: The only thing I did was to point the .text section to the FLASH in the .cmd file.

    Answer to the second question:  How do I configure the EMIF for the flash NOR? How do I do it from inside the program?

     

    Thanks.

     

  • Davyd,

    Programming a flash memory requires special process, so the bootloader of the C5515 is not able to write code to the external flash. In order to run instructions from an external flash, you need to manually program the code that you want to run from the flash into the flash and you need to call the instructions from your program.

    Is the flash only external memory that you have? If you have an external RAM or SDRAM, then it would be much easier. By the way, where are you booting from?

     

    Thanks,

    Peter Chung