cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F031 Flash memory cycles 10k exceeds? what will happen? is this value correct in the manual? some MCU have 10 to the power 15 cycles.

LSmit.5
Associate II

This Question is related to STM32F031xx MCUs and about the Flash memory endurance.

The official document states in chapter 6.3.10 Memory characteristics, that the endurance is Nend = 10k cycles.

-But isn't that very low number amount of cycles? I can imagine that some paramers storage logarithms can easily reach this amount.

-What will happen to the MCU when only one address exceeds the N(end-min) of 10k cycles? is it guaranteed that MCU will keep functioning? what if it keep writing to this adress?

-this concern is only related to parameters that is stored during lifetime and only purpose to read when the product would be returned to the factory.  

8 REPLIES 8

> some MCU have 10 to the power 15 cycles.

Surely not for FLASH.

FLASH in some other mcus have endurance given as 100 cycles.

Endurance (and retention) are a complex issue, but generally you get better endurance/retention with larger FLASH cell, i.e. smaller memories and larger = more expensive chips.

> What will happen to the MCU when only one address exceeds the N(end-min) of 10k cycles? is it guaranteed that MCU will keep functioning?

Most likely it is only that given address which will experience lowered retention, i.e. it will "forget" more rapidly (note, that this *is* actually documented in that very same table, for 10k writes and 85 degrees). However, depending on the particular construction of the FLASH, It may impact neighbouring FLASH cells, if you exceed the endurance value in a significant way.

JW

Uwe Bonnes
Principal III

This is a minimum value at extrem ambient confitions. Each flashing cycle will wear out flash and it will get more and more unreliable. But a sensible design will not hope that the real number of cycles reachable is higher than the number given in the datasheet. You will not find any flash that guarantees substantial more cycles.

Use other kind of non-volatile storage, like EEPROM, battery buffered RAM or NVRAM for such often written parameters or think about other approaches, like keeping in the parameter in RAM with a pre-powerfailure interrupt and writing to flash with this interrupt. Beware also, that flash needs to be erased first, with erase happening on chunks (pages/sectors)

Thanks for your answer. Then I need to search for MCU with different type of memory, since i guess this STM32F031 doesn't included EEPROM/FLASH memory with cycles upto 200.000times? the memory for this chip should only be used for the firmware logic i think.

Thanks, you explain about the "RAM with a pre-powerfailure interrupt and writing to flash with this interrupt", how save is this process, so it notice power down and tries to store parameters in flash quickly?

As Uwe Bonnes mentioned, 10k is the worst case number, guaranteed at maximal temperature.

For each 10°C you go lower, you can expect an increase in one order of magnitude. Giving several million cycles at room temperature.

The is a nice app note available my Microchip, which incidentally produces Flash chips as well. Can't find it myself at the moment ...

> Thanks, you explain about the "RAM with a pre-powerfailure interrupt and writing to flash with this interrupt", how save is this process, so it notice power down and tries to store parameters in flash quickly?

IMHO not a very good idea.

Erase and program takes quite a long time (especially erase), and increases power consumption.

You could try to design enough power reserve (large buffer caps), and do an "emergency programming". But for one thing, the worst case timing for erase/program are usually excessive, and second, electrolyte caps tend to age very fast, and loose capacity.

A former company of mine tried this - with the expected elevated rate of field returns ...

Thanks, Yes i agree it is complicated and still remains risc of incorrect data.

About the expected increase in order of magnitude at room temperature, then why does STM not put Endurance in a table for 3temperatures?

LSmit.5
Associate II

Still wondering about what all could happen to the flash if some bits/bytes/sectors/pages/flash/mcu start to fail. Upto which point the MCU starts to mallfunction?

Or like I currently understand is the retention-years will decrease for every Flash erare/write cycle.

And if rentention occurs the bit will go from 1 to 0 and therefore some values in the memory become corrupted and the program could fail because of the programmed LOGIC doesn't expect and introduces more and more flaws/bugs.

Because neither does the competitors, and they hardly ever test it (at room temperature).

This correlation is related to the Flash technology, which differs only in minor detail between vendors.

For lifetime calculation of commercial products, rely on the worst case numbers.

> Yes i agree it is complicated and still remains risc of incorrect data.

A good strategy would be to use two (separately erasable) sectors, and write in a ping-pong mode. This way, you have a set of fallback parameters/values.

You could refine your strategy with saving multiple checksum-protected parameter sets sequentially, and switch to the other sector when one "flows over". And erase the other sector when at least one set was successfully saved. Perhaps you could move some tasks (like sector erase) to the startup initialization, instead the shutdown save (less critical).