Chapter 4. API Guides
This page lists SWD-compatible adapters as well; take note that the ESP32-S2 does not support SWD. JTAG adapters
that are hardcoded to a specific product line, e.g. ST-LINK debugging adapters for STM32 families, will not work.
The minimal signalling to get a working JTAG connection are TDI, TDO, TCK, TMS and GND. Some JTAG de-
buggers also need a connection from the ESP32-S2 power line to a line called e.g. Vtar to set the working voltage.
SRST can optionally be connected to the CH_PD of the ESP32-S2, although for now, support in OpenOCD for that
line is pretty minimal.
ESP-Prog
is an example for using an external board for debugging by connecting it to the JTAG pins of ESP32-S2.
4.17.4 Setup of OpenOCD
If you have already set up ESP-IDF with CMake build system according to the
is already installed. After
setting up the environment
this by executing the following command:
openocd --version
The output should be as follows (although the version may be more recent than listed here):
Open On-Chip Debugger
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
You may also verify that OpenOCD knows where its configuration scripts are located by printing the value of
OPENOCD_SCRIPTS environment variable, by typing echo $OPENOCD_SCRIPTS (for Linux and macOS)
or echo %OPENOCD_SCRIPTS% (for Windows). If a valid path is printed, then OpenOCD is set up correctly.
If any of these steps do not work, please go back to the
Note: It is also possible to build OpenOCD from source. Please refer to
for details.
4.17.5 Configuring ESP32-S2 Target
Once OpenOCD is installed, you can proceed to configuring the ESP32-S2 target (i.e ESP32-S2 board with JTAG
interface). Configuring the target is split into the following three steps:
• Configure and connect JTAG interface
• Run OpenOCD
• Upload application for debugging
Configure and connect JTAG interface
This step depends on the JTAG and ESP32-S2 board you are using (see the two cases described below).
Configure ESP32-S2-Kaluga-1 JTAG Interface
functionality. Putting it to work requires setting jumpers or DIP switches to enable JTAG functionality, and config-
uring USB drivers. Please refer to step by step instructions below.
Configure Hardware
• Out of the box, ESP32-S2-Kaluga-1 doesn' t need any additional hardware configuration for JTAG debugging.
However if you are experiencing issues, check that the"JTAG" DIP switches (SW5 in the schematic) labelled
TCK, TDO, TDI, TMS are in "ON"position.
Espressif Systems
in your terminal, you should be able to run OpenOCD. Check
v0.10.0-esp32-20190708 (2019-07-08-11:04)
setting up the tools
All versions of ESP32-S2-Kaluga-1 boards have built-in JTAG
1372
Submit Document Feedback
Getting Started
Guide, then OpenOCD
section of the Getting Started Guide.
Building OpenOCD from Sources
section
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?