Skip to main content
matic
Associate III
April 12, 2016
Question

What happens if reset occurs during FLASH page erase?

  • April 12, 2016
  • 2 replies
  • 532 views
Posted on April 12, 2016 at 21:15

Hi.

First, I would like to ask about page erase time. As stated in RM (for STM32F303) it should last min. 20 ms to max. 40 ms. But I checked it with ETM profiler and the whole process of erase took only around 100 us. Do you have any idea why it could be that short?

Second, I would like to ask what happens, if reset occurs during page erase? Is it possible to say, how will this page look like after power on? Let say it was full of some data. After erase we know there are all FFs. But what, if reset occurs between that erase time.

Thanks
    This topic has been closed for replies.

    2 replies

    re.wolff9
    Senior
    April 12, 2016
    Posted on April 12, 2016 at 21:40

    From a physical point-of-view, I expect that more bits than before are going to read back ''1''. As a matter of fact, some bits (but only those that used to be zero) may have become ''unreliable'' in that they sometimes read 1 and sometimes zero. 

    If you need reliability, program some OTHER location in another page to say: I'm going to program page X. When you're done (and no reset occurred) you can program that location again to the value ''0'' to indicate: Programming finished. (On STM you're allowed TWO programming cycles of each location after each erase. Once from 0xff to any value you want. And once from that value to zero. )

    Tesla DeLorean
    Guru
    April 12, 2016
    Posted on April 12, 2016 at 21:54

    Yes, that does sound rather short. I guess I'd time it via a free-running timer outside of the debugger. The time tends to be a function of the supply voltage, into the charge-pump.

    Not sure the exact performance of the array is discussed. In general terms I believe the array is set to zero, and then set uniformly to ones. I suspect if the process doesn't complete properly some cells may report as one, but not be fully erased.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..