openocd-jtag
OpenOCD skill for embedded hardware debugging. Use when configuring OpenOCD for JTAG or SWD targets, flashing firmware, connecting GDB to bare-metal targets, setting hardware watchpoints, or using J-Link with OpenOCD. Activates on queries about OpenOCD, JTAG, SWD, GDB remote target, flash programmin
By mohitmishra786 · 421 installs
npx skills add mohitmishra786/low-level-dev-skills --skill openocd-jtag
Source repository · Upstream listing
OpenOCD / JTAG Debugging
Purpose
Guide agents through configuring OpenOCD for JTAG and SWD targets, flashing firmware to microcontrollers, attaching GDB for bare metal debugging, setting hardware watchpoints, and configuring J Link and CMSIS DAP adapters.
Triggers
"How do I connect GDB to my MCU with OpenOCD?"
"How do I flash firmware using OpenOCD?"
"How do I set up J Link with OpenOCD?"
"What's the difference between JTAG and SWD?"
"How do I set a hardware watchpoint in GDB?"
"OpenOCD says 'Error: unable to find JTAG device' — how do I fix it?"
Workflow
1. JTAG vs SWD
Feature JTAG SWD (Serial Wire Debug)
Pins 4+ (TCK, TMS, TDI, TDO, TRST) 2 (SWCLK, SWDIO)
Multi target Yes (daisy chain) No (one target)
Speed Up to 30 MHz Up to 10 MHz
Availability Full JTAG: Cortex A/R, RISC V SWD: Cortex M only
Cable cost More complex Simpler 2 wire
Most Cortex M microcontrollers support both. Use SWD when pin count is limited.
2. OpenOCD configuration
3. Connecting GDB
4. Flashing firmware
5. Hardware breakpoints and watchpoints
Software breakpoints ( break ) patch instruction memory with trap instructions — they don't work in flash execute in place without debug registers. Use hardware breakpoints instead:
6. OpenOCD commands reference
7. Common errors
Error Cause Fix
unable to find JTAG device Wrong interface, cable, or power Check USB connection; power target; verify interface config
JTAG scan chain interrogation failed Wrong target config or bad SWD mode Match config to exact MCU; try transport select swd
flash 'stm32f4x' is not supported Wrong target Check MCU part number; use correct .cfg
Error: timed out while waiting for target halted Target running, not halted monitor halt ; check BOOT pins
Cannot access memory at address MMU, memory protection, or wrong address Check MPU config; use correct flash/RAM address
Warn: target not examined yet OpenOCD not connected to target Check power and connections
8. J Link configuration
J Link GDB Server (alternative to OpenOCD):
Related skills
Use skills/embedded/freertos for FreeRTOS aware debugging with OpenOCD
Use skills/embedded/zephyr for Zephyr's west debug integration
Use skills/debuggers/gdb for GDB session management
Use skills/embedded/linker scripts for understanding memory map for flash addresses