Page 1 of 1

ESP32C3 internal flash memory

Posted: Sun Aug 21, 2022 10:48 pm
by khu8rt
Hello,
I am new to espressif and bought a devkit based on esp32 with 4MB embedded flash. i have some questions.
What type of flash is included in the SOC?
What are the maximum number of write cycles for this flash?
I cannot find example code on how to access this flash, i want to store a float value on this flash.
Thanks in advance

Re: ESP32C3 internal flash memory

Posted: Mon Aug 22, 2022 3:52 am
by lbernstone
it is quad SPI flash
It is rated for about 10000 cycles. It is not appropriate for storing highly volatile data. It will likely work for most uses, even to the point of storing somewhat ephemeral data like authentication cookies, particularly if you use a write method with wear leveling (eg fatfs or nvs).
The Preferences library will show you some examples of storing basic keypair data.
https://github.com/espressif/arduino-es ... ounter.ino

Re: ESP32C3 internal flash memory

Posted: Thu Sep 01, 2022 1:23 pm
by khu8rt
lbernstone wrote:
Mon Aug 22, 2022 3:52 am
it is quad SPI flash
It is rated for about 10000 cycles. It is not appropriate for storing highly volatile data. It will likely work for most uses, even to the point of storing somewhat ephemeral data like authentication cookies, particularly if you use a write method with wear leveling (eg fatfs or nvs).
The Preferences library will show you some examples of storing basic keypair data.
https://github.com/espressif/arduino-es ... ounter.ino
Thanks for the info, i am still not able to access this memory to store some data permanently. have any hints? there is no example included with the IDF for this task

Re: ESP32C3 internal flash memory

Posted: Fri Sep 02, 2022 12:41 am
by ESP_Sprite
There's multiple ways to do that; if all you want to do is store a float then nvs seems to be the most applicable. Nvs has examples in the esp-idf directory if you need them. I believe the Arduino equivalent would be the 'preferences' library.

Re: ESP32C3 internal flash memory

Posted: Sun Sep 04, 2022 5:25 pm
by khu8rt
ESP_Sprite wrote:
Fri Sep 02, 2022 12:41 am
There's multiple ways to do that; if all you want to do is store a float then nvs seems to be the most applicable. Nvs has examples in the esp-idf directory if you need them. I believe the Arduino equivalent would be the 'preferences' library.
Thanks, i was able to write data and read after power loss