Other Parts Discussed in Thread: MSP430F169
Hi, I was just playing around trying to figure out the segment erase procedure on the MSP430F169. As far as I can tell, I'm following all the steps in the pdf manual:
//erase segment
FCTL1 = FWKEY + ERASE; // Set Erase bit
FCTL3 = FWKEY; // Clear Lock bit
*Flash_ptr = 0; // Dummy write to erase Flash seg
FCTL3 = FWKEY + LOCK; // Set LOCK bit
Before this code, I filled the segment (starting at 0xF200) with a bunch of values. Then, I was trying to use this code to erase that segment.
However, looking at the memory viewer while stepping through the code, I can still see all the values remaining after the lock bit is set on the last line. The dummy write turns all the values into 0x3fff temporarily, then back to their original values.
I'm thinking I overlooked something. The watchdog and interrupts are disabled. Either this segment is being erased and I'm not recognizing this on the memory viewer (in CCE v3), or there's something I'm missing.
Any insight would be appreciated :)