JTAG and SWD pinout: Arm debug headers
JTAG uses four mandatory signals (TCK, TMS, TDI, TDO) and SWD, Arm’s two-wire equivalent, uses only two (SWCLK, SWDIO), on the same pins. Three headers dominate: the 20-pin Arm JTAG at 2.54 mm pitch, the 10-pin Cortex Debug at 1.27 mm pitch and its 20-pin version with ETM trace.
By Hugues Orgitello · Updated ·
Arm Cortex Debug connector, 10-pin SWD/JTAG, 1.27 mm pitch
The most common header on recent Cortex-M boards. SWD name first, then JTAG, when a pin carries both. Pin 7 is removed to act as a key.
| Pin | Signal | Dir. | Description |
|---|---|---|---|
| 1 | VTref | Target reference voltage, read by the probe to set its logic levels (Power) | |
| 2 | SWDIO / TMS | I/O | Bidirectional SWD data, or JTAG mode select (Signal) |
| 3 | GND | Ground (Ground) | |
| 4 | SWCLK / TCK | In | Debug clock, driven by the probe (Signal) |
| 5 | GND | Ground (Ground) | |
| 6 | SWO / TDO | Out | SWO trace output, or JTAG data out (Signal) |
| 7 | KEY | No pin (key) (Not connected) | |
| 8 | NC / TDI | In | JTAG data in, unused in SWD (Signal) |
| 9 | GNDDetect | Ground, lets the target detect the probe (Ground) | |
| 10 | nRESET | I/O | Target reset, active low (Signal) |
Cortex Debug + ETM, 20 pins, 1.27 mm pitch
Pins 1 to 10 repeat the 10-pin header; pins 11 to 20 add 4-bit parallel ETM trace.
| Pin | Signal | Dir. | Description |
|---|---|---|---|
| 1 | VTref | Target reference voltage, read by the probe to set its logic levels (Power) | |
| 2 | SWDIO / TMS | I/O | SWD data or TMS (Signal) |
| 3 | GND | Ground (Ground) | |
| 4 | SWCLK / TCK | In | Debug clock (Signal) |
| 5 | GND | Ground (Ground) | |
| 6 | SWO / TDO | Out | SWO trace or TDO (Signal) |
| 7 | KEY | No pin (key) (Not connected) | |
| 8 | NC / TDI | In | TDI in JTAG (Signal) |
| 9 | GNDDetect | Probe-detect ground (Ground) | |
| 10 | nRESET | I/O | Target reset, active low (Signal) |
| 11 | GND / TgtPwr+Cap | Ground, or target power from the probe (Ground) | |
| 12 | TRACECLK | Out | ETM trace clock (Signal) |
| 13 | GND / TgtPwr+Cap | Ground, or target power from the probe (Ground) | |
| 14 | TRACEDATA0 | Out | Trace data, bit 0 (Signal) |
| 15 | GND | Ground (Ground) | |
| 16 | TRACEDATA1 | Out | Trace data, bit 1 (Signal) |
| 17 | GND | Ground (Ground) | |
| 18 | TRACEDATA2 | Out | Trace data, bit 2 (Signal) |
| 19 | GND | Ground (Ground) | |
| 20 | TRACEDATA3 | Out | Trace data, bit 3 (Signal) |
Arm JTAG 20 pins, 2.54 mm pitch
The legacy header of J-Link and ULINK probes and many evaluation boards. Every even pin from 4 to 20 is ground on the target side. Careful: SEGGER states that pins 14 to 20 on a J-Link are reserved and not necessarily grounded inside the probe.
| Pin | Signal | Dir. | Description |
|---|---|---|---|
| 1 | VTref | Target reference voltage, read by the probe to set its logic levels (Power) | |
| 2 | Vsupply | Optional supply per Arm; not connected in most probes (Power) | |
| 3 | nTRST | In | JTAG logic reset, active low, optional (Signal) |
| 4 | GND | Ground (Ground) | |
| 5 | TDI | In | JTAG data in (Signal) |
| 6 | GND | Ground (Ground) | |
| 7 | TMS / SWDIO | I/O | JTAG mode select, or SWD data (Signal) |
| 8 | GND | Ground (Ground) | |
| 9 | TCK / SWCLK | In | Debug clock (Signal) |
| 10 | GND | Ground (Ground) | |
| 11 | RTCK | Out | Return clock, for adaptive clocking (Signal) |
| 12 | GND | Ground (Ground) | |
| 13 | TDO / SWO | Out | JTAG data out, or SWO trace (Signal) |
| 14 | GND | Ground (Ground) | |
| 15 | nRESET | I/O | Target system reset, active low (also called nSRST) (Signal) |
| 16 | GND | Ground (Ground) | |
| 17 | NC | Not connected (formerly DBGRQ) (Not connected) | |
| 18 | GND | Ground (Ground) | |
| 19 | NC | Not connected (formerly DBGACK; some probes supply 5 V here) (Not connected) | |
| 20 | GND | Ground (Ground) |
ST-LINK/V2, 20-pin JTAG/SWD connector (CN3)
Pinout of the boxed ST-LINK/V2 probe, target side, from the JTAG/SWD table in UM1075. Pin positions match the Arm 20-pin JTAG header above, with four differences: pins 1 and 2 both carry VAPP, pin 11 is not connected (no RTCK), pin 19 supplies 3.3 V and is not wired to the target, and in SWD mode ST advises tying TRST (3) and TDI (5) to ground to reduce noise on the ribbon. The ST-LINK/V2-ISOL has its own table in UM1075.
| Pin | Signal | Dir. | Target in JTAG | Target in SWD | Description |
|---|---|---|---|---|---|
| 1 | VAPP | MCU VDD | MCU VDD | Target voltage (microcontroller VDD), read by the probe to set its logic levels (Power) | |
| 2 | VAPP | MCU VDD | MCU VDD | Same VAPP input as pin 1 in UM1075: put nothing but VDD on it (Power) | |
| 3 | TRST | In | JNTRST | GND | JTAG logic reset; tie to ground in SWD (Signal) |
| 4 | GND | GND | GND | Ground (Ground) | |
| 5 | TDI | In | JTDI | GND | JTAG data in; tie to ground in SWD (Signal) |
| 6 | GND | GND | GND | Ground (Ground) | |
| 7 | TMS_SWDIO | I/O | JTMS | SWDIO | JTAG mode select, or SWD data (Signal) |
| 8 | GND | GND | GND | Ground (Ground) | |
| 9 | TCK_SWCLK | In | JTCK | SWCLK | Debug clock, driven by the probe (Signal) |
| 10 | GND | GND | GND | Ground (Ground) | |
| 11 | NC | Not connected | Not connected | Not connected: the ST-LINK/V2 does not use RTCK (Not connected) | |
| 12 | GND | GND | GND | Ground (Ground) | |
| 13 | TDO_SWO | Out | JTDO | TRACESWO | JTAG data out, or SWO trace (optional, for Serial Wire Viewer) (Signal) |
| 14 | GND | GND | GND | Ground (Ground) | |
| 15 | NRST | I/O | NRST | NRST | Target reset, active low (Signal) |
| 16 | GND | GND | GND | Ground (Ground) | |
| 17 | NC | Not connected | Not connected | Not connected (Not connected) | |
| 18 | GND | GND | GND | Ground (Ground) | |
| 19 | VDD | Not connected | Not connected | 3.3 V from the probe; ST says not to connect it on the target side (Power) | |
| 20 | GND | GND | GND | Ground (Ground) |
Onboard ST-LINK (Nucleo, STLINK-V3SET), 6-pin SWD connector
Same order on the SWD connector of the ST-LINK/V2-1 on Nucleo boards (CN4 on Nucleo-64, CN6 on Nucleo-144) and on connector CN6 of the STLINK-V3SET MB1440 adapter. It is a debug output towards an external board: on a Nucleo, first remove both CN2 jumpers (CN4 on Nucleo-144), otherwise the probe stays wired to the board’s own STM32.
| Pin | Signal | Dir. | Description |
|---|---|---|---|
| 1 | VDD_TARGET | Target board voltage, read by the probe; it does not power the target (Power) | |
| 2 | SWCLK | In | SWD clock (Signal) |
| 3 | GND | Ground (Ground) | |
| 4 | SWDIO | I/O | Bidirectional SWD data (Signal) |
| 5 | NRST | I/O | Reset of the target STM32. On Nucleo-64, open SB12 (SB111 on Nucleo-144) before using it towards an external board (Signal) |
| 6 | SWO | Out | SWO trace, optional (marked "Reserved" in the Nucleo manuals) (Signal) |
Tag-Connect TC2030 (SWD), 6 pads
Connector-less footprint: the spring-pin cable presses onto six PCB pads. Assignment of the TC2030-CTX cable for the 10-pin Cortex header.
| Pin | Signal | Dir. | Description |
|---|---|---|---|
| 1 | VTref | Target reference voltage, read by the probe to set its logic levels (Power) | |
| 2 | SWDIO | I/O | SWD data (Signal) |
| 3 | nRESET | I/O | Target reset, active low (Signal) |
| 4 | SWCLK | In | SWD clock (Signal) |
| 5 | GND | Ground (Ground) | |
| 6 | SWO | Out | SWO trace (Signal) |
Tag-Connect TC2050 (JTAG and SWD), 10 pads
Ten-pad version, wired pin for pin to the 10-pin Cortex header (TC2050-IDC-NL-050 cable): pad n carries the signal of header pin n. Note that the numbering runs around the footprint (1 to 5 along the bottom, 6 to 10 along the top from right to left), whereas the TC2030 alternates odd pads at the bottom and even pads at the top.
| Pin | Signal | Dir. | Description |
|---|---|---|---|
| 1 | VTref | Target reference voltage, read by the probe to set its logic levels (Power) | |
| 2 | SWDIO / TMS | I/O | SWD data, or JTAG mode select (Signal) |
| 3 | GND | Ground (Ground) | |
| 4 | SWCLK / TCK | In | Debug clock (Signal) |
| 5 | GND | Ground. Not carried by the standard TC2050-IDC-NL-050 cable, carried by the -ALL version (Ground) | |
| 6 | SWO / TDO | Out | SWO trace, or JTAG data out (Signal) |
| 7 | NC | No connection: the key position on the Cortex header (Not connected) | |
| 8 | NC / TDI | In | JTAG data in, unused in SWD (Signal) |
| 9 | GNDDetect | Probe-detect ground. Not carried by the standard cable, carried by the -ALL version (Ground) | |
| 10 | nRESET | I/O | Target reset, active low (Signal) |
A board to make debuggable and testable in production, then locked before shipping? We design the debug port, the programming bench and the protection strategy.
JTAG or SWD?
On a Cortex-M, SWD does everything development needs (programming, breakpoints, memory reads) with two wires, plus SWO for printf-style trace. JTAG stays useful to chain several parts on one interface (FPGA, CPLD, processor) and for production boundary-scan testing (IEEE 1149.1).
The most common design mistakes
VTref left unconnected. The probe reads VTref to set its levels. Left floating, the probe does not detect the target, or drives its signals at the wrong voltage. VTref goes to the microcontroller’s I/O supply, not to the board input.
nRESET not wired. Without it, the probe cannot regain control of firmware that disables the SWD pins or goes into deep sleep at startup. Keep a pull-up (often 10 kΩ) and a modest capacitor.
Debug port left open in production. An accessible JTAG or SWD port lets anyone read out the firmware and keys. On a connected product, lock it (read-protection levels, debug fuses) before shipping: the Cyber Resilience Act expects it too.
FAQ
- How are the TC2050 pads numbered?
- Around the footprint, like an IC package: seen from above, 1 to 5 left to right along the bottom row, then 6 to 10 right to left along the top row. The single alignment hole is on the left, beside pads 1 and 10. The TC2030 follows a different rule (odd pads at the bottom, even at the top): copying one onto the other swaps half the signals.
- What is the difference between JTAG and SWD?
- JTAG (IEEE 1149.1) is a multi-vendor 4 or 5-wire standard that can chain several parts. SWD is Arm’s 2-wire debug interface (SWCLK, SWDIO), which shares the TCK and TMS pins. On a Cortex-M, SWD is enough to program and debug.
- How do you connect a 20-pin probe to a 10-pin header?
- With a 20-pin 2.54 mm to 10-pin 1.27 mm adapter, sold by the probe makers. The wiring is not pin to pin: VTref, SWDIO, SWCLK, SWO and nRESET change numbers (1, 7, 9, 13 and 15 on the 20-pin side; 1, 2, 4, 6 and 10 on the 10-pin side).
- What is the VTref pin for?
- It gives the probe the target’s I/O voltage, so its buffers drive the signals at the right level (1.8 V, 3.3 V or 5 V). It does not power the board. Without it, most probes refuse to connect.
- Should JTAG be disabled on a production product?
- On a connected product, yes, or at least protect it. An open debug port lets someone extract the firmware and secrets. Microcontrollers offer read-protection levels or fuses that lock it, sometimes irreversibly.
- Is the ST-LINK/V2 pinout the same as the Arm 20-pin JTAG?
- Almost. TMS/SWDIO (7), TCK/SWCLK (9), TDO/SWO (13), nRESET (15), TDI (5), TRST (3) and the even ground pins sit at the same positions. The differences: the ST-LINK/V2 groups pins 1 and 2 into one VAPP input, does not use RTCK (11), and supplies 3.3 V on pin 19, which ST says not to connect on the target. A board built for the Arm JTAG header therefore works, unless it puts something other than VDD on pin 2.
- What is the pinout of a USB-stick ST-Link V2 clone?
- There is no single one. These 10-pin sticks are not ST products and their pinout changes between models and batches: we found two incompatible orders for SWDIO, SWCLK and GND. Go by the label printed on the shell, check ground and 3.3 V with a meter before plugging in, and never wire the stick’s 3.3 V or 5 V output to a board that is already powered.
- Arm, Cortex-M Debug Connectors
- SEGGER Knowledge Base, 20-pin J-Link Connector
- Tag-Connect, TC2030-CTX datasheet
- Tag-Connect, TC2030-IDC-NL footprint (pad numbering)
- Tag-Connect, TC2050-IDC-NL footprint (pad numbering)
- Tag-Connect, TC2050-IDC-NL-050-ALL (1:1 wiring to the 10-pin Cortex connector)
- IEEE 1149.1, Standard Test Access Port and Boundary-Scan Architecture (paid or members-only document)
- STMicroelectronics, UM1075 ST-LINK/V2 in-circuit debugger/programmer (Rev 10, April 2024)
- STMicroelectronics, UM2448 STLINK-V3SET debugger/programmer (Rev 9, April 2025)
- STMicroelectronics, UM1724 STM32 Nucleo-64 boards (MB1136)
- STMicroelectronics, UM1974 STM32 Nucleo-144 boards (MB1137)
Tables built from these documents and cross-checked against manufacturer datasheets. Always check the datasheet of the connector you actually use: some manufacturers number differently.
- Industrial IoT cybersecurity: securing a deployed fleet
- Cyber Resilience Act compliance for connected products
- Embedded DevOps and automated bench tests
- Embedded firmware development
Other pinouts
- USB-C
- USB-A, USB-B, Mini and Micro
- RJ45 Ethernet
- M12 industrial
- DB9 (DE-9)
- HDMI
- Raspberry Pi GPIO
- M.2 (keys M, B and E)
- SD and microSD card
- PCI Express card edge
- SATA
- DDR4 DIMM and SO-DIMM
- DDR5 DIMM and SO-DIMM
- OBD2 (OBD-II, J1962)
- ESP32, S3, C3 and C6
- Bosch ECUs EDC15P+, EDC16C34, MD1CS006
- RJ11, RJ14, RJ12 (6P6C)
- VGA (DE-15) and DVI
- RS-485 (Modbus)
- Arduino Uno, Nano and Mega
- Raspberry Pi Pico
- PC power: ATX, PCIe, fan