Skip to content
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

Fix Wi-Fi failing to connect on non PSRAM hardware with SPIRAM configuration #2837

Merged
merged 3 commits into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions targets/ESP32/_Network/NF_ESP32_Wireless.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,17 @@ esp_err_t NF_ESP32_InitaliseWifi()
// Initialise WiFi, allocate resource for WiFi driver, such as WiFi control structure,
// RX/TX buffer, WiFi NVS structure etc, this WiFi also start WiFi task.
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();

#if CONFIG_SPIRAM_IGNORE_NOTFOUND
// The comment out function below is only avaliable in ESP IDF 5.1x
// if (!esp_psram_is_initialized()){
if (heap_caps_get_total_size(MALLOC_CAP_SPIRAM) == 0)
{
cfg.cache_tx_buf_num = 0;
cfg.feature_caps &= ~CONFIG_FEATURE_CACHE_TX_BUF_BIT;
}
#endif

ec = esp_wifi_init(&cfg);

if (ec != ESP_OK)
Expand Down