SLAZ169O October 2012 – May 2021 MSP430F2274 , MSP430F2274-EP
FLASH Module
Functional
EEI feature can disrupt segment erase
When a flash segment erase operation is active with EEI feature selected (EEI=1 in FLCTL1) and GIE=0, the following can occur:
An interrupt event causes the flash erase to be stopped, and the flash controller expects an RETI to resume the erase. Because GIE=0, interrupts are not serviced and RETI will never happen.
1) Do not set bit EEI=1 when GIE = 0.
or,
2) Force an RETI instruction during the erase operation during the check for BUSY=1 (FCLTL3).
Sample code:
MOV R5, 0(R5) ; Dummy write, erase segment
LOOP: BIT #BUSY, &FCTL3 ; test busy bit
JMP SUB_RETI ; Force RETI instruction
JNZ LOOP ; loop while BUSY=1
SUB_RETI: PUSH SR
RETI