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
One thing that comes to mind is using assembler and it's absolute address locating capabilities. Hopefully you'll be able to isolate all the 'absolute' stuff in a single .A66 file and avoid using linker controls. I'm not sure about data type compatibility between assembler and C, though. Just a thought. - mike
Sorry for the typo(s). I do know the difference between it's and its. But since English is not my first language, I must apologize for mistakes - past, present and future ones. Some people here can be picky :-) - mike
Mike, I usually find that those whose first language is *not* English are the ones that *do* have a good command of the grammar. So I guess you really have let the side down... Stefan
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.