ESP32 SRAM

ayaz003
Posts: 2
Joined: Tue Apr 21, 2020 9:00 pm

ESP32 SRAM

Postby ayaz003 » Thu Apr 30, 2020 1:50 pm

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
Attachments
Selection_231.jpg
Selection_231.jpg (46.44 KiB) Viewed 10852 times

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

Re: ESP32 SRAM

Postby ESP_Sprite » Thu Apr 30, 2020 2:17 pm

No, we cannot, as the numbers you specified are highly dependent on the program being compiled.

ayaz003
Posts: 2
Joined: Tue Apr 21, 2020 9:00 pm

Re: ESP32 SRAM

Postby ayaz003 » Sun May 03, 2020 5:47 am

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

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

Re: ESP32 SRAM

Postby ESP_Sprite » Sun May 03, 2020 9:12 am

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.

Who is online

Users browsing this forum: No registered users and 36 guests