diff --git a/components/esptool_py/project_include.cmake b/components/esptool_py/project_include.cmake index 38e74a72ba..58b54af5b3 100644 --- a/components/esptool_py/project_include.cmake +++ b/components/esptool_py/project_include.cmake @@ -49,15 +49,10 @@ endif() if(min_rev) list(APPEND esptool_elf2image_args --min-rev ${min_rev}) + set(monitor_rev_args --revision ${min_rev}) unset(min_rev) endif() -if(CONFIG_ESP32_REV_MIN) - set(rev_min ${CONFIG_ESP32_REV_MIN}) -else() - set(rev_min -1) -endif() - if(CONFIG_ESPTOOLPY_FLASHSIZE_DETECT) # Set ESPFLASHSIZE to 'detect' *after* elf2image options are generated, # as elf2image can't have 'detect' as an option... @@ -160,7 +155,7 @@ add_custom_target(monitor COMMAND ${CMAKE_COMMAND} -D IDF_PATH="${idf_path}" -D SERIAL_TOOL="${ESPMONITOR}" - -D SERIAL_TOOL_ARGS="--target ${target} --revision ${rev_min} ${elf_dir}/${elf}" + -D SERIAL_TOOL_ARGS="--target ${target} ${monitor_rev_args} ${elf_dir}/${elf}" -D WORKING_DIRECTORY="${build_dir}" -P run_serial_tool.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} diff --git a/tools/idf_py_actions/serial_ext.py b/tools/idf_py_actions/serial_ext.py index 1db68d3b38..d2c4c51689 100644 --- a/tools/idf_py_actions/serial_ext.py +++ b/tools/idf_py_actions/serial_ext.py @@ -100,7 +100,9 @@ def action_extensions(base_actions, project_path): target_arch_riscv = get_sdkconfig_value(project_desc['config_file'], 'CONFIG_IDF_TARGET_ARCH_RISCV') monitor_args += ['--target', project_desc['target']] - monitor_args += ['--revision', project_desc.get('rev', -1)] + revision = project_desc.get('rev') + if revision: + monitor_args += ['--revision', revision] if target_arch_riscv: monitor_args += ['--decode-panic', 'backtrace']