Page 1 of 1

ESP32 memory size advice

Posted: Wed Jan 12, 2022 10:36 pm
by djoshi
Hi

I am very new to ESP32.

I purchased a dev board , which has ESP32-D0WDQ6 (revision 1).

I am using Arduino in VS using Visual Micro.

When I build the project with the WIFI library I get the following message.
Program Sketch2 size: 688,086 bytes (used 52% of a 1,310,720 byte maximum) (9.54 secs)
Minimum Memory Usage: 38240 bytes (12% of a 327680 byte maximum)
Is there a reason the maximum size is showing as indicated above?

When datasheet shows:

• 448 KB ROM
• 520 KB SRAM

Re: ESP32 memory size advice

Posted: Thu Jan 13, 2022 1:16 am
by ESP_Sprite
ESP32 ROM is actual read only memory, as in: it's programmed in the chip design phase and you can't change it. ESP32 chips are paired with flash chips (which are e.g. 4 megabytes) and your sketch lives in a partition on that chip. ESP32 total RAM consists of a bunch of RAM regions, including things like hardware cache and IRAM, and some of that is not available for your sketch to store variables in, hence the lesser number.

Re: ESP32 memory size advice

Posted: Thu Jan 13, 2022 10:44 am
by djoshi
Thanks

If I understood is correctly the 4MB is the standard version of the module, there is also 8mb version and 16 MB version.

I am trying to develop my project using Visual Studio with a Visual Micro.

In the options, this is what is shown.
Vmicro.png
Vmicro.png (38.82 KiB) Viewed 12578 times
I understand that OTA is used for firmware update, which I will require.

But what is the purpose of SPIFFS, FAT and FATFS?

Are these necessary, as I need to use some small space e.g. 100bytes for some data like for EEPORM?

I also plan to external SD card in the future.

Re: ESP32 memory size advice

Posted: Fri Jan 14, 2022 3:39 am
by ESP_Sprite
SPIFFS, FAT/FATFS are file systems that allow you to use a chunk of your flash in the same way as you would use a SD-card. EEPROM-like things are actually stored in the NVS partition, and I think all of these choices come with a small NVS partition as it's needed for WiFi.

Re: ESP32 memory size advice

Posted: Fri Jan 14, 2022 3:44 am
by chegewara
Small advice:
- when you need to use partition layout which is not included in arduino then you can use partitions.csv in your project folder.
Here you can find all partition schemes included in arduino which you can use as reference:
https://github.com/espressif/arduino-es ... partitions