External vs internal ram management

7374616e74
Posts: 2
Joined: Sat Jan 12, 2019 3:56 pm

External vs internal ram management

Postby 7374616e74 » Wed Jun 16, 2021 2:15 pm

Hi :)

I'm trying to add the esp32-camera to an existing project.
The camera example from esp-who works on one side (with external ram), and my existing project also works on its side (without external ram).

Now the problem I have is I run out of memory when trying to have them both in the same firmware.

Is there a way to tell all the standard libraries (wifi/mqtt/http/etc..., which is 90% of the existing app) to use the internal memory and reserve the external memory to the camera management (framebuffers mainly) only?
It seems that once the external ram is enabled everything goes to the external memory that can't seem to handle everything at once, while my existing project works perfectly on internal memory alone.

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

Re: External vs internal ram management

Postby ESP_Sprite » Thu Jun 17, 2021 2:15 am

You could set esp-idf to use malloc() to only allocate in internal memory and use heap_alloc_caps() to explicitly allocate in external memory, but I don't think that is your issue. It could be that the camera example uses both internal as well as external RAM heavily, and you adding your own code makes the entire thing just run out of RAM altogether. Alternatively, you may be running out of one specific type of RAM (e.g. IRAM) only; do you get a specific error message?

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 142 guests