cancel
Showing results for 
Search instead for 
Did you mean: 

Writing to Flash

arne
Associate II
Posted on January 23, 2012 at 11:42

Hi there,

I am implementing a emulated EEPROM in flash memory on a STM32 microprocessor, mostly based on the Application Note by ST (AN2594 - EEPROM emulation in STM32F10x microcontrollers).

The basics outline there and in the respective Datasheet and Programming manual (PM0075) are quite clear. However, I am unsure regarding the implications of power-out/system reset on flash programming and page erasure operations. The AppNote considers this case, too but does not clarify what exactly happens when a programming (write) operations is interrupted:

  1. Does the address have a arbitrary (random) value? OR

  2. Are only part of the bits written? OR

  3. Does it have the default erase value 0xFF?

Thanks for hints or pointers to the relevant documentation.

Thanks in advance,

Arne

#stm32-flash
1 REPLY 1
Posted on January 23, 2012 at 16:01

Probably because given the range of possible failure modes, the flash array state is indeterminate.

So, you write data in packets, closing them with a checksum to confirm they wrote completely/validly. You have fault tolerance, and recovery, mechanisms where you retry writes that fail, confirm if writes completed, and erase and rewrite current content, as required.

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