Using OpenOCD with VisualGDB

OpenOCD is an open-source tool that provides support for many inexpensive JTAG/SWD debuggers that don’t come with their own software. The OpenOCD tool is very flexible and powerful, however it requires some initial setup for most of the cases. VisualGDB simplifies the initial setup by providing user interface with shortcuts to most frequently used functionality.

VisualGDB can automatically install the following OpenOCD forks, based on the device you are debugging:

OpenOCD fork Original fork Recommended devices
OpenOCD-ST Multi-core STM32H7 devices
OpenOCD-RP2040 (integrated into mainline OpenOCD) Raspberry Pi Pico (RP2040)
OpenOCD-Kendryte Kendryte K210
OpenOCD-ESP8266 ESP8266
OpenOCD-Mainline git:// All other devices (including regular STM32)

VisualGDB provides convenient GUI for configuring the OpenOCD and managing the JTAG debugger drivers. In most cases, you can simply select the debug interface and the target device, and VisualGDB will configure OpenOCD automatically:You can always tweak the OpenOCD parameters by expanding the “Advanced Settings” view and editing the OpenOCD command line, or the GDB commands used to start the debug session.

Differences between the Mainline OpenOCD and the ST Fork

The mainline OpenOCD reliably supports most of the regular ARM-based devices (including the STM32 devices). However, it lacks support for debugging multi-core STM32H7 devices with ST-Link and uses slightly different implementations for some low-level functions.

We recommend using the mainline OpenOCD for most debug configurations, unless you need to debug both cores of a multi-core device at the same time.

If you are planning to debug multiple cores, or experience problems with the regular OpenOCD branch, please consider using the ST fork. It is based on the same code base as the version shipped with the STM32CubeIDE and should behave the same way.


If you encounter OpenOCD errors while trying to debug your target, check this page for troubleshooting instructions for most common issues.