ESP32 memory size advice

djoshi
Posts: 53
Joined: Wed Jan 12, 2022 9:59 pm

ESP32 memory size advice

Postby djoshi » Wed Jan 12, 2022 10:36 pm

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

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

Re: ESP32 memory size advice

Postby ESP_Sprite » Thu Jan 13, 2022 1:16 am

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.

djoshi
Posts: 53
Joined: Wed Jan 12, 2022 9:59 pm

Re: ESP32 memory size advice

Postby djoshi » Thu Jan 13, 2022 10:44 am

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 12568 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.

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

Re: ESP32 memory size advice

Postby ESP_Sprite » Fri Jan 14, 2022 3:39 am

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.

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32 memory size advice

Postby chegewara » Fri Jan 14, 2022 3:44 am

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

Who is online

Users browsing this forum: Google [Bot] and 70 guests