forked from espressif/esp-idf
app_update: support port and baud env variables for otatool targets
Closes https://github.com/espressif/esp-idf/issues/5280
This commit is contained in:
@@ -48,19 +48,31 @@ if(NOT BOOTLOADER_BUILD)
|
|||||||
|
|
||||||
set(otatool_py ${python} ${COMPONENT_DIR}/otatool.py)
|
set(otatool_py ${python} ${COMPONENT_DIR}/otatool.py)
|
||||||
|
|
||||||
set(esptool_args --esptool-args before=${CONFIG_ESPTOOLPY_BEFORE} after=${CONFIG_ESPTOOLPY_AFTER})
|
set(esptool_args "--esptool-args;before=${CONFIG_ESPTOOLPY_BEFORE};after=${CONFIG_ESPTOOLPY_AFTER}")
|
||||||
|
set(otatool_args "--partition-table-file;${PARTITION_CSV_PATH};--partition-table-offset;${PARTITION_TABLE_OFFSET}")
|
||||||
|
idf_component_get_property(esptool_py_dir esptool_py COMPONENT_DIR)
|
||||||
|
|
||||||
add_custom_target(read_otadata DEPENDS "${PARTITION_CSV_PATH}"
|
add_custom_target(read_otadata DEPENDS "${PARTITION_CSV_PATH}"
|
||||||
COMMAND ${otatool_py} ${esptool_args}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
--partition-table-file ${PARTITION_CSV_PATH}
|
-D IDF_PATH="${idf_path}"
|
||||||
--partition-table-offset ${PARTITION_TABLE_OFFSET}
|
-D SERIAL_TOOL="${otatool_py}"
|
||||||
read_otadata)
|
-D SERIAL_TOOL_ARGS="${esptool_args};${otatool_args};read_otadata"
|
||||||
|
-D WORKING_DIRECTORY="${build_dir}"
|
||||||
|
-P ${esptool_py_dir}/run_serial_tool.cmake
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||||
|
USES_TERMINAL
|
||||||
|
)
|
||||||
|
|
||||||
add_custom_target(erase_otadata DEPENDS "${PARTITION_CSV_PATH}"
|
add_custom_target(erase_otadata DEPENDS "${PARTITION_CSV_PATH}"
|
||||||
COMMAND ${otatool_py} ${esptool_args}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
--partition-table-file ${PARTITION_CSV_PATH}
|
-D IDF_PATH="${idf_path}"
|
||||||
--partition-table-offset ${PARTITION_TABLE_OFFSET}
|
-D SERIAL_TOOL="${otatool_py}"
|
||||||
erase_otadata)
|
-D SERIAL_TOOL_ARGS="${esptool_args};${otatool_args};erase_otadata"
|
||||||
|
-D WORKING_DIRECTORY="${build_dir}"
|
||||||
|
-P ${esptool_py_dir}/run_serial_tool.cmake
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
|
||||||
|
USES_TERMINAL
|
||||||
|
)
|
||||||
|
|
||||||
idf_component_get_property(main_args esptool_py FLASH_ARGS)
|
idf_component_get_property(main_args esptool_py FLASH_ARGS)
|
||||||
idf_component_get_property(sub_args esptool_py FLASH_SUB_ARGS)
|
idf_component_get_property(sub_args esptool_py FLASH_SUB_ARGS)
|
||||||
|
Reference in New Issue
Block a user