Hello, I testing our evaluation board MSP-EXP430FR5994. I have problem with save variable into FRAM memory.
I used pragmas "#pragma NOINIT(x)" and "#pragma PERSISTENT(x)" and value is save to memory and when is devices reset or power off variable stay in memory. But when I debugging or upgrade the firmware, value is disappear. I need this for save config of device. With PERSISTEN is set tu default value (in my example to 10) and for NOINIT is set to 0xFFFF. Is any solution save any value to FRAM memory and stay value same before upgrade FW or debug?
#pragma NOINIT(rstCount)
#pragma LOCATION(rstCount, 0x004400)
uint16_t rstCount;
#pragma PERSISTENT(rstCount2)
#pragma RETAIN(rstCount2)
uint16_t rstCount2 = 10;
uint16_t firstInit = 1;
int main(void) {
WDT_A_hold();
//Here is any clock init, wdg init, clock init and so on
firstInit = 1;
while(1){
if(firstInit){
firstInit = 0;
rstCount++;
rstCount2++;
//Posle data po UART0
EUSCI_A_UART0_transmitData(rstCount);
}
}
}