Memory math

Zeni241
Posts: 86
Joined: Tue Nov 20, 2018 4:28 am

Memory math

Postby Zeni241 » Wed Dec 19, 2018 10:50 am

Hi

I am using esp32doit-devkit-v1. When I build the sketch, I get following lines at the end:

DATA: [= ] 12.9% (used 42424 bytes from 327680 bytes)
PROGRAM: [====== ] 62.5% (used 819078 bytes from 1310720 bytes)


I am of the impression that this board has 4MB flash memory. But these line indicating that it has 1.3 MB and 0.32 MB Ram.
Is it usual and rest of the memory is used for some default configurations etc. ????
Also does it means I cannot update OTA as more than 50% memory is used????

User avatar
ESP_krzychb
Posts: 400
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Memory math

Postby ESP_krzychb » Wed Dec 19, 2018 11:19 am

Hi Zeni241,
Allocation of flash memory is defined in partition table.
For default configuration of Arduino it covers space for OTA as well.
Check, e.g. viewtopic.php?f=19&t=4349&p=19383

PeterR
Posts: 621
Joined: Mon Jun 04, 2018 2:47 pm

Re: Memory math

Postby PeterR » Wed Dec 19, 2018 11:21 am

PROGRAM: [====== ] 62.5% (used 819078 bytes from 1310720 bytes)
This is your IRAM memory. Programs run within IRAM and Cache.
The Cache allows your program to (effectively) use the slower 4MB FLASH as program memory.
DATA: [= ] 12.9% (used 42424 bytes from 327680 bytes)
This is your DRAM memory, your variables & constants.
There are also ESP modules with slower PSRAM which you may use if you run out of avriable memory.

So, you can OTA. On startup the selected partition will be loaded to IRAM. Your OTA partition may also keep code > IRAM size in FLASH and run that code via the Cache.
Alternatively you can disable Cache and so gain more IRAM.
& I also believe that IDF CAN should be fixed.

Zeni241
Posts: 86
Joined: Tue Nov 20, 2018 4:28 am

Re: Memory math

Postby Zeni241 » Wed Dec 19, 2018 12:53 pm

Thanks a lot guys for such quick response :P . Its a relief that I can update through OTA. :lol: I should learn more about partition tables etc.

Who is online

Users browsing this forum: Google [Bot], urbanze and 67 guests