Chips over JTAG
The pod's debug probe also speaks JTAG, for chips and boards that have no SWD.
What it is for
- RISC-V chips that have no SWD
- The classic ESP32, which debugs over JTAG only
- Older Arm chips with a JTAG port and no SWD
- FPGA and CPLD programming through SVF files
- Boundary scan and chains with more than one chip
Wiring
Set the JTAG pins in the wiring profile, next to the SWD ones. Each is an LA channel from 1 to 14. A chip with both ports can share SWCLK with TCK and SWDIO with TMS. The pin-out shows where the channels are.
| Profile field | JTAG signal | Note |
|---|---|---|
jtag_tck | TCK | May use the same LA pin as swd_swclk |
jtag_tms | TMS | May use the same LA pin as swd_swdio |
jtag_tdi | TDI | Data from the pod into the chain |
jtag_tdo | TDO | Data from the chain back to the pod |
jtag_trst | nTRST | Optional. The pod drives it and releases it high |
{
"jtag_tck": 11,
"jtag_tms": 12,
"jtag_tdi": 9,
"jtag_tdo": 10
}The reset line stays on the pod's own reset pin. The I/O voltage is the wiring profile's, the same as for SWD.
The tools choose JTAG for you
The web app, the CLI, the SDK and the MCP server pick the port the same way, in this order:
- Pins in the call. A call that carries JTAG pins and no SWD pins uses JTAG; SWD pins and no JTAG pins use SWD. A call with both sets, or none, goes on to the next step (a missing pin comes from the pins profile).
- The profile's
debug_port."swd"or"jtag". If that port's pins are not all set, the tool stops and names the missing profile fields. - Automatic. JTAG when the wiring has all four of TCK, TMS, TDI and TDO and either no SWD pins or a chip that only has JTAG (the OpenOCD targets
esp32,esp32s2,gd32vf103,fe310,k210and anything starting withriscv). Otherwise SWD.
A board with both pin sets wired gets SWD for an Arm chip unless the profile says otherwise. To flash it over JTAG every time, set debug_port in the profile, or pick it in the Debug port list of the Pins tab (shown when both pin sets are set):
{
"swd_swclk": 11, "swd_swdio": 12,
"jtag_tck": 11, "jtag_tms": 12, "jtag_tdi": 9, "jtag_tdo": 10,
"debug_port": "jtag"
}A chip that only has JTAG needs no setting:
benchpod flash --target target/esp32.cfg --file firmware.elf
Requirements
- Firmware 4.0.4 or later (gateware v61 or later). Older pods refuse JTAG with an error; see error codes.
- Not while emulated sensors run. The emulation image has no JTAG (and, from gateware v65, no SWD). Stop the sensors; the pod then switches to the loop image by itself. With sensors running it answers
BP0059. - Slower than SWD for Arm chips. Each JTAG access is a round trip, while SWD accesses are queued. Flashing an Arm chip over JTAG takes longer than over SWD, so use SWD when the chip has it.