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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
2,379件の閲覧回数
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.

ラベル(1)
0 件の賞賛
返信
1 解決策
1,177件の閲覧回数
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 件の賞賛
返信
3 返答(返信)
1,177件の閲覧回数
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 件の賞賛
返信
1,178件の閲覧回数
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 件の賞賛
返信
1,177件の閲覧回数
CarlFST60L
Senior Contributor II

CrasyCat,

 

THANKS!!!

0 件の賞賛
返信