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.

  • TI Thinks Resolved

MSP430F5437A: Internal flash corruption

Prodigy 20 points

Replies: 1

Views: 98

Part Number: MSP430F5437A

Hi,

We use MSP430F5437A in our product and observed flash corruption instances happened in field. Below are the details –

Background :

  1. MSP430F5437A runs on 4MHz MCLK.
  2. ADC_ISR gets triggered through timer periodically. In order to execute ADC_ISR quickly, MCLK gets updated to 8MHz on entrance of ADC_ISR and restored back to 4MHz before returning from the ISR.
  3. Flash locations 0x30000 to 0x307FF may get erased or written inside the ADC_ISR. We do not use nested interrupt.
  4. We have supervisory circuit which ensures to issue a RESET pulse if VCC goes below 2.8 V

Observations :

We have quite few returned units from field where flash got corrupted randomly (we found some instances where info memory was also corrupted)

Following are few points, we are not sure the MSP’s behavior during those situations –

1. Is it OK to perform flash erase/write operation from ADC_ISR (or any ISR) context?

2. Our flash routines are guarded through following logic -

unsigned int gieState = __get_SR_register() & GIE;

__disable_interrupt();

/*** Flash erase/write operations *********/

__bis_SR_register(gieState);   // restore the GIE status

 

Since we erase/write flash inside the ADC_ISR, _disable_interrupt() and __bis_SR_register() gets called from ADC_ISR context. Is it OK to do so ?

3. Code uses ‘Long-word write’ mode for flash write operation. It uses memcpy() lib function to write into flash instead of running for loop…Is it OK to use memcpy() lib function instead of conventional for loop, after unlocking the flash ?

4. What if flash erase or write operation is still in-progress and supervisory IC issues a RESET pules? Will the flash memory (or info) which are not targeted for erasing/writing see any corruption?

5. The switching of MCLK between 4 MHz to 8 MHz and ice-versa through ISR context cause any harm?

Thanks,

Pradeep

  • Hello Pradeep,

    Thanks for your detailed post. I wouldn't recommend switching the MCLK frequency around but would rather see it at a fixed frequency. I'm concerned that adjusting the MCLK frequency is pushing your Flash Controller frequency out of spec which could cause memory corruption. Also, your supply voltage may not be high enough to support the higher frequencies. I wouldn't use the memcpy() function but would instead access the memory as we do in our code examples, either register-level or DriverLib.

    Please take some time to read through the Debugging Flash Issues on the MSP430 Family of Microcontrollers application report to learn more about what things can cause memory corruption and how they can be fixed (e.g. Table 1). This will be more helpful and more comprehensive than if I just listed them out here in the thread manually.

    Regards,

    James

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.