Merge branch 'feature/add_arguments_ninja_monitor' into 'master'

feat: Propagate arguments when running ninja monitor

Closes IDF-8856

See merge request espressif/esp-idf!28477
This commit is contained in:
Roland Dobai 2024-01-31 20:09:59 +08:00
commit 2e207db65f
3 changed files with 23 additions and 5 deletions

View File

@ -5,6 +5,7 @@ idf_build_get_property(target IDF_TARGET)
idf_build_get_property(python PYTHON)
idf_build_get_property(idf_path IDF_PATH)
set(chip_model ${target})
# TODO: [ESP32C5] remove this 'if' block when esp32C5 beta3 is no longer supported
@ -108,8 +109,6 @@ endif()
list(APPEND esptool_elf2image_args --min-rev-full ${CONFIG_ESP_REV_MIN_FULL})
list(APPEND esptool_elf2image_args --max-rev-full ${CONFIG_ESP_REV_MAX_FULL})
set(monitor_rev_args "--revision;${CONFIG_ESP_REV_MIN_FULL}")
if(CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE)
# Set ESPFLASHSIZE to 'detect' *after* esptool_elf2image_args are generated,
# as elf2image can't have 'detect' as an option...
@ -239,11 +238,30 @@ add_custom_target(uf2-app
VERBATIM
)
set(MONITOR_ARGS "")
list(APPEND MONITOR_ARGS "--toolchain-prefix;${_CMAKE_TOOLCHAIN_PREFIX};")
if(CONFIG_ESP_COREDUMP_DECODE)
list(APPEND MONITOR_ARGS "--decode-coredumps;${CONFIG_ESP_COREDUMP_DECODE};")
endif()
list(APPEND MONITOR_ARGS "--target;${target};")
list(APPEND MONITOR_ARGS "--revision;${CONFIG_ESP_REV_MIN_FULL};")
if(CONFIG_IDF_TARGET_ARCH_RISCV)
list(APPEND MONITOR_ARGS "--decode-panic;backtrace;")
endif()
list(APPEND MONITOR_ARGS "$<TARGET_FILE:$<GENEX_EVAL:${elf}>>")
add_custom_target(monitor
COMMAND ${CMAKE_COMMAND}
-D "IDF_PATH=${idf_path}"
-D "SERIAL_TOOL=${ESPMONITOR}"
-D "SERIAL_TOOL_ARGS=--target;${target};${monitor_rev_args};$<TARGET_FILE:$<GENEX_EVAL:${elf}>>"
-D "SERIAL_TOOL_ARGS=${MONITOR_ARGS}"
-D "WORKING_DIRECTORY=${build_dir}"
-P run_serial_tool.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}

View File

@ -228,7 +228,7 @@ The ROM ELF file is automatically loaded from a location based on the ``IDF_PATH
Target Reset on Connection
~~~~~~~~~~~~~~~~~~~~~~~~~~
By default, IDF Monitor will reset the target when connecting to it. The reset of the target chip is performed using the DTR and RTS serial lines. To prevent IDF Monitor from automatically resetting the target on connection, call IDF Monitor with the ``--no-reset`` option (e.g., ``idf.py monitor --no-reset``).
By default, IDF Monitor will reset the target when connecting to it. The reset of the target chip is performed using the DTR and RTS serial lines. To prevent IDF Monitor from automatically resetting the target on connection, call IDF Monitor with the ``--no-reset`` option (e.g., ``idf.py monitor --no-reset``). You can also set the environment variable ``ESP_IDF_MONITOR_NO_RESET`` to ``1`` to achieve the same behavior.
.. note::

View File

@ -228,7 +228,7 @@ ROM ELF 文件会根据 ``IDF_PATH`` 和 ``ESP_ROM_ELF_DIR`` 环境变量的路
连接时复位目标芯片
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
默认情况下IDF 监视器会在目标芯片连接时通过 DTR 和 RTS 串行线自动复位芯片。要防止 IDF 监视器在连接时自动复位,请在调用 IDF 监视器时加上选项 ``--no-reset``,如 ``idf.py monitor --no-reset``
默认情况下IDF 监视器会在目标芯片连接时通过 DTR 和 RTS 串行线自动复位芯片。要防止 IDF 监视器在连接时自动复位,请在调用 IDF 监视器时加上选项 ``--no-reset``,如 ``idf.py monitor --no-reset``,或者将环境变量 ``ESP_IDF_MONITOR_NO_RESET`` 设置成 1。
.. note::