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.

MSP430FR5994: Sometimes the noinit variables changes to 0 after a software reset

Part Number: MSP430FR5994
Other Parts Discussed in Thread: MSP-CGT

We use some noinit variables in our MSP430FR5994 program. For example:
extern volatile unsigned int test_timer __attribute__ ((section(".TI.noinit")));

Normally, and that for nearly all the modules, after a software reset ("reset();") or a power down, all the noinit variables are still right, with the old initialisation values (the values saved before the reset or power down action). That's exactly what I expected. The NOINIT variables not changes, as they are stored "permanently" in the FRAM.

Now, on a small amount of devices (around 10% all devices), these noinit variables themes not to be saved after a reset. They always show "0" after a software reset or a power down reset. For example:
test_timer=10;   //Initialisation of the variable
reset();   //Software reset
//The test_timer variable is now reseted to o

I tried with the PERSISTENT Pragmas, but the result is the same.

Has someone encounted a similar problem? What could be the origin of this effect? What might be the solution to avoid the reinitialisation to 0 of all the noinit variables after a software reset? What is, according to you better to use NOINIT or PERSISTENT, if the variables should be saved after a reset?

  • Hi,

    It might related to what complier version you are using. Have you tried with the latest MSP-CGT v21.6.0.LTS https://www.ti.com/tool/MSP-CGT

    And for the NOINIT and PERSISTENT, they are pretty similar, and can both prevent such variables from being initialized during a reset. For there differences, you can refer to this link chapter 5.11.22.https://www.ti.com/lit/ug/slau132y/slau132y.pdf

    Best regards,

    Cash Hao

  • Thank you for your answer.

    I tried it with the newest compiler version (v21.6.0.LTS), but unfortunately this didn't changes anything. The noinit variables still reseted to 0 after a simple software reset. Initially I used the v20.2.0.LTS compiler version with CCS Version 11. So the compiler version isn't involved.

    Independently of the compiler version, what I found very strange, is that this error only occurs  on a small amount of devices, with the same hardware and software. On all other devices, the variables still remains in the memory after a software reset or power down. On all other aspects, I couldn't found any differences between the devices (LPM, communication, current consumption, ...). They are all identical, worked well, and do all the things as I expected.

    Has someone another idea to resolve this problem?

  • HI,

    That is weird. When you use the PERSISTENT to define those variables. Is enable the MPU will help to solve the reset issue?

    Best regards,

    Cash Hao

  • Hi,

    Unfortunately I didn't understand exactly what you mean with " Is enable the MPU will help to solve the reset issue?".

    I found that the same variables, with the same CCS source code and compiler reacts differently in different MSP430FR5994 µC units. On most of them, all is OK, but on a small amount of devices, the memory is always reseted to 0 after a software reset, and that independently of the use of NOINIT or PERSISTENT. On the other hand, there is no other device, that consumes current on our PCB (3,4V, current<2mA).

  • Hi,

    After you define those variables, enable the MPU function to protect that FRAM area. You can refer to UG about how the MPU works. And you can refer to this example code about how to enable the MPU function. https://dev.ti.com/tirex/explore/node?node=A__AFyrz5oWa9pbb95w3rkZiA__msp430ware__IOGqZri__LATEST&placeholder=true

    It would be the easiest way if enabling the MPU could help to solve the issue. 

    Best regards,

    Cash Hao

**Attention** This is a public forum