|
@@ -233,6 +233,27 @@ Below is an excerpt from series of errors reported by GDB after the application
|
|
|
cpu1: xtensa_resume (line 431): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
|
|
cpu1: xtensa_resume (line 431): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
|
|
|
cpu1: xtensa_resume (line 431): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
|
|
cpu1: xtensa_resume (line 431): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
|
|
|
|
|
|
|
|
|
|
+.. _jtag-debugging-security-features:
|
|
|
|
|
+
|
|
|
|
|
+JTAG with Flash Encryption or Secure Boot
|
|
|
|
|
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
+
|
|
|
|
|
+By default, enabling Flash Encryption and/or Secure Boot will disable JTAG debugging. On first boot, the bootloader will burn an eFuse bit to permanently disable JTAG at the same time it enables the other features.
|
|
|
|
|
+
|
|
|
|
|
+The project configuration option :ref:`CONFIG_SECURE_BOOT_ALLOW_JTAG` will keep JTAG enabled at this time, removing all physical security but allowing debugging. (Although the name suggests Secure Boot, this option can be applied even when only Flash Encryption is enabled).
|
|
|
|
|
+
|
|
|
|
|
+However, OpenOCD may attempt to automatically read and write the flash in order to set :ref:`software breakpoints <jtag-debugging-tip-where-breakpoints>`. This has two problems:
|
|
|
|
|
+
|
|
|
|
|
+- Software breakpoints are incompatible with Flash Encryption, OpenOCD currently has no support for encrypting or decrypting flash contents.
|
|
|
|
|
+- If Secure Boot is enabled, setting a software breakpoint will change the digest of a signed app and make the signature invalid. This means if a software breakpoint is set and then a reset occurs, the signature verification will fail on boot.
|
|
|
|
|
+
|
|
|
|
|
+To disable software breakpoints while using JTAG, add an extra argument ``-c 'set ESP_FLASH_SIZE 0'`` to the start of the OpenOCD command line. For example::
|
|
|
|
|
+
|
|
|
|
|
+ openocd -c 'set ESP_FLASH_SIZE 0' -f board/esp32-wrover-kit-3.3v.cfg
|
|
|
|
|
+
|
|
|
|
|
+.. note::
|
|
|
|
|
+
|
|
|
|
|
+ For the same reason, the ESP-IDF app may fail bootloader verification of app signatures, when this option is enabled and a software breakpoint is set.
|
|
|
|
|
|
|
|
.. _jtag-debugging-tip-at-firmware-issue:
|
|
.. _jtag-debugging-tip-at-firmware-issue:
|
|
|
|
|
|
|
@@ -243,7 +264,6 @@ The ESP32-WROOM series of modules come pre-flashed with AT firmware. This firmwa
|
|
|
|
|
|
|
|
To make JTAG available, build new firmware that is not using pins GPIO12 to GPIO15 dedicated to JTAG communication. After that, flash the firmware onto your module. See also :ref:`jtag-debugging-tip-jtag-pins-reconfigured`.
|
|
To make JTAG available, build new firmware that is not using pins GPIO12 to GPIO15 dedicated to JTAG communication. After that, flash the firmware onto your module. See also :ref:`jtag-debugging-tip-jtag-pins-reconfigured`.
|
|
|
|
|
|
|
|
-
|
|
|
|
|
.. _jtag-debugging-tip-reporting-issues:
|
|
.. _jtag-debugging-tip-reporting-issues:
|
|
|
|
|
|
|
|
Reporting issues with OpenOCD / GDB
|
|
Reporting issues with OpenOCD / GDB
|