diff --git a/boards/xtensa/esp32s3/esp32s3-xiao/src/esp32s3_bringup.c b/boards/xtensa/esp32s3/esp32s3-xiao/src/esp32s3_bringup.c index 5aac91128a8bc..f2818899e606d 100644 --- a/boards/xtensa/esp32s3/esp32s3-xiao/src/esp32s3_bringup.c +++ b/boards/xtensa/esp32s3/esp32s3-xiao/src/esp32s3_bringup.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include "espressif/esp_gpio.h" @@ -47,6 +48,10 @@ # include "espressif/esp_hr_timer.h" #endif +#ifdef CONFIG_ESPRESSIF_WIFI +# include "esp32s3_board_wlan.h" +#endif + #ifdef CONFIG_ESP32S3_I2C # include "esp32s3_i2c.h" #endif @@ -157,6 +162,25 @@ int esp32s3_bringup(void) } #endif +#ifdef CONFIG_ESPRESSIF_WIFI +# ifdef CONFIG_PM + /* Wi-Fi radio calibration can't tolerate PM_STANDBY light sleep. */ + + pm_stay(PM_IDLE_DOMAIN, PM_IDLE); +# endif + + ret = board_wlan_init(); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to initialize wlan subsystem=%d\n", + ret); + } + +# ifdef CONFIG_PM + pm_relax(PM_IDLE_DOMAIN, PM_IDLE); +# endif +#endif + /* If we got here then perhaps not all initialization was successful, but * at least enough succeeded to bring-up NSH with perhaps reduced * capabilities.