From 302e636a13ecd2ee37ca2eb8c76bc36a93b809ea Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Wed, 29 Apr 2026 13:55:28 +0800 Subject: [PATCH 1/6] feat(phy): support change multiple phy init bin path --- components/esp_phy/CMakeLists.txt | 21 ++++++++++++++++++--- components/esp_phy/Kconfig | 12 ++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index 3890353a9d9..74f8fad7e68 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -41,10 +41,25 @@ if(CONFIG_ESP_PHY_ENABLED) 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}") + 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() if(CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED) diff --git a/components/esp_phy/Kconfig b/components/esp_phy/Kconfig index fcb9bca0db9..e51102d1da3 100644 --- a/components/esp_phy/Kconfig +++ b/components/esp_phy/Kconfig @@ -63,6 +63,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 d51b8c26f40ad0a11eb7925242baea7f0a41bbc6 Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Mon, 25 May 2026 11:55:54 +0800 Subject: [PATCH 2/6] 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 74f8fad7e68..e0c6a225be1 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -152,9 +152,17 @@ if(CONFIG_ESP_PHY_ENABLED) 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() endif() From ddec495cf76b3fe751350d6ccb4bbc90b803f463 Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Tue, 2 Jun 2026 14:23:35 +0800 Subject: [PATCH 3/6] 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/esp32c5/ld/esp32c5.rom.pp.ld | 2 +- components/esp_rom/esp32c6/ld/esp32c6.rom.pp.ld | 2 +- components/esp_rom/esp32c61/ld/esp32c61.rom.pp.ld | 2 +- components/esp_rom/esp32s3/ld/esp32s3.rom.ld | 2 +- examples/wifi/iperf/sdkconfig.defaults | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld index e127911d826..82b964b84c1 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld @@ -579,7 +579,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 e20ad0258c1..fa29d87ee2c 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/esp32c5/ld/esp32c5.rom.pp.ld b/components/esp_rom/esp32c5/ld/esp32c5.rom.pp.ld index 8cb1d2f1723..847303927d7 100644 --- a/components/esp_rom/esp32c5/ld/esp32c5.rom.pp.ld +++ b/components/esp_rom/esp32c5/ld/esp32c5.rom.pp.ld @@ -199,7 +199,7 @@ ppTxProtoProc = 0x40000eac; ppTxqUpdateBitmap = 0x40000eb0; pp_coex_tx_request = 0x40000eb4; pp_hdrsize = 0x40000eb8; -pp_post = 0x40000ebc; +//pp_post = 0x40000ebc; pp_process_hmac_waiting_txq = 0x40000ec0; ppDequeueTxDone_Locked = 0x40000ec4; ppProcTxDone = 0x40000ec8; diff --git a/components/esp_rom/esp32c6/ld/esp32c6.rom.pp.ld b/components/esp_rom/esp32c6/ld/esp32c6.rom.pp.ld index 9f640686ebf..7ec582d5dfb 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/esp32c61/ld/esp32c61.rom.pp.ld b/components/esp_rom/esp32c61/ld/esp32c61.rom.pp.ld index 950e4f6059b..315f3ef6a6c 100644 --- a/components/esp_rom/esp32c61/ld/esp32c61.rom.pp.ld +++ b/components/esp_rom/esp32c61/ld/esp32c61.rom.pp.ld @@ -206,7 +206,7 @@ ppTxProtoProc = 0x40000e24; ppTxqUpdateBitmap = 0x40000e28; pp_coex_tx_request = 0x40000e2c; pp_hdrsize = 0x40000e30; -pp_post = 0x40000e34; +//pp_post = 0x40000e34; pp_process_hmac_waiting_txq = 0x40000e38; ppDequeueTxDone_Locked = 0x40000e3c; ppProcTxDone = 0x40000e40; diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld index 1c3de3d1541..0497b01106c 100644 --- a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld @@ -1021,7 +1021,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 3a5ddbc07ba946b4b732d7aaa110bc55bc55e3a3 Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Wed, 10 Jun 2026 20:17:23 +0800 Subject: [PATCH 4/6] fix(itwt): fix flow id 0 cannot suspend in itwt example --- examples/wifi/itwt/main/wifi_itwt_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/wifi/itwt/main/wifi_itwt_cmd.c b/examples/wifi/itwt/main/wifi_itwt_cmd.c index 157a88ef067..3975d79c40c 100644 --- a/examples/wifi/itwt/main/wifi_itwt_cmd.c +++ b/examples/wifi/itwt/main/wifi_itwt_cmd.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 e0f5dd572c16fdf32493600f058165a9d75b6f7d Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Wed, 1 Jul 2026 11:12:07 +0800 Subject: [PATCH 5/6] fix(wifi): optimizations of csa procedure and keep alive mechanism --- components/esp_wifi/include/esp_wifi.h | 6 ++++-- components/esp_wifi/lib | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index 924fa3e5f35..ea3e34a1a16 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -771,10 +771,12 @@ 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 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. * * @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 2c841729458..652f202baa8 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 2c841729458abc5527d38af5c9255e17b7483a1e +Subproject commit 652f202baa8006686a17f83b34e0bbc367251c30 From bbfb2840f5d99f487b1114001bedd05b24d1bbd0 Mon Sep 17 00:00:00 2001 From: yinqingzhao Date: Mon, 29 Jun 2026 09:56:54 +0800 Subject: [PATCH 6/6] 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 82b964b84c1..c131be96d25 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld @@ -525,7 +525,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 fa29d87ee2c..a6d61eab5c9 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 0497b01106c..0b22e363d3d 100644 --- a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld @@ -968,7 +968,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;