-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32 and ESP32 S3 PSRAM enabled (IDFGH-10755) #11971
Comments
Hi. The same issue has occured on my environment. ESP-IDF: v4.4.4 (e8bdaf9) The bootloader log says that the PSRAM is initialized correctly.
After some investigation, esp-idf/components/esp_wifi/src/wifi_init.c Line 274 in e8bdaf9
|
We're seeing this in MicroPython too. We build generic firmware images for both S2 and S3, with the following sdkconfig:
Our goal is that the generic S2 firmware image will work on any S2 board with or without spiram (and same for the generic S3 firmware). This works on S3, but on S2, we see the error described above when initialising wifi (via See the MicroPython issue here: micropython/micropython#12750 In some cases we also see
printed by Tested on both IDF 5.0.2 and |
Hi Espressif folks, hope you're all doing well. 👋 We figured this out in the case of MicroPython. By default if If PSRAM is not available, this obviously either fails to allocate or limits the free heap at runtime. We fixed it like this: wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
#if CONFIG_SPIRAM_IGNORE_NOTFOUND
if (!esp_psram_is_initialized()) {
cfg.cache_tx_buf_num = 0;
cfg.feature_caps &= ~CONFIG_FEATURE_CACHE_TX_BUF_BIT;
}
#endif
esp_wifi_init(&cfg); See micropython/micropython#12968 BTW, it is a bit weird that setting |
@projectgus good to hear from you again. It is related with a feature cache TX buffer, currently it is meaningful and therefore usable if there is a SPIRAM chip which provides large size of external memory. The original design didn't consider the case without SPIRAM but with CONFIG_SPIRAM. Normally, To support the case without SPIRAM but with CONFIG_SPIRAM, there is one more thing to consider: the recommended Wi-Fi/LWIP buffer configure for the cases with SPIRAM and without SPIRAM are different. Do you think it is acceptable that we set all of buffer number to default number without SPIRAM if detect SPIRAM fail? |
Thanks @jack0c, good to talk to you too!
Thanks for the explanation. Would it be enough for the Wifi library to test
Thanks for the note. I added some more changes in the MicroPython PR: On ESP32-S3 the memory usage of Wi-Fi now seems the same as when compiled with
Actually I don't think this is an ESP-IDF bug. However, it's important for the user to consider the settings if Maybe it is enough to add a note in the help for |
@projectgus have confirmed that
Yes, it is more flexible if we just added some notes in the help of CONFIG_SPIRAM_IGNORE_NOTFOUND, we can also add some warnings in the places where the features deeply on the SPIRAM. |
Answers checklist.
General issue report
I have enable the config as show below and when deployed on a non PSRAM hardware the WIFI will not connect. Is there a workaround or additional config that would make this work? The same exact code would work if
CONFIG_ESP32_SPIRAM_SUPPORT
is set ton
IDF: 4.4.5
for ESP32
for ESP32 S3
Update:
Additional Information. when calling the
esp_wifi_init
it return out of memory error (257).The text was updated successfully, but these errors were encountered: