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.

What counts as a Flash Write/Erase cycle?

Other Parts Discussed in Thread: MSP430F1232

I'm using the MSP4302274. The specsheet claims a minimum endurance of 10k cyles. I'm unsure how these are calculated. Is a cycle a write OR an erase, or a write AND an erase?


Each segment is made up of 32 16-bit words. If I were to write into each of those 32 words (sequentially), then erase the segment, and repeat the process 9 times (so 10 times total), how many cycles would I have burned up for each cell? 10 or 20?

  • Thanks Brian. One more question:


    If power loss occurs while writing to a word in flash segment D, how much data is compromised? Just the word being written to? All of segment D? Or all three segments (B, C, and D) except for A assuming it was locked?


    What about power loss during an erase? Is only that segment compromised, or all segments?

  • About write and erase cycles, imagine a sheet of paper. You can write to it , but only one information at one location (well, you can write until it is all black, but this would swallow the information, just like on flash). Then you use an eraser and start over with a ‘clean’ sheet. The maximum of erase cycles is the number of times using the eraser before you have a hole in the paper (or you can’t erase it anymore so the new information is no longer clearly readable).

    In theory, the number of erase cycles is the maximum number of times an individual bit has been erased from ‘0’ to ‘1’ again. Erasing an already empty segment has less impact that erasing a segment where all bits had been written to 0. However, the specified endurance is the guaranteed worst-case minimum.

    What happens when power is lost during a flash write or erase, well, this can’t be predicted. When power fails, anything can happen. The flash controller can complete the process but the CPU runs wild due to undervoltage, and starts a new write or erase unintentionally and at the wrong process. (this can be prevented by using an SVS that resets the CPU on undervoltage)

    Or the current process does not complete. Data bytes are not or only partially written or may fall back to 0xff after some time (milliseconds to years). And erase might be incomplete, so bits are not erased or flip form 1 to 0 again after some time.
    However, it is rather unlikely that a different segment is erased or other bytes are (over)written. Because the first thing that fails is the programming voltage, before the control logic fails. So once the control logic fails, the programming voltage is already gone and it will do no harm.

  • Jens-Michael Gross said:

    What happens when power is lost during a flash write or erase, well, this can’t be predicted. When power fails, anything can happen. The flash controller can complete the process but the CPU runs wild due to undervoltage, and starts a new write or erase unintentionally and at the wrong process. (this can be prevented by using an SVS that resets the CPU on undervoltage)

    Or the current process does not complete. Data bytes are not or only partially written or may fall back to 0xff after some time (milliseconds to years). And erase might be incomplete, so bits are not erased or flip form 1 to 0 again after some time.
    However, it is rather unlikely that a different segment is erased or other bytes are (over)written. Because the first thing that fails is the programming voltage, before the control logic fails. So once the control logic fails, the programming voltage is already gone and it will do no harm.


    How does this work if the MCU (MSP4302274, which doesn't have SVS) is run at 16MHz? The specsheet says the minimum voltage to support 16 MHz is 3.3V. The minimum voltage for Flash programming is 2.2 V. Does the MCU have a chance of corrupting the flash memory every time it is powered down? In other words, if the MCU is NOT writing or erasing Flash, and power is lost, can it randomly decide to execute a write to Flash and therefore corrupt a segment?

  • Indeed, a rampaging CPU can do everything. Including an accidental execution of the flash write or erase functions with random ‘parameter’ values.
    If the flash controller is configured for write or erase, a failing CPU may do random reads or writes to memory locations and trigger flash writes or erase.

    For this reason, you should activate the SVS to hold the CPU in reset if the supply drops below the limit for proper CPU operation. Or use an external SVS.
    For the MSP430F1232, we use an external SVS with integrated watchdog, which monitors the 5V supply. If it fails, there's plenty of time to send the CPU into reset before the 3.6V regulator can't maintain VCC for the 8MHz operation.
    (It's not easy to find an external 3.6V SVS)

**Attention** This is a public forum