From 5bd970df4fcb937798ad7ae25996cd0e54b9bf63 Mon Sep 17 00:00:00 2001 From: Abdelatif Guettouche Date: Wed, 12 May 2021 10:40:36 +0100 Subject: [PATCH] Documentation/esp32c3: Explain debugging with OpenOCD. Signed-off-by: Abdelatif Guettouche --- .../platforms/risc-v/esp32c3/index.rst | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Documentation/platforms/risc-v/esp32c3/index.rst b/Documentation/platforms/risc-v/esp32c3/index.rst index 0cc66d48c6..8c8026f47c 100644 --- a/Documentation/platforms/risc-v/esp32c3/index.rst +++ b/Documentation/platforms/risc-v/esp32c3/index.rst @@ -67,6 +67,35 @@ Note that this step is required only one time. Once the bootloader and partitio table are flashed, we don't need to flash them again. So subsequent builds would just require: ``make download ESPTOOL_PORT=/dev/ttyUSBXX`` +Debugging with OpenOCD +====================== + +Download and build OpenOCD from Espressif, that can be found in +https://github.com/espressif/openocd-esp32 + +If you have an ESP32-C3 ECO3, no external JTAG is required to debug, the ESP32-C3 +integrates a USB-to-JTAG adapter. + +OpenOCD can then be used:: + + openocd -c 'set ESP_RTOS none' -f board/esp32c3_builtin.cfg + +For versions prior to ESP32-C3 ECO3, an external JTAG adapter is needed. +It can be connected as follows:: + + TMS -> GPIO4 + TDI -> GPIO5 + TCK -> GPIO6 + TDO -> GPIO7 + +Furthermore, an efuse needs to be burnt to be able to debug:: + + espefuse.py -p burn_efuse DIS_USB_JTAG + +OpenOCD can then be used:: + + openocd -c 'set ESP_RTOS none' -f board/esp32c3-ftdi.cfg + Peripheral Support ==================