Hello Ma Hui!
I guess this is the info you need:
ICF File:
define symbol __ICFEDIT_region_ROM_DATA_start__ = 0x0007F800;
define symbol __ICFEDIT_region_ROM_DATA_end__ = 0x0007FFFF;
define region ROM_DATA_region = mem:[from __ICFEDIT_region_ROM_DATA_start__ to __ICFEDIT_region_ROM_DATA_end__];
place in ROM_DATA_region {readonly section NVM_DATA};
Then, in C file:
#define NVM_DATA _Pragma("location=\"NVM_DATA\"")
NVM_DATA const tPARAM_MOVIL PROG_MOVIL;
NVM_DATA const tPARAM_RADIO PROG_RADIO;
Notice that _Pragma("location=\"NVM_DATA\"") is the same as #pragma location="NVM_DATA". So the lines above could be read as:
#pragma location="NVM_DATA"
const tPARAM_MOVIL PROG_MOVIL;
#pragma location="NVM_DATA"
const tPARAM_RADIO PROG_RADIO;
tPARAM_MOVIL and tPARAM_RADIO are some data structures, and don't matter rigth now.
If you go back to the first post, you would see that the order (memory location) in the MAP file is not the same as the order I define the variables.
Best Regards,
SebaS