placing data in an absolute address in flash(ROM) : NXPS12ZVM

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

placing data in an absolute address in flash(ROM) : NXPS12ZVM

ソリューションへジャンプ
1,756件の閲覧回数
AjRj14
Contributor III

I'm trying to place a variable  in an absolute flash location. Target is S12ZVM and I'm using codewarrior. 

Can you help me with some reference for this scenario.

 

Thanks in Advance

0 件の賞賛
1 解決策
1,708件の閲覧回数
StanoA
NXP TechSupport
NXP TechSupport

Hello AjRj14,

Sorry for my mistake – it has to be used:

#pragma DATA_SEG ROM_VAR

Then define such data… and at the end use:

#pragma DATA_SEG DEFAULT

The CODE_SEG saves the functions and the DATA_SEG saves the data.

Sorry once again.

Best Regards,

Stano.

元の投稿で解決策を見る

0 件の賞賛
4 返答(返信)
1,740件の閲覧回数
StanoA
NXP TechSupport
NXP TechSupport

Hello AjRj14,

You need modify the *.prm file for this MCU – select such FLASH space for this variable:

StanoA_0-1634045132656.png

 

In “SEGMENTS” define “ROM_VAR_SPACE” (I selected small part of FLASH);

Then in “PLACEMENT” tell linker ROM_VAR data must be placed to ROM_VAR_SPACE.

Then in main.c use:

StanoA_1-1634045132674.png

 

The ROM_Variable is the variable saved in defined FLASH position.

I hope it could help you.

Best Regards,

Stano.

1,733件の閲覧回数
AjRj14
Contributor III

Thanks StanoA.

But after building the project, the ROM_VAR_SPACE area is not getting reflected in the .sx file.

Is this expected one? For the ROM_VAR_SPACE area to get reflected in .sx file, what I have to do. Could you please help me on this.?

 

Thanks in advance..

0 件の賞賛
1,709件の閲覧回数
StanoA
NXP TechSupport
NXP TechSupport

Hello AjRj14,

Sorry for my mistake – it has to be used:

#pragma DATA_SEG ROM_VAR

Then define such data… and at the end use:

#pragma DATA_SEG DEFAULT

The CODE_SEG saves the functions and the DATA_SEG saves the data.

Sorry once again.

Best Regards,

Stano.

0 件の賞賛
1,703件の閲覧回数
AjRj14
Contributor III

Hi StanoA,

But I was using the DATA SEG only and not CODE SEG, as you have mentioned in the previous screenshot.

AjRj14_0-1634127127620.png

Please find my .prm file and main.c attached.

 

0 件の賞賛