LOGBOOK

HELP

Quiz Entry - updated: 2026.11.10

JTAG was designed for testing boards. How did it become the standard way to program and debug microcontrollers "in circuit"?

Chip makers added more data registers behind the same TAP: registers that reach the CPU's debug unit (halt, step, read registers and memory) and the flash controller (erase and write). The same four wires that test the pins can now control the processor and program the chip on the finished board.

The instruction register is open-ended. A manufacturer can define private instructions that connect their own data registers to the chain, and they did:

  • Processor debug. A debug module inside the CPU can stop the core, report the program counter, read and write any register or memory address, and set hardware breakpoints. JTAG becomes the transport for a full source-level debugger.
  • In-system programming. Flash memories, CPLDs (complex programmable logic devices) and FPGAs can be loaded through the chain while soldered onto the board. A developer board with a flash chip, a CPLD, a memory-card controller and an FPGA on one JTAG chain can program all of them from one connector.

"In circuit" is the important part. Before, a chip often had to be programmed in a separate socket before assembly, and a running program could only be observed through printf over a serial port. With JTAG the code runs on the real board, with the real sensors attached, and the debugger can freeze it at any point to look inside.

The flip side matters for security: whoever reaches those four pins gets the same powers. See the card on JTAG as an attack surface.

Go deeper:

  • doc Wikipedia — JTAG — the sections on debugging and on storing firmware through JTAG.
  • doc OpenOCD User's Guide — the open-source tool that uses JTAG for flash programming and CPU debugging on hundreds of chips.

From Quiz: SIOT / JTAG Debugging with OpenOCD and GDB | Updated: Nov 10, 2026