Hi Developer,
I want to set a const value into plash with a const address. Then I met error as picture:
How to resolve it?
BR, Shi Ting Ting
解決済! 解決策の投稿を見る。
Hi
CodeWarrior for HCS12(X) uses const to define global variable to FLASH.
for example,
const int VersionNbr = 2;
if define a const variable in a specific address, @is used, for example
const unsigned int mycst_data@0xF08000=0xAAAA;
If these const variables are not used anywhere in the application, you have to instruct the Linker to avoid optimization.
This is done specifying the constant name in the .prm file ENTRIES block.
For example:
ENTRIES
VersionNbr mycst_data
END
Please try it. If any issue, contact me again.
Have a nice day,
Jun Zhang
Hi
CodeWarrior for HCS12(X) uses const to define global variable to FLASH.
for example,
const int VersionNbr = 2;
if define a const variable in a specific address, @is used, for example
const unsigned int mycst_data@0xF08000=0xAAAA;
If these const variables are not used anywhere in the application, you have to instruct the Linker to avoid optimization.
This is done specifying the constant name in the .prm file ENTRIES block.
For example:
ENTRIES
VersionNbr mycst_data
END
Please try it. If any issue, contact me again.
Have a nice day,
Jun Zhang
Hi Jun Zhang,
Thanks for your reply.
You mean use '@', but I cannot find '@' in your example.
I want to set a fixed value into fixed address in paged flash,for example,write 0x1234 into 0xFCBFF0.
How can I do?
Thank you so much.
BR, Shi Ting Ting
I correct the example, please check it again.
Thanks,
Jun Zhang