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);