We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
How can I place constants and variables to specific addresses in the FLASH and RAM ? Is there an equivalent for the C166 compiler like the _at_ <addr> which exists for the C51 compiler. I am sure there must be a more comfortable way instead of declaring the identifiers in a stand-alone C module and using the location control directives. Thanks for any comments and hints. Chris Schnyder
Thanks for your info. Finally I created a specific C source file, where I declare all the constants I want them to have at a defined address in the FLASH. Then I adjusted the linker settings accordingly. It works pretty well like that, but I am still wondering why C166 doesn't feature a mechanism which doesn't require to do this pain of workaround at file level. Chris
A word of caution: have a look at the #pragma ORDER if you haven't done that yet. And I'm still not sure if the C166 developers are not allowed to change the order of allocation of the constants and padding bytes with new versions of the compiler. - mike
"Then I adjusted the linker settings accordingly." That would be the "proper" way, since the allocation of addresses is the Linker's job.