NO_INIT does not work

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

NO_INIT does not work

Jump to solution
1,090 Views
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

Labels (1)
Tags (1)
0 Kudos
1 Solution
383 Views
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

View solution in original post

0 Kudos
3 Replies
384 Views
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 Kudos
383 Views
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 Kudos
383 Views
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 Kudos