I'm using Roger Clark's core... I''m familiarizing with the included EEPROM library... In the beginning was just only dark... but fortunately I found this PDF from ST that clarify a lot, it is " Implementing EEPROM emulation" AN2594 :
https://www.st.com/resource/en/applicat ... ronics.pdf
I guess the library is built around this document...
I tried to search more in the old https://stm32duinoforum.com/ but links are missing for now...
I have some points that are not entirely clear... so I go in order of importance...
- 1) in the example I saw that the Page size is configurable... right now it is set at 1kB... it give me 256 storable virtual addresses (16 bit taken by the virtual address and 16 bit taken by the data I'm storing)
I don't need so many values... does make sense to have a smaller page of 64 storable values (64 x 32 / 8 byte) ? or the MCU architecture is done in a way that also if you have a smaller page, that 1 kB is however not usable in other way.... ?
Does the fact of having 1KB reserved for a page benefit the Wear leveling algorithm so the virtual addresses can be written every time in different physical addresses in the MCU Flash?
If I didn't get it wrong the library will use actually 2 KB (2 pages) to have 256 cells of 16 bit each... in order to move the virtual addresses (0 to 255) and their data... deleting and rewriting... when the data need to be modified... 10.000 of writing capability is more than enough for 20 years in my case...
- 2) in the example everything is written in Hex... I tried to use Decimals for addresses and value stored and it seems to work
- 3) Empty (not written) virtual addresses return 130 dec (82 hex)…
Thanks
Maurizio