I want allocate the fix address for variables which are stored in flash. for example: const float engine_speed[6]={0,1000,2000,3000,4000,5000}; after compiling it, the address of these variables (engine_speed[6])is shown as bellow: C04000H engine_speed VAR --- NCONST ?NC?CR_MAP. if i want to fix the address of the variables into flash memory: C1F000H, how can i do? Thanks!
Thanks for you answers! the microcontroller is XC164Cs: FCONST (0xC00000-0xC1FFFF), NCONST (0xC04000-0xC07FFF), I have another question: what're the differences between NCONST and FCONST in the flash code? before i fix the address. the address of variables is: C04000H engine_speed VAR --- NCONST ?NC?CR_MAP. I want to fix the address: 0xC1F000, do I must use FCONST? AND the address should be: C1F000H engine_speed VAR --- FCONST ?FC?CR_MAP Is it right?
Regards!
Hallo!
1. Look at: http://www.keil.com/support/man/docs/c166/c166_le_memtypes.htm www.keil.com/.../c166_ap_locatingsections.htm http://www.keil.com/support/man/docs/c166/c166_le_const.htm
2. The IDE already has shown you what is the difference (in two words, this is address range...):
FCONST (0xC00000-0xC1FFFF), NCONST (0xC04000-0xC07FFF),
3. Use explicit far/near keywords to make sure the IDE will put the array to FCONST/NCONST space
Regards, Nikolay.