2016-05-23 03:29 AM
I am trying to emulate EEPROM on stm32f0. There is an application note provided by STM.
There are also sample code provided. To my dismay, this EEPROM emulation library uses standard peripheral library and my current code is based on HAL drivers with code auto-generated by CubeMX. Is there EEPROM emulation library based on HAL drivers? I would like to use the flash to store some configuration settings. Is no EEPROM emulation library using HAL drivers is available, are there other methods to store config settings on flash? #eeprom-emulation #flash #stm32f02016-05-23 09:39 AM
..are there other methods to store config settings on flash?
Around here we just manage the configuration/calibration structures directly in Flash sectors set aside for that function, rather than pretending it's EEPROM, when it's not.2016-05-23 07:07 PM
Thanks. EEPROM emulation does sound like an overkill. Would you know where I can get some sample code on how to do this directly on the flash? I am using stm32f0.
Thank you very much.2016-05-24 01:12 AM
I use EEPROM-Emulation for the F2 (AN3390) coded for the SPL in a HAL project. I manually included the SPL flash driver in my HAL project. As far as I remember I only had to rename the function FLASH_WaitForLastOperation in the SPL driver because of dual definition. If you want to manage your data in flash directly, remember that the number of write cycles to flash is limited.
2016-05-24 09:04 AM
... remember that the number of write cycles to flash is limited.
Pretending it is EEPROM doesn't change those physical properties, it just masks it with the same journaling and ping-pong techniques one could apply treating it directly as Flash, and you'd be more aware of the side-effects and stalling you're going to cause by the erase/write interactions. Better to own the abstraction in my opinion, far less surprises and more efficient.