feat(phy): support change multiple phy init bin path

This commit is contained in:
yinqingzhao
2026-07-01 17:30:44 +08:00
parent e2fcc9d55b
commit 302e636a13
2 changed files with 30 additions and 3 deletions
+18 -3
View File
@@ -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)
+12
View File
@@ -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/<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