i want to load my .data in flash instead of ram using code warrior eclipse IDE. here is the scenario.
now, all address are correctly generated (LMA and VMA) but code warrior load .data at VMA instead of LMA. how can i change this setting. |
Hi!
.data section is always loaded by default in flash (LMA) and the it is copied in runtime to RAM (VMA). You must not keep this section in flash because you will not be able to write the variables, just read them. The correct way to do this is next:
.data : AT(__flashAddress)
{
*(.data);
} > ram
In this case the instruction 'AT' indicates that section .data is going to be loaded in the flash addres indicated by label '__flashAddress' (LMA) and '> ram' indicates that it is being linked in segment ram (VMA).
Hope this helps,
Carlos