2023-04-06 08:21 AM
2023-04-06 11:04 AM - edited 2023-11-20 08:48 AM
You can save all your parameters in flash permanently.
To minimize flash writes, load parameters from flash to RAM during startup and then also erase the data flash mmediatley (to prepare it for write).
Then you can work with RAM data parameters during runtime.
On shutdown save RAM parameters back to flash with write command.
To detect power shutdown use a GPIO or ADC input:
The large capacitor behind diode buffers the supply voltage for a short time. So there is enough time to write flash data on shutdown.
For more safety you can also use double flash buffering (e.g. for very short on/off switching)...
2023-04-06 09:24 AM - edited 2023-11-20 08:48 AM
you need a backup 3v3 cell, Vbat. then backup registers can keep content...
2023-04-06 10:26 AM
Reboot under power or with lost power ?
Read X-CUBE-EEPROM - EEPROM emulation expansion software for STM32Cube - STMicroelectronics
2023-04-06 11:04 AM - edited 2023-11-20 08:48 AM
You can save all your parameters in flash permanently.
To minimize flash writes, load parameters from flash to RAM during startup and then also erase the data flash mmediatley (to prepare it for write).
Then you can work with RAM data parameters during runtime.
On shutdown save RAM parameters back to flash with write command.
To detect power shutdown use a GPIO or ADC input:
The large capacitor behind diode buffers the supply voltage for a short time. So there is enough time to write flash data on shutdown.
For more safety you can also use double flash buffering (e.g. for very short on/off switching)...
2023-04-11 09:35 AM
Why not the eeprom?
2023-04-12 12:18 PM
i read about very limited write cycles allowed?
2023-04-12 12:18 PM
thank you, that is very smart
2023-04-12 01:23 PM
Where did you read about the limited write cycles? There is no eeprom at all as i found out...
2023-04-12 02:51 PM - edited 2023-11-20 08:48 AM
see datasheet: 10.000 erase/write cycles are guaranteed for internal flash: