PSRAM disappears from get_free_heap_size around esp32_wifi (init and/or start)

jumjum123
Posts: 199
Joined: Mon Oct 17, 2016 3:11 pm

PSRAM disappears from get_free_heap_size around esp32_wifi (init and/or start)

Postby jumjum123 » Sun Jan 28, 2018 9:59 am

I've added some prints in my application, using esp_get_free_heap_size(), to find out where heap becomes smaller and got this:
After commenting both functions,(init and start) heap stays the same.
I'm not sure, is it esp32_wifi_init or esp_32_wifi_start. Picture changed during testing from time to time.
BTW, I checked heap after Adding pool of 4096K of external SPI memory to heap allocator, and its more than 4MB, from there to app_main in main.c 1MB disappears, but thats a different problem, at least in my eyes.

Code: Select all

WARNING: before esp32_wifi_init: 2997272
WARNING: esp32_wifi_init done: 2940184
WARNING: before esp_wifi_start: 2940184
WARNING: esp_wifi_start done: 53772
I checked with Enable SO_REUSEADDR option both enabled and disabled, problem stays

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: PSRAM disappears from get_free_heap_size around esp32_wifi (init and/or start)

Postby ESP_Angus » Mon Jan 29, 2018 1:17 am

Hi,

Similar to the issue with do_global_ctors(), I can't reproduce this on the master branch with a simple test case (I took the HTTPS protocol example and enabled PSRAM in menuconfig, free RAM is 4454112 -> 4398184 before/after WiFi initialization, which seems about expected).

Is there anything else you can please tell us (versions, details of config, etc) to help reproduce this? If you have a sample project which shows the behaviour, that would be ideal.

Thanks,

Angus

PS Just to be certain, there's no chance this is a race condition with a different task in your firmware allocating the RAM?

jumjum123
Posts: 199
Joined: Mon Oct 17, 2016 3:11 pm

Re: PSRAM disappears from get_free_heap_size around esp32_wifi (init and/or start)

Postby jumjum123 » Mon Jan 29, 2018 10:41 am

Hello ESP_ANGUS,

yes, this looks very strange. I sent you a message with some links to my private server.
Bandwidth is limited, therefore access is not free for the world :-(

Since my application is running without psram on a simple ESP32, I'm pretty sure, there is nothing in source to create this problem.

The board I'm using to test PSRAM is a LOLIN32 pro, hopefully it's not a board related problem.

regards Juergen

jumjum123
Posts: 199
Joined: Mon Oct 17, 2016 3:11 pm

Re: PSRAM disappears from get_free_heap_size around esp32_wifi (init and/or start)

Postby jumjum123 » Mon Jan 29, 2018 2:38 pm

After playing around for some time, esp_wifi seems not to be the problem.
At the end, memory disappears even without calling esp_wifi... functions.
Only have to add a vTaskDelay of about a second, and memory disappears.

To make sure, its not another task, an uart related task was not startet anymore, but even that did'nt change anything.
There are no other tasks, at least outside esp-idf.

One more info, I've wifi and ble(gap, gatts, gattc) enabled.
Becomes more and more confusing :?

jumjum123
Posts: 199
Joined: Mon Oct 17, 2016 3:11 pm

Re: PSRAM disappears from get_free_heap_size around esp32_wifi (init and/or start)

Postby jumjum123 » Mon Jan 29, 2018 10:04 pm

OH OH, I've to apologize. :(
Problem with disappearing of psram is handling of Pins in my application.
There is a function to set all free pins to pullup.
After some trial&error, gpio16 and gpio17 are removed from list of free pins.
Checking the datasheet I expected gpio16 only, anyway now it works.

To put some water into the wine, the problem with do_global_ctors still exists

Who is online

Users browsing this forum: No registered users and 62 guests