How much SRAM is actually usable?

error404
Posts: 12
Joined: Thu May 12, 2022 8:54 am

How much SRAM is actually usable?

Postby error404 » Tue Jun 20, 2023 6:35 am

I'm developing a relatively large application on an ESP32-­WROVER­-E.
Currently I'm running into an issue, where i need more RAM. My goal is to store a JPEG (640x480), but i have only 35kB left, which isn't enough in some cases.

I don't wanna go into discussions about using dynamically allocated memory. I just have a few questions about the memory itself.

I'm wondering where all the SRAM goes...
According to the datasheet of the ESP32-WROVER-E, the used processor is a ESP32-D0WD-V3 with 520kB of PSRAM.

I set up my project with IDF and VisualGDB, selecting the ESP32-WROVER-E. In the Embedded Memory Explorer(picture attached) two RAM "partitions" are shown. INSTR_RAM(128kB) and DATA_RAM (320kB). Thats 448kB combined so I'm missing 72kB.

question 1: Where do these 72kB go?

The buffer i want to use goes into DATA_RAM. More specifically into the section .dram0.bss. Which is about 92kB. There's a second section in DATA_RAM called .dram0.data which is 28kB. Which leads to a total of ~121kB eventhough the DATA_RAM has 320kB. I'm missing 200kB.

question 2: Where do these 200kB go?
question 3: Is there an option to extend .dram0.bss since there are 200kB left in DATA_RAM?

I'm new to the ESP32 so I could be mistaken here.
But more than half of the SRAM seems unusable for me. That's not just a few kB missing here and there for other purposes.

Thanks in advance!
Attachments
Embedded_Memory_Explorer.jpg
Embedded_Memory_Explorer.jpg (139.96 KiB) Viewed 1481 times

MicroController
Posts: 1552
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: How much SRAM is actually usable?

Postby MicroController » Tue Jun 20, 2023 9:34 pm

question 2: Where do these 200kB go?
Heap.
question 3: Is there an option to extend .dram0.bss since there are 200kB left in DATA_RAM?
Notice that .data and .bss is RAM that's statically allocated, not free.

error404
Posts: 12
Joined: Thu May 12, 2022 8:54 am

Re: How much SRAM is actually usable?

Postby error404 » Thu Jun 22, 2023 7:54 am

That's sad news unfortunately.

But thank you for your answer!

Who is online

Users browsing this forum: Bing [Bot] and 161 guests