Page 1 of 1

WiFi TX static buffers error

Posted: Fri Jun 10, 2022 7:51 am
by kasper
Hi,

I'm trying to allocate as much static buffer as possible for the WiFi TX module.

In menuconfig the maximum number of buffers should be 64, but if I'm allocating more than 32 (e.g. 33), the esp crashes when booting:

Code: Select all

ESP_ERROR_CHECK failed: esp_err_t 0x101 (ESP_ERR_NO_MEM) at 0x4038017c
I'm using the ESP32-S3, and have tried both with and without PSRAM.

Is it possible to allocate more than 32 static buffers for WiFi TX module?

please see this thread for more context: https://www.esp32.com/viewtopic.php?f=13&t=27665

Thanks

Re: WiFi TX static buffers error

Posted: Mon Jun 20, 2022 6:19 pm
by kasper
No one who have tried to allocate more than 32 static buffers to the WiFi module?

Thanks,

Re: WiFi TX static buffers error

Posted: Tue Jun 21, 2022 4:26 pm
by boarchuz
The more static WiFi buffers you have, the less heap memory is available, the more likely the allocation failure you're seeing.

The configuration option isn't aware of how much memory you'll actually have available - every application is different - so the maximum (64) might not be possible in your particular scenario.

You will need to reduce memory used elsewhere (or put things in PSRAM where possible) if you want to free up some memory for more static WiFi buffers.

Re: WiFi TX static buffers error

Posted: Wed Jun 22, 2022 7:11 am
by kasper
Thanks boarchuz,

sure its eating at my available heap, but the thing is that I can never go beyond 32 buffers, even if my application dosen't do anything else, and even with 8MB of PSRAM available

thanks

Re: WiFi TX static buffers error

Posted: Wed Jun 22, 2022 9:21 am
by boarchuz
I tried it myself with both ESP32 and S3, and you're right - they return ESP_ERR_NO_MEM even though all heap_caps_get_x() functions report plenty being available. Seems that either the config option should be capped to 32 if there's some reason for the limitation or there's a bug in WiFi initialisation. It might be worth creating an issue on GitHub.

Re: WiFi TX static buffers error

Posted: Thu Jun 23, 2022 9:11 am
by kasper
Perfect, I have opened an issue

https://github.com/espressif/esp-idf/issues/9217

thanks