JTAG — Maple v0.0.12 Documentation

### Navigation

- next
- previous |
- LeafLabs |
- Index »

# JTAG

JTAG is an interface for low-level debugging of digital devices. It gives instruction by instruction control over the microprocessor and allows data to be read and written to arbitrary memory and register locations. It is typically used with a debugging tool like gdb when hacking low level routines and hardware peripherals (we use it when working on libmaple) or to flash a new bootloader.

Note that the STM32 on the Maple has a built-in low level serial debugger which could also be used to flash bootloaders, and ASSERT(...) allows basic debugging over a USART serial channel. We expect only fairly advanced users to use this feature.

Contents

- Wiring Diagram
- Compatible Devices
- Function Reference
- Recommended Reading

## Wiring Diagram

JTAG wiring diagram (large version) to connect a standard 20-pin ARM JTAG device to the 8-pin JTAG port on the Maple.

The Maple has holes for a 8-pin JTAG header, but that header is not soldered on. To use JTAG, simply solder on standard 0.1” pitch male header pins (either the exact 4 by 2 block, or two 4-pin pieces of straight breakaway header).

## Compatible Devices

We have had good experience with the Olimex ARM-USB-OCD device, which costs about €55 plus shipping (as of April 2011).

## Function Reference

You can disable or enable the JTAG and Serial Wire debugging ports in software using the `disableDebugPorts()` and `enableDebugPorts()` functions.

- disableDebugPorts()
- enableDebugPorts()

## Recommended Reading

- Wikipedia Article on Joint Test Action Group (JTAG)
- STM32, GDB, OpenOCD How To
- LeafLabs Wiki JTAG How To
- LeafLabs forum thread on JTAG
- ST documentation:
  - Reference Manual RM0008 (PDF), Chapter 31, “Debug support”, and Chapter 9, “General-purpose and alternate function I/Os”.

### Navigation

- next
- previous |
- LeafLabs |
- Index »