Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By atifkamal
#74925

A better implementation would be to use the SPI flash directly, and only perform an erase, when the 4kB sector is full.
You can do that by prefixing your data with a "magic byte" (!= 0xFF), so you can search for the last occurance of that magic byte within the sector and append new data without performing an erase. If you write 8bytes every 10s, a flash sector should last 16years that way.



Hi, Can you favour me with example code, as i want to store 8 relay states in persistent storage that could be reused after power recycle of nodemcu. I thinking to write these 8 bits after every state change that is not so frequent. Many thanks,