How to force .bss to be .data? (Using MRAM on 52259EVB)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to force .bss to be .data? (Using MRAM on 52259EVB)

Jump to solution
2,359 Views
CarlFST60L
Senior Contributor II

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.

Labels (1)
0 Kudos
Reply
1 Solution
1,157 Views
CrasyCat
Specialist III

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

View solution in original post

0 Kudos
Reply
3 Replies
1,157 Views
CarlFST60L
Senior Contributor II

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'?

 

Message Edited by CarlFST60L on 2009-10-25 08:29 PM
0 Kudos
Reply
1,158 Views
CrasyCat
Specialist III

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

0 Kudos
Reply
1,157 Views
CarlFST60L
Senior Contributor II

CrasyCat,

 

THANKS!!!

0 Kudos
Reply