Limitation of the flash memory of nano esp32 (writing cycle)

Hello,

I programmed an arduino nano ESP32 to save a token received over MQTT in the flash memory. This token is used later to open a door with an RFID card (If token is in the RFID card then open the door)

This is working pretty well, however i am worried about the writing cycle limit of Arduino.
In fact, my token is updated 9 times a day, so in 3 years i will kill the memory (10 000cycles limit)

I am writing today to have some ideas or input, do you think i will kill the memory ? it is 16 bytes string so not a lot.

Thank you a lot

Hello, @petitsacados. Use external FRAM for this purpose or save the token in SRAM and copy it to FLASH only in case of power loss. Besides why do you even save the token in FLASH since it is updated so often? Or is the microcontroller not constantly powered?

+1 on using a FRAM

You can use it like EEPROM but write endurance is typically 10,000,000,000,000 times

You could try writing to different locations of the NVS 9 times a day and erasing daily or weekly ( there is ~2K of storage ) that would increase the life span to over 28 years.

Hello,

Thank you for your help.
I am just a noob i just thought it was better to do it that way :smiley:
Then i learnt few days ago about this limitation.

I will try to do as you all said. Thank you !

@ZX80 yes I think that this situation is ideal for NVS, even on a small partition the 16 byte token 9 or 10 times a day and erased daily or weekly then you wouldn't even have to think about wear leveling and it eliminates the need for additional hardware

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.