cancel
Showing results for 
Search instead for 
Did you mean: 

Does erasing erased sectors in flash count as a write/erase cycle?

PLuyc
Associate

The reason why I want to know this is the following:

We used AN3969 to create a EEPROM emulator in flash on an STMF407. After 1 to 4 years, we saw that on a minority of appliances (less than 0.5%) the emulated EEPROM was erased and the data written to it was gone. We are sure there was data in EEPROM.

Data is only written to EEPROM when preparing the boards. In the field, nothing is written to EEPROM. So it is unlikely the emulated EEPROM is getting corrupted by writing data to it.

When investigating the code, I saw that each time the EEPROM layer from AN3969 is initialized, it will erase the unused page. It is possible the board resets multiple times on a day and only the first page is used by our software. This means the second page is always erased when the init function is called.

Now I am wondering if it is possible to destroy the flash when erasing an already erased section multiple times. I have read that erasing NOR flash will first write all zeros to the section and then make all bits one again.

3 REPLIES 3
Uwe Bonnes
Principal III

Yes, erasing sectors counts as erase cycle.

AvaTar
Lead

Could possible be.

Erasing one sector requires the whole Flash bank to be set under the internal erasing/programming voltage, wich is about 9...12 volts.

Doing this thousands of times, I can imagine this has an effect on the the other sectors. A flash bit state is just an electrical charge on an isolated gate.

You would want ST to comment this issue.

Perhaps inquire via support or FAE.

Pavel A.
Evangelist III

IMHO this is a point that a software designer should have thought of. Before erasing a sector, read it and check if all bytes are FF. Then do not erase. Quick and cheap.

-- pa