The use of the ESP8266 in the world of IoT

User avatar
By Rajeev
#11430 Hi All, I have looked up at the code for the functions user_esp_platform_load_param and user_esp_platform_save_param

It appears to be saving and loading some parameters (4 byte aligned) into one of the sectors alternatively and storing an associated flag in another sector.

My question is - Is it done to achieve wear levelling of flash memory. I ask this because the sector where flag is being stored is erased each time when we store (save) the params. Then how come this is reducing the wear? How does it differ from storing and saving the params in one sector ? Do we get any benefit

Alternatively, if there is some other functionality being achieved by this code fragment, can anyone please explain the same?
User avatar
By Rajeev
#11620 I myself have resolved it. The code referred in OP is just to save the two versions of state of variables and when called for reload, it loads the last value save in flash ram.

This, no way helps in wear levelling of fash or optimizing the usage.