From 94e0569c2b5587f350cb048984a7952122eb38ee Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Thu, 28 Mar 2019 14:08:32 +0800 Subject: [PATCH] make, cmake: pass config esptool args for otatool invocation Closes https://github.com/espressif/esp-idf/issues/3135 --- components/app_update/CMakeLists.txt | 6 ++++-- components/app_update/Makefile.projbuild | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/components/app_update/CMakeLists.txt b/components/app_update/CMakeLists.txt index a683b1c39..8d0e45dbb 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 518e04dfa..4081aab97 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