Skip to content

Commit cb5ce4f

Browse files
authored
Fix Wifi failed to connect on non PSRAM hardware with SPIRAM configuration (#2837)
***NO_CI***
1 parent e0cb962 commit cb5ce4f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

targets/ESP32/_Network/NF_ESP32_Wireless.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,17 @@ esp_err_t NF_ESP32_InitaliseWifi()
157157
// Initialise WiFi, allocate resource for WiFi driver, such as WiFi control structure,
158158
// RX/TX buffer, WiFi NVS structure etc, this WiFi also start WiFi task.
159159
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
160+
161+
#if CONFIG_SPIRAM_IGNORE_NOTFOUND
162+
// The comment out function below is only avaliable in ESP IDF 5.1x
163+
// if (!esp_psram_is_initialized()){
164+
if (heap_caps_get_total_size(MALLOC_CAP_SPIRAM) == 0)
165+
{
166+
cfg.cache_tx_buf_num = 0;
167+
cfg.feature_caps &= ~CONFIG_FEATURE_CACHE_TX_BUF_BIT;
168+
}
169+
#endif
170+
160171
ec = esp_wifi_init(&cfg);
161172

162173
if (ec != ESP_OK)

0 commit comments

Comments
 (0)