ESP32 maximum use of remaining Flash

Ajinkya_777
Posts: 8
Joined: Tue Sep 15, 2020 4:42 am

ESP32 maximum use of remaining Flash

Postby Ajinkya_777 » Sun Oct 04, 2020 4:11 pm

Hi,

I'm using ESP32 board with 8mb of flash. I choose this configuration because I wanted to store data in remaining portion of the flash chip. So flash partition I kept is nvs 0x5000 otadata 0x2000 app0 2M app1 2M spiffs 4M.
Here I wanted to store data in permanent memory.

I have main 2 questions in this
i) can i use EEPROM over 4096 bytes? like can i use all spiffs as eeprom (hole 4MB)
ii) how to use the flash in most optimize way and faster to read/write.

Thank you
Ajinkya

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

Re: ESP32 maximum use of remaining Flash

Postby ESP_Sprite » Mon Oct 05, 2020 7:22 am

You are talking about Arduino EEPROM? That is stored in the NVS partition if memory serves, not in SPIFS. Wrt how to use the flash optimally, that really depends on the application you're writing; if there were a general answer you'd find it in the docs.

Ajinkya_777
Posts: 8
Joined: Tue Sep 15, 2020 4:42 am

Re: ESP32 maximum use of remaining Flash

Postby Ajinkya_777 » Thu Oct 08, 2020 5:36 pm

ok thank you.

I'm using SPIFFS to store data into flash.
but I was just wanted to know weather we can create EEPROM library or any library so we can perform byte by byte operations in it.

Thank you
Ajinkya

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

Re: ESP32 maximum use of remaining Flash

Postby ESP_Sprite » Fri Oct 09, 2020 7:38 am

....possibly? But why not just use the existing EEPROM/Preferences library that's based on NVS?

Ajinkya_777
Posts: 8
Joined: Tue Sep 15, 2020 4:42 am

Re: ESP32 maximum use of remaining Flash

Postby Ajinkya_777 » Mon Oct 12, 2020 9:12 am

ESP_Sprite wrote:
Fri Oct 09, 2020 7:38 am
....possibly? But why not just use the existing EEPROM/Preferences library that's based on NVS?
okey
I use spiffs for flash storage and eeprom for nvs EEPROM.

Thank you so much.

Synectix
Posts: 20
Joined: Mon Dec 14, 2020 6:13 am

Re: ESP32 maximum use of remaining Flash

Postby Synectix » Thu Jan 07, 2021 11:34 am

Hi,

Another similar question on the same lines.....

In the WROOM-32E Module with 4MB flash, is it possible for me to use, say 200k or 300k of memory from the 4MB Flash for my data storage ?
My code is quite small and comes in under 2MB.

Alternately, if I use a 8MB Module, then I can have 4MB for code and 4MB for data ?
Is it just partitioning accordingly that I need to take care of or is there something else that needs to be done for this ?

Thanks

ESP_Minatel
Posts: 364
Joined: Mon Jan 04, 2021 2:06 pm

Re: ESP32 maximum use of remaining Flash

Postby ESP_Minatel » Thu Jan 07, 2021 12:14 pm

Hi,

You just need to create a custom partition and define the storage portion that you want.

For example, you can use something like this (partitions.csv):

Code: Select all

# Name,   Type, SubType, Offset,  Size, Flags
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
nvs,      data, nvs,     0x9000,  0x6000,
phy_init, data, phy,     0xf000,  0x1000,
factory,  app,  factory, 0x10000, 0x180000,
storage,  data, spiffs,  ,        2M,
Just be sure that you are not overwriting anything and to set the custom .csv file on the configuration (Partition Table menu).
Screenshot from 2021-01-07 12-09-44.png
Screenshot from 2021-01-07 12-09-44.png (39.6 KiB) Viewed 5535 times
To dive deeper in this subject, see the reference documents: Partitions

Who is online

Users browsing this forum: No registered users and 100 guests