Hello,
I'm trying to do a CRC calculation of my code space in flash and the MSP hangs if I attempt to read from range 0x11000 to 0x11c00:
Here's the code:
const uint32_t startAddr = 0x11000;
const uint32_t endAddr = 0x11C00;
uint32_t i;
unsigned char CRCRESULT_LSB, CRCRESULT_MSB;
WDTCTL = WDTPW + WDTHOLD;
CRCINIRES = 0xFFFF;
for (i = startAddr; i <= endAddr; i++){
CRCDIRB_L = *(unsigned char*)(i);
}
CRCRESULT_LSB = CRCINIRES_L; // value stored at 0x1A02
CRCRESULT_MSB = CRCINIRES_H;
Interrupts are disabled, WDT are disabled. PMM are set to V(CORE) level 3.
I've confirmed it's not related to the CRC16 module by replacing the CRC related code with something else that reads from flash. So it seems like a flash read issue to me.
If I replace startAddr and endAddr to 0x10000 and 0x11000, the code works fine. In fact as long as I avoid 0x11000 to 0x11c00, 0x21000 to 0x21c00, 0x31000 to 0x31c00 and 0x41000 to 0x41c00, it works.
In debug mode, I found that the MSP hangs in this while loop(copy_zero_init.c)
/*------------------------------------------------------------------------*/
/* Zero initialize the output buffer. */
/*------------------------------------------------------------------------*/
#if __MSP430__
while(count--) WRITE8_ADV(outbuf, 0);
I checked the errata and couldn't find anything useful.
Any help is greatly appreciated.
Thanks,
Tian