Using EEPROM on ESP32

Hi Zerynth support team!

I’m trying to use ESP32 EEPROM for my project.
I’m using ESP32 devkitC board.
I tired to find library and example or similar articles for using the esp32 internal eeprom, but I couldn’t find anything.
I can use esp8266 or esp32 eeprom using eeprom library on Arduino IDE. I’d like to use the eeprom on zerynth as well. Is it possible to use ESP32 EEPROM on Zerynth?
If so, could you provide me examples or library for using EEPROM?

Thank you always for your help.
Anatoli.

You can use the flash module to write to non volatile internal memory :
https://docs.zerynth.com/latest/reference/core/stdlib/docs/flash/
Here is an example :
https://docs.zerynth.com/latest/reference/core/stdlib/docs/examples/#flash-internal
do not forget to write in flash locations according to the ESP32 flash layout.

Hi @karimhamdy1

Thanks for your help. I tired a test code using the flash example. I a few questions with the flash operation.

  1. What’s the meaning of close() function? What can it be used for?
  2. Is there any way to erase the user available area in flash to the default value? I need to format the user available area to the default values(0) before sending my devices to customers.

Thanks in advance.
Anatoli.