esp_http_client PSRAM use

milkolik
Posts: 11
Joined: Thu Mar 03, 2022 10:48 pm

esp_http_client PSRAM use

Postby milkolik » Tue Mar 29, 2022 1:12 am

Hi,

I am planning of using the

Code: Select all

esp_http_client 
component for a project.
I started by checking out the

Code: Select all

esp_http_client 
example code but I noticed that all 4MB PSRAM of my ESP are used by

Code: Select all

example_connect()
. Is this a quirk with this particular example code? Or does

Code: Select all

esp_http_client 
actually use all external RAM?

I plan on using some external RAM for storing some images from a camera so ideally I'd like to have some external RAM left.

Thank you!

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

Re: esp_http_client PSRAM use

Postby ESP_Sprite » Tue Mar 29, 2022 4:44 am

No, those examples are supposed to run even on a board without psram, so them using up a full 4MiB sounds odd. How did you measure this?

milkolik
Posts: 11
Joined: Thu Mar 03, 2022 10:48 pm

Re: esp_http_client PSRAM use

Postby milkolik » Tue Mar 29, 2022 5:07 am

I am doing heap_caps_get_free_size(MALLOC_CAP_SPIRAM) to get the available external RAM.

I dug a bit deeper and the problem seems to be when initializing the MAC part of the w5500 ethernet module I am using.

But still not sure what is going on. I think it's a bit suspicious that after initializing I get exactly 0 bytes remaining in the external RAM. I suppose if it was going overboard it would fail while trying to allocate, right? Almost seems like it is explicitly allocating all the available external RAM but I still haven't found if this is the case.

milkolik
Posts: 11
Joined: Thu Mar 03, 2022 10:48 pm

Re: esp_http_client PSRAM use

Postby milkolik » Tue Mar 29, 2022 5:37 am

Hmm interesting, I disabled PSRAM and it is indeed working without it!

However I do need the PSRAM for storing some images in it and currently I am unable to due to this issue. For some reason the moment I do the w5500 init the PSRAM goes to 0.

Is there a possible explanation aside of a hardware/power problem? Maybe a PIN configuration clash?

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

Re: esp_http_client PSRAM use

Postby ESP_Sprite » Tue Mar 29, 2022 7:36 am

Can you take a look at the startup messages; can you see the PSRAM being detected in there?

milkolik
Posts: 11
Joined: Thu Mar 03, 2022 10:48 pm

Re: esp_http_client PSRAM use

Postby milkolik » Tue Mar 29, 2022 3:08 pm

Yes. It is detected at the beginning but nevermind, I already found the issue. The problem is that I am using pin 16 for the w5500 module and it turns out that the ESP32-CAM also uses that for PSRAM chip select!

Thank you!

Who is online

Users browsing this forum: No registered users and 73 guests