HI ALL. In Our project with STM32F103 we're using FLASH as EEPROM. with reffering to "AN2594 Application note EEPROM emulation in STM32F10x microcontrollers".
in some cases that we encountered, 2 types of failure occur.
1- when powering up, ALL sectors of flash, are Erased. we guess ESD makes all sectors erased. with additional protection in power circuit, this problem solved.
2- after powering up, we realized that 2 sectors which used as eeprom, are Erased. (not all sectors containing program). in other words, program works properly but saved data does not exist anymore.
As I saw in mentioned Application Note at above, section 3.3 "Page header recovery in case of power loss" according table 2, "three of which are invalid" . with refer to "eeprom.c" in ST's Example (we use this APIs), I understood according to this document, in this 3 states 2 flash sectors that used as eeprom, will format.
"/* Invalid state -> format eeprom */"
can anyone says how to handle this problem. should we use POR or PDR? HOW?
and about my first question? Is there any advices ?
thanks.
