diff --git a/targets/ESP32/_Network/NF_ESP32_Wireless.cpp b/targets/ESP32/_Network/NF_ESP32_Wireless.cpp index 5638f4ff88..4a419831a7 100644 --- a/targets/ESP32/_Network/NF_ESP32_Wireless.cpp +++ b/targets/ESP32/_Network/NF_ESP32_Wireless.cpp @@ -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)