code warrior load my .data at VMA instead of LMA

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

code warrior load my .data at VMA instead of LMA

941 Views
farozeibnejava
Contributor III

 

i want to load my .data in flash instead of ram using code warrior eclipse IDE. here is the scenario.

.data : { *(.data); } > ram AT> flash 

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.

Labels (1)
0 Kudos
1 Reply

777 Views
Carlos_Musich
NXP Employee
NXP Employee

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

0 Kudos