Merge branch 'backport/backport_some_wifi_changes_260630_v5.2' into 'release/v5.2'

backport/backport_some_wifi_changes_260630_v5.2(backport v5.2)

See merge request espressif/esp-idf!50230
This commit is contained in:
Jiang Jiang Jian
2026-07-06 15:02:37 +08:00
11 changed files with 64 additions and 25 deletions

View File

@@ -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;

View File

@@ -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
@@ -126,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()

View File

@@ -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/<chip>/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

View File

@@ -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;
@@ -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;

View File

@@ -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;
@@ -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;

View File

@@ -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;

View File

@@ -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;
@@ -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;

View File

@@ -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

View File

@@ -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 {

View File

@@ -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