Search topics...

What hardware debugging protocols are used to communicate with ARM microcontrollers?

0 upvotes
Practice with AISoon

ARM debug is built around the CoreSight debug architecture, accessed through a Debug Access Port (DAP). The two standard physical/wire protocols to reach the DAP are:

  • JTAG (IEEE 1149.1): The traditional 4–5 pin interface — TCK, TMS, TDI, TDO (and optional TRST). General-purpose boundary-scan and debug; can daisy-chain multiple devices on one scan chain. Used widely and supported by virtually all ARM cores.
  • SWD (Serial Wire Debug): ARM's 2-pin alternative — SWDIO (bidirectional data) and SWCLK (clock). Same debug capabilities as JTAG for a single device but uses far fewer pins, which is ideal for small MCU packages. SWD is the most common interface for Cortex-M microcontrollers. The pins are often multiplexed with JTAG (SWJ-DP can switch between SWD and JTAG).

Trace (separate from run-control debug) for non-intrusive observation:

  • SWO (Serial Wire Output) / SWV (Serial Wire Viewer): A single-pin asynchronous trace output, usually carrying ITM (Instrumentation Trace Macrocell — e.g., printf-style debug, application events) and DWT (Data Watchpoint and Trace) data. SWO is commonly paired with SWD (the combo is sometimes called SWD + SWO), reusing the JTAG TDO pin.
  • ETM / ETB (Embedded Trace Macrocell / Buffer): Full instruction (and optionally data) trace for reconstructing program flow, output over a parallel Trace Port (TPIU) using a trace clock + several trace-data pins (high bandwidth), or buffered on-chip.
  • HTM/STM and other CoreSight trace sources on larger SoCs.

Supporting concepts to mention: the on-chip NVIC/CoreSight components provide breakpoints (FPB — Flash Patch and Breakpoint), watchpoints (DWT), and run/halt/single-step control via the DAP. Physical debug probes (e.g., generic CMSIS-DAP adapters, SEGGER J-Link, ST-Link) speak JTAG/SWD on the target side and USB to the host.

Summary: the two run-control wire protocols are JTAG and SWD (SWD being dominant for Cortex-M), complemented by SWO/ITM/DWT and ETM/TPIU for trace.