This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F6779: Variable no initial

Part Number: MSP430F6779

When define variable no init.

Ex.

__no_init static volatile uint8_t Flag01;

What is a value in variable? 

This value dependent on what?

  • The code you write can make no presumptions about what is in Flag01 until a value is explicitly written to it by code inside a function.

    Thanks and regards,

    -George

  • I have 2 question.

    1. The data in RAM if not init, the data should be random right?
    2. From our test with no Vcc supply, and then on Vcc checking the data is something fixed (e.g., 0x71, 0x79). Why did data just vary in 2 values (0x71, 0x79) not random?
  • Hello,

    As George mentioned, you can make no presumptions about what is contained wihtin Flag01 as its uninitialized. The values you saw could be anything, or leftover data from device boot, depending on address compiler sticks that designator. 

  • RAM cells are bistable so at power up their initial state will depend on many things. Including process variations within the cell. This could result in fairly repeatable power up states for a particular cell. With variation between RAM cells on a device and between devices.

    It is not as if there is some demon in there stirring things up to provide truly random initial values.

  • Related to my software bug investigation, this Flag01 is not initialized.

     

    The bug will appear only when this value is 0x01 (expected reproduce by on and off vcc many time).

    Do you think this value possible to be 0x01 in sometimes (but now I cannot reproduce that, it just varies between 0x71 and 0x79)?

**Attention** This is a public forum