Part Number: MSP430F1611
Hi everyone,
I modified the msp430 Flash example to overwrite the msp430 Flash without Erase. If I understand writing to Flash correctly, this should fail (since you cannot convert 0 to 1 without erase).
But strangely this seems to work. I would like to understand if doing something like this will corrupt the Flash. Here is the modified code from the example.
void write_SegA (char value)
{
char *Flash_ptr; // Flash pointer
unsigned int i;
Flash_ptr = (char *) 0xBE00; // Initialize Flash pointer
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY + WRT; // Set WRT bit for write operation
for (i=0; i<128; i++)
{
*Flash_ptr = i; // OVERWRITING WORKS
}
FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY + LOCK; // Set LOCK bit
}