Greetings to all,
I am working with CodeWarrior for MCU Version: 10. I need the clarification tha where the const variables will be stored ? is it in Flash memory (Code area) ?
If so, can i redirect these variables to store in RAM by using prm file ??
Thanks and Regards
Hello
Which MCU are you targeting (HC08, Coldfire, Kinetis, ...)?
Answer to this question depends on the target you are using.
CrasyCat
Hi,
My target is HC08 MCU
Thanks
Hello
HC08 compiler places all constants per default in a section called ROM_VAR (or .rodata).
This section is placed in flash in the.prm file generated by the wizard.
If you wish to get your constants allocated in RAM, just place the section into a RAM memory area in the .prm file PLACEMENT block.
If you have defined your own constant section (using pragma CONST_SEG), just place this section in a RAM memory area in the .prm file PLACEMENT block.
If you decide to allocate your constants in RAM, make sure you are not building with option -D__ONLY_INIT_SP. Initialization values for your constants will need to be copied from ROM to RAM at startup so you need to execute the whole startup code.
I hope this helps.
CrasyCat
Hello,
Can you explain, where the option D__ONLY_INIT_SP will be available to enable/disable ?
Thanks&Regards
Giri Chavana
Hello
CrasyCat
Helly Catherine Bezy,
Thanks for the useful information.