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.

How to store some data into MSP430 and not be clear when MSP430 power off with IAR SPPLEDemo project ?

Hi , I am developing in MSP430F5335 + CC2564 with  IAR Bluetopia SPPLEDemo project.

I want to store some data into MSP430 and not be clear when MSP430 power off.

I reference the msp430f66xx_flashwrite_02.c , and use the following code:

unsigned long * Flash_ptrD;   

Flash_ptrD = (unsigned long *) 0x1800; // Initialize Flash pointer
value = 0x1234; // Initialize Value
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY+ERASE; // Set Erase bit
*Flash_ptrD = 0; // Dummy write to erase Flash seg
FCTL1 = FWKEY+BLKWRT; // Enable long-word write
*Flash_ptrD = value; // Write to Flash
FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY+LOCK; // Set LOCK bit

And then print the following:

Display(("Flash_ptrD = %x\r\n",Flash_ptrD));
Display(("Flash_ptrD = %x\r\n",*Flash_ptrD));

the result is 

Flash_ptrD = 1800
Flash_ptrD = 1234

But when I turn off  and turn on the device , and print the value again.

It show the following:

Flash_ptrD = 0
Flash_ptrD = d032

So...It seems the data did not  store into memory. Did I missing something ?

How to store some data into MSP430 and not be clear when MSP430 power off ?

Thanks in advance.

**Attention** This is a public forum