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.

MSP430F6720: Flash Memory Error

Part Number: MSP430F6720

Hi Experts,

we're using the MSP430F6720 processor in a device we use in industrial control systems. We're experiencing data loss in the information memory where we store the device's parameters, for reasons we can't pinpoint. We're using the following code as the write routine to Flash. Do you have any suggestions for resolving this issue?

void Write()
{
	WDTCTL=WDTPW+WDTHOLD+WDTTMSEL;
	int *Flash_ptr=(int *) 0x1800; // Flash pointer
	unsigned int i;

	FCTL3 = FWKEY;                            // Clear Lock bit
	FCTL1 = FWKEY + ERASE;                    // Set Erase bit
	*Flash_ptr = 0;                           // Dummy write to erase Flash segment

	FCTL1 = FWKEY + WRT;                      // Set WRT bit for write operation

	for (i=1; i<MenuSon; i++)
	{
	  *Flash_ptr++ = *(Menu[i].Address);                   // Write value to flash
	}

	FCTL1 = FWKEY;                            // Clear WRT bit
	FCTL3 = FWKEY + LOCK;                     // Set LOCK bit

	WDTCTL=WDT_ADLY_1000;
}

Regards,

Marvin

  • Hi Marvin, 

    We're experiencing data loss in the information memory where we store the device's parameters

    I would like to know what kind of data loss this is, such as whether it occurs at a fixed location or at any arbitrary data location.

    Moreover, not sure whether starting from 1 was intentional, if not, will cause the Menu[0].Address value lost.

     

    Best Regards,
    Peter

**Attention** This is a public forum