From 175831b0f7d5365d6ef3c5ab8c06487e00674368 Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Wed, 29 Apr 2026 13:55:28 +0800 Subject: [PATCH 1/7] feat(phy): support change multiple phy init bin path --- components/esp_phy/CMakeLists.txt | 30 +++++++++++++++++++++++------- components/esp_phy/Kconfig | 12 ++++++++++++ 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index 1910e00aab7..ed1328f9af7 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -36,15 +36,31 @@ endif() idf_build_get_property(build_dir BUILD_DIR) if(CONFIG_SOC_WIFI_SUPPORTED) -if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN) - if(NOT EXISTS "${build_dir}/phy_multiple_init_data.bin") - file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${idf_target}/phy_multiple_init_data.bin DESTINATION "${build_dir}") + if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN) + set(_phy_multi_src "${CMAKE_CURRENT_SOURCE_DIR}/${idf_target}/phy_multiple_init_data.bin") + if(NOT "${CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_CUSTOM_PATH}" STREQUAL "") + idf_build_get_property(project_dir PROJECT_DIR) + set(_phy_multi_custom_path "${CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_CUSTOM_PATH}") + if(NOT IS_ABSOLUTE "${_phy_multi_custom_path}") + get_filename_component(_phy_multi_custom_path + "${project_dir}/${_phy_multi_custom_path}" ABSOLUTE) + endif() + if(IS_DIRECTORY "${_phy_multi_custom_path}") + set(_phy_multi_custom_path "${_phy_multi_custom_path}/phy_multiple_init_data.bin") + endif() + if(EXISTS "${_phy_multi_custom_path}") + set(_phy_multi_src "${_phy_multi_custom_path}") + endif() + endif() + # Refresh copied bin each configure so sdkconfig/path edits match embed + flash contents. + # configure_file(COPYONLY) tracks the source file as a configure dependency. + message(STATUS "esp_phy: phy_multiple_init_data.bin <- ${_phy_multi_src}") + configure_file("${_phy_multi_src}" "${build_dir}/phy_multiple_init_data.bin" COPYONLY) endif() -endif() -if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED) - set(embed_files "${build_dir}/phy_multiple_init_data.bin") -endif() + if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED) + set(embed_files "${build_dir}/phy_multiple_init_data.bin") + endif() endif() # [refactor-todo]: requires "driver" component for periph_ctrl header file diff --git a/components/esp_phy/Kconfig b/components/esp_phy/Kconfig index fd4b0ef23cf..29735914bf2 100644 --- a/components/esp_phy/Kconfig +++ b/components/esp_phy/Kconfig @@ -58,6 +58,18 @@ menu "PHY" 3. Country configured by API esp_wifi_set_country() and the parameter policy is WIFI_COUNTRY_POLICY_AUTO. + config ESP_PHY_MULTIPLE_INIT_DATA_BIN_CUSTOM_PATH + string "Custom path to phy_multiple_init_data.bin" + depends on ESP_PHY_MULTIPLE_INIT_DATA_BIN + default "" + help + Absolute path, or path relative to the project directory, to the file + phy_multiple_init_data.bin, or to a directory containing that file. + + If this field is left empty, or the file cannot be found at the resolved path, + the default binary located at components/esp_phy//phy_multiple_init_data.bin + will be used. + config ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED bool "Support embedded multiple phy init data bin to app bin" depends on ESP_PHY_MULTIPLE_INIT_DATA_BIN From 29c31b14de8de051519a86bb3a1fff0327566160 Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Mon, 25 May 2026 11:55:54 +0800 Subject: [PATCH 2/7] fix(phy): fix still put multiple phy init date bin into flash when CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED is enabled --- components/esp_phy/CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index ed1328f9af7..0488f449b94 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -142,7 +142,15 @@ if(CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION) set(phy_name "phy") - esptool_py_flash_target(${phy_name}-flash "${main_args}" "${sub_args}") - esptool_py_flash_target_image(${phy_name}-flash ${phy_name} "${phy_partition_offset}" "${phy_init_data_bin}") - esptool_py_flash_target_image(flash ${phy_name} "${phy_partition_offset}" "${phy_init_data_bin}") + # When the multiple PHY init data bin is embedded into the application image + # (CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED=y), the data is already part of + # app.bin and there is no need to flash it again to the `phy` data partition. + # Skip registering it as a flashable image in that case. + if(NOT CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED) + esptool_py_flash_target(${phy_name}-flash "${main_args}" "${sub_args}") + esptool_py_flash_target_image(${phy_name}-flash ${phy_name} + "${phy_partition_offset}" "${phy_init_data_bin}") + esptool_py_flash_target_image(flash ${phy_name} + "${phy_partition_offset}" "${phy_init_data_bin}") + endif() endif() From 8df18fdc9cf03940179da762b1dfa25dccc2f78e Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Tue, 16 Jun 2026 11:14:41 +0800 Subject: [PATCH 3/7] fix(wifi): fix cache access error in wifi interrupt with psram enabled --- components/esp_coex/esp32/esp_coex_adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_coex/esp32/esp_coex_adapter.c b/components/esp_coex/esp32/esp_coex_adapter.c index fbd93f6a6ad..65c1fa40021 100644 --- a/components/esp_coex/esp32/esp_coex_adapter.c +++ b/components/esp_coex/esp32/esp_coex_adapter.c @@ -46,7 +46,7 @@ void * esp_coex_common_spin_lock_create_wrapper(void) void *mux = heap_caps_malloc(sizeof(portMUX_TYPE), MALLOC_CAP_8BIT|MALLOC_CAP_INTERNAL); if (mux) { - memcpy(mux,&tmp,sizeof(portMUX_TYPE)); + memcpy(mux, &tmp, sizeof(portMUX_TYPE)); return mux; } return NULL; From 0e020e29559af0730b1eacf7e0ece7be673f0f01 Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Tue, 30 Jun 2026 19:51:52 +0800 Subject: [PATCH 4/7] fix(wifi): fix scheduling issue when tasks have the same priority as the Wi-Fi task --- components/esp_rom/esp32c2/ld/esp32c2.rom.ld | 2 +- components/esp_rom/esp32c3/ld/esp32c3.rom.ld | 2 +- components/esp_rom/esp32c6/ld/esp32c6.rom.pp.ld | 2 +- components/esp_rom/esp32s3/ld/esp32s3.rom.ld | 2 +- examples/wifi/iperf/sdkconfig.defaults | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld index a92e79934cc..a13c797baa2 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld @@ -654,7 +654,7 @@ ppTxProtoProc = 0x40001c4c; ppTxqUpdateBitmap = 0x40001c50; /*pp_coex_tx_request = 0x40001c54;*/ pp_hdrsize = 0x40001c58; -pp_post = 0x40001c5c; +//pp_post = 0x40001c5c; pp_process_hmac_waiting_txq = 0x40001c60; rcGetAmpduSched = 0x40001c64; rcUpdateRxDone = 0x40001c68; diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.ld index 6f53af88ae5..96da20855eb 100644 --- a/components/esp_rom/esp32c3/ld/esp32c3.rom.ld +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.ld @@ -766,7 +766,7 @@ ppTxProtoProc = 0x40001728; ppTxqUpdateBitmap = 0x4000172c; /*pp_coex_tx_request = 0x40001730;*/ pp_hdrsize = 0x40001734; -pp_post = 0x40001738; +//pp_post = 0x40001738; pp_process_hmac_waiting_txq = 0x4000173c; rcGetAmpduSched = 0x40001740; rcUpdateRxDone = 0x40001744; diff --git a/components/esp_rom/esp32c6/ld/esp32c6.rom.pp.ld b/components/esp_rom/esp32c6/ld/esp32c6.rom.pp.ld index 54ca75884fd..c4451d50edb 100644 --- a/components/esp_rom/esp32c6/ld/esp32c6.rom.pp.ld +++ b/components/esp_rom/esp32c6/ld/esp32c6.rom.pp.ld @@ -113,7 +113,7 @@ ppTxProtoProc = 0x40000d44; ppTxqUpdateBitmap = 0x40000d48; /*pp_coex_tx_request = 0x40000d4c;*/ pp_hdrsize = 0x40000d50; -pp_post = 0x40000d54; +//pp_post = 0x40000d54; pp_process_hmac_waiting_txq = 0x40000d58; rcGetAmpduSched = 0x40000d5c; rcUpdateRxDone = 0x40000d60; diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld index 6f6afebe7f7..562801a2ec4 100644 --- a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld @@ -1044,7 +1044,7 @@ ppTxProtoProc = 0x400056b8; ppTxqUpdateBitmap = 0x400056c4; /*pp_coex_tx_request = 0x400056d0;*/ pp_hdrsize = 0x400056dc; -pp_post = 0x400056e8; +//pp_post = 0x400056e8; pp_process_hmac_waiting_txq = 0x400056f4; rcGetAmpduSched = 0x40005700; rcUpdateRxDone = 0x4000570c; diff --git a/examples/wifi/iperf/sdkconfig.defaults b/examples/wifi/iperf/sdkconfig.defaults index 7e44f9266f1..e50287fece7 100644 --- a/examples/wifi/iperf/sdkconfig.defaults +++ b/examples/wifi/iperf/sdkconfig.defaults @@ -10,7 +10,7 @@ CONFIG_LWIP_ETHARP_TRUST_IP_MAC=n CONFIG_LWIP_IRAM_OPTIMIZATION=y CONFIG_LWIP_TCPIP_TASK_PRIO=23 -CONFIG_IPERF_TRAFFIC_TASK_PRIORITY=23 +CONFIG_IPERF_TRAFFIC_TASK_PRIORITY=22 CONFIG_IPERF_REPORT_TASK_PRIORITY=24 CONFIG_COMPILER_OPTIMIZATION_PERF=y From 59abe7518e730ce4f4e2bbb3cd54632567bd2b6a Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Wed, 10 Jun 2026 20:17:23 +0800 Subject: [PATCH 5/7] fix(itwt): fix flow id 0 cannot suspend in itwt example --- examples/common_components/iperf/wifi_twt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/common_components/iperf/wifi_twt.c b/examples/common_components/iperf/wifi_twt.c index 5b2f677ddb5..64d3ff0d8f4 100644 --- a/examples/common_components/iperf/wifi_twt.c +++ b/examples/common_components/iperf/wifi_twt.c @@ -144,7 +144,7 @@ static int wifi_cmd_itwt(int argc, char **argv) bool all_twt = itwt_args.all_twt->count ? (itwt_args.all_twt->ival[0] ? true : false) : false; flow_id = (all_twt == true) ? FLOW_ID_ALL : flow_id; int suspend_time_ms = itwt_args.suspend_time_ms->count ? itwt_args.suspend_time_ms->ival[0] : 0; - if (flow_id > 0) { + if (flow_id >= 0) { err = esp_wifi_sta_itwt_suspend(flow_id, suspend_time_ms); ESP_LOGI(TAG, "(itwt)suspend, flow_id:%d, all_twt:%d, suspend:%d ms, err:0x%x", flow_id, all_twt, suspend_time_ms, err); } else { From 650ea3b0a3401661ca12b4471f390a83d33680f7 Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Wed, 1 Jul 2026 11:12:07 +0800 Subject: [PATCH 6/7] fix(wifi): optimizations of csa procedure and keep alive mechanism --- components/esp_wifi/include/esp_wifi.h | 11 +++++++---- components/esp_wifi/lib | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index 96be860376e..ca2608854e8 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -695,10 +695,13 @@ esp_err_t esp_wifi_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw); * * @attention 1. This API should be called after esp_wifi_start() and before esp_wifi_stop() * @attention 2. When device is in STA mode, this API should not be called when STA is scanning or connecting to an external AP - * @attention 3. When device is in softAP mode, this API should not be called when softAP has connected to external STAs - * @attention 4. When device is in STA+softAP mode, this API should not be called when in the scenarios described above - * @attention 5. The channel info set by this API will not be stored in NVS. So If you want to remeber the channel used before wifi stop, - * you need to call this API again after wifi start, or you can call `esp_wifi_set_config()` to store the channel info in NVS. + * @attention 3. When device is in softAP mode and has connected to external STAs, it initiates the CSA process + * @attention 4. When device is in STA+softAP mode, this API should not be called when STA is scanning or connecting to an external AP + * or softAP has connected to external STAs. + * @attention 5. The channel info set by this API will not be stored in NVS. So If you want to remember the channel used before WiFi stop, + * you need to call this API again after WiFi start, or you can call `esp_wifi_set_config()` to store the channel info in NVS. + * @attention 6. When operating in 5 GHz band, the second channel is automatically determined by the primary channel according to the 802.11 standard. + * Any manually configured second channel will be ignored. * * @param primary for HT20, primary is the channel number, for HT40, primary is the primary channel * @param second for HT20, second is ignored, for HT40, second is the second channel diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 2b12cece794..785ed2ee1eb 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 2b12cece79403ae820c0cefde36e99a41f898b31 +Subproject commit 785ed2ee1ebde7a17ff67f25f7d2ad4b247a97e0 From 14d4262650fb2fcbd6e57024d0475c0d32821048 Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Mon, 29 Jun 2026 09:56:54 +0800 Subject: [PATCH 7/7] fix(wifi): comment out functions from ld files --- components/esp_rom/esp32c2/ld/esp32c2.rom.ld | 2 +- components/esp_rom/esp32c3/ld/esp32c3.rom.ld | 2 +- components/esp_rom/esp32s3/ld/esp32s3.rom.ld | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld index a13c797baa2..726e37c46de 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld @@ -600,7 +600,7 @@ pm_disable_sleep_delay_timer = 0x40001b74; /*pm_dream = 0x40001b78;*/ pm_mac_wakeup = 0x40001b7c; pm_mac_sleep = 0x40001b80; -pm_enable_active_timer = 0x40001b84; +//pm_enable_active_timer = 0x40001b84; pm_enable_sleep_delay_timer = 0x40001b88; pm_local_tsf_process = 0x40001b8c; //pm_set_beacon_filter = 0x40001b90; diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.ld index 96da20855eb..d0d60c041de 100644 --- a/components/esp_rom/esp32c3/ld/esp32c3.rom.ld +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.ld @@ -714,7 +714,7 @@ pm_disable_sleep_delay_timer = 0x40001650; /*pm_dream = 0x40001654;*/ pm_mac_wakeup = 0x40001658; pm_mac_sleep = 0x4000165c; -pm_enable_active_timer = 0x40001660; +//pm_enable_active_timer = 0x40001660; pm_enable_sleep_delay_timer = 0x40001664; pm_local_tsf_process = 0x40001668; //pm_set_beacon_filter = 0x4000166c; diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld index 562801a2ec4..75df63b572e 100644 --- a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld @@ -991,7 +991,7 @@ pm_disable_sleep_delay_timer = 0x40005430; /*pm_dream = 0x4000543c;*/ pm_mac_wakeup = 0x40005448; pm_mac_sleep = 0x40005454; -pm_enable_active_timer = 0x40005460; +//pm_enable_active_timer = 0x40005460; pm_enable_sleep_delay_timer = 0x4000546c; pm_local_tsf_process = 0x40005478; //pm_set_beacon_filter = 0x40005484;