docs: Update CN translation for jtag-debugging

This commit is contained in:
Zhang Shuxian
2026-05-06 12:06:35 +08:00
parent 4440f45c2b
commit cdea8fc8ce
3 changed files with 9 additions and 9 deletions

View File

@@ -129,7 +129,7 @@ What Is the Meaning of Debugger's Startup Commands?
On startup, debugger is issuing sequence of commands to reset the chip and halt it at specific line of code. This sequence (shown below) is user defined to pick up at most convenient/appropriate line and start debugging.
* ``set remote hardware-watchpoint-limit {IDF_TARGET_SOC_CPU_WATCHPOINTS_NUM}`` — Restrict GDB to using available hardware watchpoints supported by the chip, {IDF_TARGET_SOC_CPU_WATCHPOINTS_NUM} for {IDF_TARGET_NAME}. For more information see https://sourceware.org/gdb/onlinedocs/gdb/Remote-Configuration.html.
* ``mon reset halt`` — reset the chip and keep the CPUs halted. Target has to be reset to disable memory protection, which is required to enable FLASH support. If reset is not desirable, add an extra argument ``-c 'set ESP_FLASH_SIZE 0'`` to the start of the OpenOCD command line to disable FLASH support, see :ref:`jtag-debugging-tip-openocd-config-vars`. Alternatively, disable memory protection using the config option :ref:`CONFIG_ESP_SYSTEM_MEMPROT`.
* ``mon reset halt`` — reset the chip and keep the CPUs halted. Target has to be reset to disable memory protection, which is required to enable flash support. If reset is not desirable, add an extra argument ``-c 'set ESP_FLASH_SIZE 0'`` to the start of the OpenOCD command line to disable flash support, see :ref:`jtag-debugging-tip-openocd-config-vars`. Alternatively, disable memory protection using the config option :ref:`CONFIG_ESP_SYSTEM_MEMPROT`.
* ``maintenance flush register-cache`` — monitor (``mon``) command can not inform GDB that the target state has changed. GDB will assume that whatever stack the target had before ``mon reset halt`` will still be valid. In fact, after reset the target state will change, and executing ``maintenance flush register-cache`` is a way to force GDB to get new state from the target.
* ``thb app_main`` — insert a temporary hardware breakpoint at ``app_main``, put here another function name if required
* ``c`` — resume the program. It will then stop at breakpoint inserted at ``app_main``.
@@ -192,7 +192,7 @@ It is important to set the variable before including the ESP-specific configurat
* - ``ESP_RTOS``
- Set to ``none`` to disable RTOS support. In this case, thread list will not be available in GDB. Can be useful when debugging FreeRTOS itself, and stepping through the scheduler code.
* - ``ESP_FLASH_SIZE``
- Set to ``0`` to disable Flash breakpoints support. If set to ``0``, target will not be reset when GDB connects.
- Set to ``0`` to disable flash breakpoints support. If set to ``0``, target will not be reset when GDB connects.
* - ``ESP_SEMIHOST_BASEDIR``
- Set to the path (on the host) which will be the default directory for semihosting functions.
* - ``ESP_ONLYCPU``

View File

@@ -233,7 +233,7 @@ OpenOCD 安装完成后就可以配置 {IDF_TARGET_NAME} 目标(即带 JTAG
- ``no_clock_boost`` - 禁用在烧写前将目标时钟频率设置为其最大可能值(可选)。默认情况下禁用该选项,即默认启用时钟提升。
- ``restore_clock`` - 可选。烧写完成后将时钟频率恢复到初始值。默认情况下不启用。
- ``no_skip_loaded`` - 可选。烧写前不检查该二进制文件是否已被加载,默认情况下不启用。
- ``force`` - 可选。禁用镜像文件中检测到的芯片类型和版本范围目标兼容性检查。此检查默认启用。
- ``force`` - 可选。禁用镜像文件中检测到的芯片类型和版本范围进行目标兼容性检查。此检查默认启用。
替代方法:使用 ``program_esp_bins``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@@ -129,7 +129,7 @@ GDB 具有 FreeRTOS 支持的 Python 扩展模块。在系统要求满足的情
在启动时,调试器发出一系列命令来复位芯片并使其在特定的代码行停止运行。这个命令序列(如下所示)支持自定义,用户可以选择在最方便合适的代码行开始调试工作。
* ``set remote hardware-watchpoint-limit {IDF_TARGET_SOC_CPU_WATCHPOINTS_NUM}`` — 限制 GDB 使用芯片支持的硬件观察点数量,{IDF_TARGET_NAME} 支持 {IDF_TARGET_SOC_CPU_WATCHPOINTS_NUM} 个观察点。更多详细信息,请查阅 `GDB 配置远程目标 <https://sourceware.org/gdb/onlinedocs/gdb/Remote-Configuration.html>`_
* ``mon reset halt`` — 复位芯片并使 CPU 停止运行。目标必须复位以禁用内存保护,这对于启用 FLASH 支持是必要的。如果不希望复位,可在 OpenOCD 命令行添加额外参数 ``-c 'set ESP_FLASH_SIZE 0'`` 来禁用 FLASH 支持,详见 :ref:`jtag-debugging-tip-openocd-config-vars`或者,可以通过配置选项 :ref:`CONFIG_ESP_SYSTEM_MEMPROT` 关闭内存保护。
* ``mon reset halt`` — 复位芯片并使 CPU 停止运行。必须复位目标芯片以禁用内存保护,这启用 flash 支持所必需的。如果不希望复位,可在 OpenOCD 命令行开头添加额外参数 ``-c 'set ESP_FLASH_SIZE 0'`` 来禁用 flash 支持,详见 :ref:`jtag-debugging-tip-openocd-config-vars`另一种方法是使用配置选项 :ref:`CONFIG_ESP_SYSTEM_MEMPROT` 来禁用内存保护。
* ``maintenance flush register-cache`` — monitor (``mon``) 命令无法通知 GDB 目标状态已经更改GDB 会假设在 ``mon reset halt`` 之前所有的任务堆栈仍然有效。实际上,复位后目标状态将发生变化。执行 ``maintenance flush register-cache`` 是一种强制 GDB 从目标获取最新状态的方法。
* ``thb app_main`` — 在 ``app_main`` 处插入一个临时的硬件断点,如果有需要,可以将其替换为其他函数名。
* ``c`` — 恢复程序运行,它将会在 ``app_main`` 的断点处停止运行。
@@ -192,7 +192,7 @@ TCL 语言中为变量赋值的语法是:
* - ``ESP_RTOS``
- 设置成 ``none`` 可以关闭 OpenOCD 对 RTOS 的支持,这样的话,你将无法在 GDB 中查看到线程列表。这个功能在调试 FreeRTOS 本身的时候会很有用,可以单步调试调度器的代码。
* - ``ESP_FLASH_SIZE``
- 设置成 ``0`` 可以关闭对 flash 断点的支持。如果设置为 ``0``GDB 连接时不会复位目标。
- 设置成 ``0`` 可以关闭对 flash 断点的支持。如果设置为 ``0``GDB 连接时不会复位目标芯片
* - ``ESP_SEMIHOST_BASEDIR``
- 设置 semihosting 在主机端的默认目录。
* - ``ESP_ONLYCPU``
@@ -246,18 +246,18 @@ JTAG 管脚是否能用于其他功能
.. _jtag-debugging-security-features:
JTAG 与 flash 加密和安全引导
JTAG 与 flash 加密和安全启动
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
默认情况下,开启了 flash 加密和(或者)安全引导后,系统在首次启动时,引导加载程序会烧写 eFuse 的某个比特,从而将 JTAG 永久关闭。
默认情况下,开启了 flash 加密和(或者)安全启动后,系统在首次启动时,引导加载程序会烧写 eFuse 的某个比特,从而将 JTAG 永久关闭。
.. only:: SOC_HMAC_SUPPORTED
请注意,一旦 JTAG 被永久禁用,就无法重新启用以访问 JTAG。但是我们也提供了暂时禁用 (soft disable) JTAG 的选项。有关如何暂时禁用以及重新启用 JTAG请参考 :ref:`hmac_for_enabling_jtag`
Kconfig 配置项 :ref:`CONFIG_SECURE_BOOT_ALLOW_JTAG` 可以改变这个默认行为,使得用户即使开启了安全引导或者 flash 加密,仍会保留 JTAG 的功能。
Kconfig 配置项 :ref:`CONFIG_SECURE_BOOT_ALLOW_JTAG` 可以改变这个默认行为,使得用户即使开启了安全启动或者 flash 加密,仍会保留 JTAG 的功能。
然而,为了设置 :ref:`软件断点 <jtag-debugging-tip-where-breakpoints>`OpenOCD 可能会尝试自动读写 flash。设置软件断点会改变被签名程序的摘要并使签名失效。这意味着如果启用了安全引导、设置了软件断点,然后进行复位,签名验证将在启动时失败。
然而,为了设置 :ref:`软件断点 <jtag-debugging-tip-where-breakpoints>`OpenOCD 可能会尝试自动读写 flash。设置软件断点会改变被签名程序的摘要并使签名失效。这意味着如果启用了安全启动、设置了软件断点,然后进行复位,启动时的签名验证将失败。
关闭 JTAG 的软件断点功能,可以在启动 OpenOCD 时在命令行额外加一项配置参数 ``-c 'set ESP_FLASH_SIZE 0'``,请参考 :ref:`jtag-debugging-tip-openocd-config-vars`