NO_INIT does not work

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

NO_INIT does not work

ソリューションへジャンプ
1,959件の閲覧回数
admin
Specialist II

I using HCS12 microcontroler. I declared a variable in RAM with NO_INIT qualifiers. But it seems like on some units, the variable is initialized have POR. Does someone have an idea why?

 

//.prm

  RAM_NO_INIT =  NO_INIT              0x0000400F TO 0x0000400F;

_RAM_NO_INIT                     INTO RAM_NO_INIT;

 

//main

 

#pragma DATA_SEG _RAM_NO_INIT

static byte FirmwareUsbRequestFlag;

#pragma DATA_SEG DEFAULT

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,252件の閲覧回数
CrasyCat
Specialist III

Hello

 

Well if this is only happening on some units, that means that startup code is not modifying the values (as expected by the NO_INIT attribute).

 

Here I would recommend you to check what the MCU reference manual is saying about that.

Is content of RAM preserved after a POR? Under which conditions?

 

Also I would recommend you posting the question in the Hardware forums as this seems to be hardware related.

 

CrasyCat

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,253件の閲覧回数
CrasyCat
Specialist III

Hello

 

Well if this is only happening on some units, that means that startup code is not modifying the values (as expected by the NO_INIT attribute).

 

Here I would recommend you to check what the MCU reference manual is saying about that.

Is content of RAM preserved after a POR? Under which conditions?

 

Also I would recommend you posting the question in the Hardware forums as this seems to be hardware related.

 

CrasyCat

0 件の賞賛
返信
1,252件の閲覧回数
CrasyCat
Specialist III

Hello

 

What do you mean exactly with "on some units, the variable is initialized have POR"?

Are you expecting a specific value there?

 

The attribute NO_INIT in the linker files just tells the linker that startup code should not modify content of memory.

So value stored there is undefined (remains set to whatever was stored there previously.)..

 

CrasyCat

0 件の賞賛
返信
1,252件の閲覧回数
admin
Specialist II

The value stored in the NO_INIT region is not always preserved after a POR. But we do not observed this problem on all the microcontroler. 99% the value is fine, the content of the memory is not modified, but on some unit (that have the exact same hardware) the content is modified.

0 件の賞賛
返信