how to define address of variable in ROM?

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

how to define address of variable in ROM?

ソリューションへジャンプ
2,334件の閲覧回数
wangbaode
Contributor IV

Hi,

in S08,I can use @ to define address of variable.But in kinetis,it doesn't work.

so how to define address of variable in rom?

1 解決策
1,932件の閲覧回数
wangbaode
Contributor IV
5 返答(返信)
1,932件の閲覧回数
quevedo
Contributor V

I don't know if you want to allocate a specific address for the variable, or simply put it anywhere inside the ROM area. If your case is the latest, you may simply delcare the variable as CONST (use "const" keyword before declaring variable type). Usually, variables that cannot be changed are placed inside FLASH area. I think it is worth a try.

0 件の賞賛
返信
1,932件の閲覧回数
Monica
Senior Contributor III

Hello Wang,

did that help on clearing out your doubts?

Please keep us posted :smileywink:

Best,

Monica.

0 件の賞賛
返信
1,933件の閲覧回数
wangbaode
Contributor IV

Hi Monica,

I have resolve my question through Defining Variables at Absolute Addresses with gcc | MCU on Eclipse

1,932件の閲覧回数
Monica
Senior Contributor III

Thanks for sharing, Wang!

Monica.

0 件の賞賛
返信
1,932件の閲覧回数
BlackNight
NXP Employee
NXP Employee

Hello,

this should give you an idea if you are using GNU (which I assume?):

Defining Variables at Absolute Addresses with gcc | MCU on Eclipse

0 件の賞賛
返信