code warrior load my .data at VMA instead of LMA

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

code warrior load my .data at VMA instead of LMA

1,411 次查看
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.

标签 (1)
0 项奖励
回复
1 回复

1,247 次查看
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 项奖励
回复