ESP32C3 internal flash memory

khu8rt
Posts: 9
Joined: Sun Aug 21, 2022 10:42 pm

ESP32C3 internal flash memory

Postby khu8rt » Sun Aug 21, 2022 10:48 pm

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

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32C3 internal flash memory

Postby lbernstone » 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

khu8rt
Posts: 9
Joined: Sun Aug 21, 2022 10:42 pm

Re: ESP32C3 internal flash memory

Postby khu8rt » Thu Sep 01, 2022 1:23 pm

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

ESP_Sprite
Posts: 9729
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32C3 internal flash memory

Postby ESP_Sprite » 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.

khu8rt
Posts: 9
Joined: Sun Aug 21, 2022 10:42 pm

Re: ESP32C3 internal flash memory

Postby khu8rt » Sun Sep 04, 2022 5:25 pm

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

Who is online

Users browsing this forum: No registered users and 61 guests