Hi, I am using the 52259EVB with external MRAM. As this MRAM is non volatile, I need to stop the compilier from creating my volatile varibles as .bss and make them all .data for my NVM_Section. This is because some .bss types are zero, and some are not, and .bss wont program if set as 0 as their 'defualt value'.
PS. I had no problems setting my linker up to get the Cyclone MAX programmer to program all my .data in the right spot in MRAM, the only problem is .bss is no good for my app, it must be forced to stay as .data for the section.
Here is a part of the linker:
.NVM_Page:
{
nvm.c (.data)
nvm.c (.rodata)
nvm.c (.text)
nvm.c (.bss) <- I NEED THESE TO BE .data!!
} > User_NVM
I also do not want to have to seperate .data and .bss and create a seperate .bss initiliser, or use const's and use pointers for modifiying the volatile varibles as I am using the MQX RToS and it would be a PITA in so many ways.
已解决! 转到解答。
Hello
I assume you are using CodeWarrior for Coldfire compiler.
Am I right?
Can you try to specify following pragma at the beginning of all module where you have uninitialized data that you want to allocate in .data section.
#pragma explicit_zero_data on
This should do the trick.
CrasyCat
Anyone got any ideas or alternatives?
All we need is the compilier / linker to create volatile varibles that are programmed into memory (even though its extern MRAM), but, still be able to use the volatile varible as normal in software without any problems... Surely there is a simple way, right?
Maybe I have overlooked something 'obvious'?
Hello
I assume you are using CodeWarrior for Coldfire compiler.
Am I right?
Can you try to specify following pragma at the beginning of all module where you have uninitialized data that you want to allocate in .data section.
#pragma explicit_zero_data on
This should do the trick.
CrasyCat