Page 1 of 1

ESP32 SRAM

Posted: Thu Apr 30, 2020 1:50 pm
by ayaz003
According to datasheet ESP32 has 520KB of internal SRAM
But analyzing the datasheet and different sources i am confused about the orientation of the SRAM
So far i have made a table based on my study which is attached

Can Anyone Confirm the validity of the attached orientation table ?

Thanks

Re: ESP32 SRAM

Posted: Thu Apr 30, 2020 2:17 pm
by ESP_Sprite
No, we cannot, as the numbers you specified are highly dependent on the program being compiled.

Re: ESP32 SRAM

Posted: Sun May 03, 2020 5:47 am
by ayaz003
Thanks for your kind reply .. Actually I am asking how esp32 RAM is distributed for different purposes . What are their maximum size limits.

I know that static data or others size will change according to program compilation, i.e. the the compile time / static allocation .

But the sizes at the rightmost column of the given table is my guess on the max size limit of the ram for different purposes . I am asking if the numbers are correct or not . As far as i have searched i have not seen any max limit of the stack size of ram in esp32 . This is where my main confusion is

Re: ESP32 SRAM

Posted: Sun May 03, 2020 9:12 am
by ESP_Sprite
Iirc there is a limit of 160KiB for statically allocated data. The heap is the total amount of memory minus this amount. Stack is allocated on the heap, there is some restriction wrt contiguous regions etc but in theory you could allocate all of the heap as stack for various tasks. IRAM is a bit tricky as there is a region that can work as both IRAM and DRAM: if your IRAM usage grows too high, it eats up some of the DRAM that is available. Note that everything gets a bit more confusing because depending on what your program does, the OS / SDK libraries / WiFi / BT / ... will eat up some of that memory or have specific requirements wrt reserved ranges.