Hello everyone,
I pushed some code to the 12.3.0 branch:
I finally implemented the eeprom storage emulation. This is based on the nrf5x Flash Storage library.
This was a bitch because it depends not only on SoftDevice but also needs some special initialization there. I missed that and all writes didn't work. That is the reason why eeprom_init() has to be called after ble_init().
Also, writing to flash memory do not work in debug sessions and this gave me some headache too
Some words about flash memory writes:
Flash Storage has no wear leveling. All variables always go to the same flash location. The documentation states that 20.000 write/erase cycles are guaranteed. If you calc with this and write f.i. some variables like TTM or SOC every minute, there is a chance of failure after ~300 hours of operation. I think the documentation is
very conservative but write failures may be an issue.
There is also the Flash Data Storage library which has wear leveling. But due to much greater memory overhead we have to split the data going to flash into pure configuration (one data block written at a stretch) and just some data written more often (like TTM / SOC / ...).
Best regards
Niklas