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.

CCS / MSP430I2041:Msp430 i2041 flash erase problem?Here is my code

Part Number: MSP430I2041

Tool/software: Code Composer Studio

SEGSTART  0x1060

void write_InfoSeg(uint8_t* buf,uint16_t len) {
uint8_t *Flash_ptr; // Flash pointer
unsigned int i;

Flash_ptr = (uint8_t *)SEGSTART; // Initialize Flash pointer

FlashCtl_unlockInfo();
FlashCtl_eraseSegment(Flash_ptr);
FlashCtl_write8 (buf,Flash_ptr,len);
FlashCtl_lockInfo();
}

Every time I write, I always get stuck in this place.

/* Calibrate REF */
REFCAL1 = *(TLV_address_for_parse + TLV_CAL_REFCAL1);
REFCAL0 = *(TLV_address_for_parse + TLV_CAL_REFCAL0);

I suspect it's erasure.

I used another function and it didn't work.

FlashCtl_performEraseCheck(uint8_t *flash_ptr, uint16_t numberOfBytes);

**Attention** This is a public forum