Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ce65afe

Browse files
committed
fix(esp8266): Fix cmake not compile and download phy_init_data.bin
1 parent 48be630 commit ce65afe

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

components/esp8266/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,26 @@ else()
110110
add_custom_target(esp8266_linker_script DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/esp8266_out.ld")
111111
add_dependencies(${COMPONENT_LIB} esp8266_linker_script)
112112

113-
if(CONFIG_ESP8266_PHY_INIT_DATA_IN_PARTITION)
114-
set(PHY_INIT_DATA_BIN phy_init_data.bin)
113+
if(CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION)
114+
set(PHY_INIT_DATA_BIN ${build_dir}/phy_init_data.bin)
115115

116116
# To get the phy_init_data.bin file, compile phy_init_data.h as a C file and then objcopy
117117
# the object file to a raw binary
118118
add_custom_command(
119119
OUTPUT ${PHY_INIT_DATA_BIN}
120-
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/phy_init_data.h
120+
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/include/esp_private/phy_init_data.h
121121
COMMAND ${CMAKE_C_COMPILER} -x c -c
122122
-I ${CMAKE_CURRENT_LIST_DIR} -I ${CMAKE_CURRENT_LIST_DIR}/include -I ${CMAKE_BINARY_DIR}
123+
-I ${CONFIG_DIR} -I ${CMAKE_CURRENT_LIST_DIR}/../esp_common/include
123124
-o phy_init_data.obj
124-
${CMAKE_CURRENT_LIST_DIR}/phy_init_data.h
125+
${CMAKE_CURRENT_LIST_DIR}/include/esp_private/phy_init_data.h
125126
COMMAND ${CMAKE_OBJCOPY} -O binary phy_init_data.obj ${PHY_INIT_DATA_BIN}
126127
)
127128
add_custom_target(phy_init_data ALL DEPENDS ${PHY_INIT_DATA_BIN})
128129
add_dependencies(flash phy_init_data)
129130

131+
partition_table_get_partition_info(phy_init_data_offset "--partition-type data --partition-subtype phy" "offset")
132+
esptool_py_flash_project_args(phy_init_data ${phy_init_data_offset} "${PHY_INIT_DATA_BIN}" FLASH_IN_PROJECT)
130133
endif()
131134

132135
if(CONFIG_ESP_FILENAME_MACRO_NO_PATH)

0 commit comments

Comments
 (0)