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.

MSP430FR5849: Persistent Data and How it Actually Works?

Part Number: MSP430FR5849

Tool/software:

Hello!

I am currently attempting to use the MSP listed in the forum as a data collector and I am trying to store the data into the FRAM by using the "#pragma PERSISTENT". I don't fully understand how this works. The compiler tells me that the variables have to be initialized, but wouldn't that clear the data in the FRAM as well? Is there a way to set the variables up such that it won't be cleared on start up, in case I lose power? Below is how I have the variables set up with in my code, any help would be greatly appreciated!

#pragma PERSISTENT(accel_x)
#pragma PERSISTENT(accel_y)
#pragma PERSISTENT(accel_z)

signed char accel_x[array_length] = {0};
signed char accel_y[array_length] = {0};
signed char accel_z[array_length] = {0};

Thanks!

**Attention** This is a public forum