diff --git a/components/app_update/CMakeLists.txt b/components/app_update/CMakeLists.txt index a683b1c394..8d0e45dbb0 100644 --- a/components/app_update/CMakeLists.txt +++ b/components/app_update/CMakeLists.txt @@ -38,14 +38,16 @@ if(NOT BOOTLOADER_BUILD) set(otatool_py ${python} ${COMPONENT_DIR}/otatool.py) + set(esptool_args --esptool-args before=${CONFIG_ESPTOOLPY_BEFORE} after=${CONFIG_ESPTOOLPY_AFTER}) + add_custom_target(read_otadata DEPENDS "${PARTITION_CSV_PATH}" - COMMAND ${otatool_py} + COMMAND ${otatool_py} ${esptool_args} --partition-table-file ${PARTITION_CSV_PATH} --partition-table-offset ${PARTITION_TABLE_OFFSET} read_otadata) add_custom_target(erase_otadata DEPENDS "${PARTITION_CSV_PATH}" - COMMAND ${otatool_py} + COMMAND ${otatool_py} ${esptool_args} --partition-table-file ${PARTITION_CSV_PATH} --partition-table-offset ${PARTITION_TABLE_OFFSET} erase_otadata) diff --git a/components/app_update/Makefile.projbuild b/components/app_update/Makefile.projbuild index 518e04dfa4..4081aab976 100644 --- a/components/app_update/Makefile.projbuild +++ b/components/app_update/Makefile.projbuild @@ -28,13 +28,15 @@ blank_ota_data: $(BLANK_OTA_DATA_FILE) # expand to empty values. ESPTOOL_ALL_FLASH_ARGS += $(OTA_DATA_OFFSET) $(BLANK_OTA_DATA_FILE) +ESPTOOL_ARGS := --esptool-args port=$(CONFIG_ESPTOOLPY_PORT) baud=$(CONFIG_ESPTOOLPY_BAUD) before=$(CONFIG_ESPTOOLPY_BEFORE) after=$(CONFIG_ESPTOOLPY_AFTER) + erase_otadata: $(PARTITION_TABLE_CSV_PATH) partition_table_get_info | check_python_dependencies - $(OTATOOL_PY) --partition-table-file $(PARTITION_TABLE_CSV_PATH) \ + $(OTATOOL_PY) $(ESPTOOL_ARGS) --partition-table-file $(PARTITION_TABLE_CSV_PATH) \ --partition-table-offset $(PARTITION_TABLE_OFFSET) \ erase_otadata read_otadata: $(PARTITION_TABLE_CSV_PATH) partition_table_get_info | check_python_dependencies - $(OTATOOL_PY) --partition-table-file $(PARTITION_TABLE_CSV_PATH) \ + $(OTATOOL_PY) $(ESPTOOL_ARGS) --partition-table-file $(PARTITION_TABLE_CSV_PATH) \ --partition-table-offset $(partition_table_offset) \ read_otadata