Skip to content

Commit

Permalink
Fix Wifi connection failed on noPSRAM hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
alberk8 committed Dec 3, 2023
1 parent 2365bf4 commit 03ccaa0
Showing 1 changed file with 11 additions and 0 deletions.
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

0 comments on commit 03ccaa0

Please sign in to comment.