openocd-jtag

Configure OpenOCD and adapters to flash firmware and attach GDB over JTAG or SWD.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/awfixers-stuff/opencode-config --skill openocd-jtag-awfixers-stuff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openocd-jtag
Source: https://github.com/awfixers-stuff/opencode-config/tree/main/skills/openocd-jtag
Command: npx skills add https://github.com/awfixers-stuff/opencode-config --skill openocd-jtag-awfixers-stuff

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides step-by-step guidance to configure OpenOCD and debug microcontroller targets over JTAG or SWD, flash firmware, and attach GDB for bare-metal debugging to reduce setup friction and common connection errors.

Core Features & Use Cases

  • Configuration guidance: How to select and compose interface and target configuration files for CMSIS-DAP, J-Link, ST-Link and common MCU families.
  • Flashing and GDB integration: Methods to program ELF or raw binaries via OpenOCD or GDB and how to connect and control a GDB session to the OpenOCD remote target.
  • Hardware breakpoints & troubleshooting: How to use hardware breakpoints and watchpoints, common OpenOCD monitor commands, and fixes for frequent errors such as "unable to find JTAG device".
  • Use Case: Flash and debug an STM32F4 or nRF52 using a CMSIS-DAP or J-Link adapter, run break-on-reset, and set hardware watchpoints for peripheral debugging.

Quick Start

Use the openocd-jtag skill to generate a minimal OpenOCD configuration and the exact GDB steps to flash and start a debug session for an STM32F4 target.

Frequently Asked Questions about openocd-jtag

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure OpenOCD to flash firmware and debug an STM32F4 over SWD?

To configure OpenOCD for STM32F4, select the appropriate interface file for your adapter, set the transport mode to SWD, specify the adapter speed, and use the correct target configuration file to flash firmware and attach GDB for bare-metal debugging.

Why does OpenOCD report "unable to find JTAG device" when connecting to my MCU?

The "unable to find JTAG device" error in OpenOCD usually means your adapter interface, transport mode, or adapter speed is misconfigured. Verify correct target configuration files and ensure compatible GDB toolchain presence to resolve frequent connection errors.

Does OpenOCD support J-Link and CMSIS-DAP adapters for Cortex-M debugging?

Yes, OpenOCD supports J-Link and CMSIS-DAP adapters for Cortex-M debugging. You need to select the correct adapter interface configuration file and set the appropriate transport mode and adapter speed for your specific hardware.

How do I connect arm-none-eabi-gdb to an OpenOCD remote target to set hardware breakpoints?

Connect arm-none-eabi-gdb to the default OpenOCD remote target port to start a debug session. Once attached, you can use standard GDB commands and OpenOCD monitor commands to set hardware breakpoints and watchpoints for peripheral debugging.

What is the best way to program raw binaries to a microcontroller using OpenOCD and GDB?

The best way to program raw binaries or ELF files to a microcontroller is by using OpenOCD flashing commands directly or controlling the programming process through a connected GDB session via the OpenOCD remote target interface.

How do I set up a break-on-reset debug session for an nRF52 using OpenOCD?

To set up a break-on-reset session for an nRF52, configure OpenOCD with the correct target file and adapter settings, attach arm-none-eabi-gdb over the default port, and use monitor commands to reset the target and halt immediately for debugging.