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.

G2231的flash information memory 无法 erase segment

Other Parts Discussed in Thread: MSP430G2231
请问Ti工程师,
msp430G2231上用flash information memory遇到问题,下面的erase代码:
void do_flash_seg_erase(int *pdst)
{
WDTCTL = WDTPW + WDTHOLD;        //Disable WDT
//FCTL2 = FWKEY + FSSEL1 + FN0; //SMCLK/2
FCTL2 = FWKEY + FSSEL1 + 0x3f;
FCTL3 = FWKEY; //Clear LOCK
FCTL1 = FWKEY + ERASE;   // Enable segment erase 0xA500;
*pdst = 0;
FCTL3 = FWKEY + LOCK;           //done , set lock 
WDTCTL = WDTPW + WDTCNTCL;      //enable WDT
}
 
参数pdst = 0x1000, 执行到FCTL3 = FWKEY + LOCK;  时仿真器就跑飞了,单步走和连续运行都这样,
请问这个erase操作对吗?是否还要其他的初始化代码?
谢谢!