STM32 EEPROM Emulation vs HAL_FLASH and HAL_FLASH_EX driver

2k views Asked by At

Looking to confirm options to persistently save values on an STM32H7 device.

My understanding of the high level options are:

  1. EEPROM Emulation with eepropm.h/c (which uses the HAL_FLASH/EX drivers)
  2. HAL_FLASH and HAL_FLASH_EX drivers, stm32h7xx_hal_flash.h/c stm32h7xx_hal_flash_ex.h/c
  3. External storage of some kind, EEPROM, FLASH, ect.

Are there any other library options for doing this?

What is the added value of the eeprom library?

As far as I can tell, the eeprom library only provides 3 functions, and is not all that configurable. I see it as more of an example that could be modified than a library that is ready to use.

ST AN4061 App Note For reference the ST app note for STM32F0xx eeprom emulation, suggestions adding wear-leveling yourself, but also in the introduction states:

  • "At least two Flash memory pages to be used, more if possible for wear leveling"

This implies to me there is wear leveling.

Additionally, are these options thread safe? the HAL_FLASH driver does have interrupt options, but the eeprom library does not make it clear how to, if possible make that happen.

Options that provide wear-leveling and are thread safe would be preferred.

0

There are 0 answers