ARM Programming

Pages
Contributors: M-Short, Ell C
Favorited Favorite 12

JTAG and SWD

Joint Test Action Group

JTAG stands for Joint Test Action Group (the group who defined the JTAG standard) and was designed as a way to test boards. JTAG allows the user to talk to the bits and pieces of the microcontroller. In many cases, this involves giving them a set of instructions or programming the board. The JTAG standard defines 5 pins:

  • TCK: Test Clock
  • TMS: Test Mode Select
  • TDI: Test Data-In
  • TDO: Test Data-out
  • TRST: Test Reset (Optional)

The reduced pin count JTAG definition really only consists of 2 pins:

  • TMSC: Test Serial Data
  • TCKS: Test Clock

The 20 pin connector you see on some programmers was designed for JTAG and all those extra pin can be used for power, ground, and other things. While JTAG does not define a physical pin layout, there are a few common options. The 20 pin connector you see on Segger's J-Link EDU Base and Base Compact programmer is a good example.

JTAG Pinout

Serial Wire Debug

Serial Wire Debug (SWD) is really just a modification/implementation of JTAG specifically for ARM processors. SWD puts the 2 pins (SWDIO and SWCLK) on top of the JTAG pins allowing a user to use either JTAG or SWD without the need to breakout more pins.

SWD Pinout