From b1d97622059ffe421185c4d197d9f04f31968a92 Mon Sep 17 00:00:00 2001 From: Jan Beran Date: Mon, 15 Jan 2024 12:36:11 +0100 Subject: [PATCH 1/3] feat: Propagate arguments when running ninja monitor --- components/esptool_py/project_include.cmake | 24 ++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/components/esptool_py/project_include.cmake b/components/esptool_py/project_include.cmake index 36fe832efb..78041897f0 100644 --- a/components/esptool_py/project_include.cmake +++ b/components/esptool_py/project_include.cmake @@ -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 "$>") + 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};$>" + -D "SERIAL_TOOL_ARGS=${MONITOR_ARGS}" -D "WORKING_DIRECTORY=${build_dir}" -P run_serial_tool.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} From 858e3fe5ec4ed1de80aec7cae12b6dba5c62ffa5 Mon Sep 17 00:00:00 2001 From: Jan Beran Date: Fri, 19 Jan 2024 10:58:12 +0100 Subject: [PATCH 2/3] docs(esp-idf-monitor): Add information about ESP_IDF_MONITOR_NO_RESET --- docs/en/api-guides/tools/idf-monitor.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/api-guides/tools/idf-monitor.rst b/docs/en/api-guides/tools/idf-monitor.rst index 6971834446..5c4408209d 100644 --- a/docs/en/api-guides/tools/idf-monitor.rst +++ b/docs/en/api-guides/tools/idf-monitor.rst @@ -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:: From bd811d66828f699910a7d276ab7e7a8b70da73b8 Mon Sep 17 00:00:00 2001 From: daiziyan Date: Mon, 22 Jan 2024 14:35:43 +0800 Subject: [PATCH 3/3] docs: add CN translation for idf-monitor --- docs/zh_CN/api-guides/tools/idf-monitor.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh_CN/api-guides/tools/idf-monitor.rst b/docs/zh_CN/api-guides/tools/idf-monitor.rst index 2087569faf..7e38c5a187 100644 --- a/docs/zh_CN/api-guides/tools/idf-monitor.rst +++ b/docs/zh_CN/api-guides/tools/idf-monitor.rst @@ -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::