openocd
provides debugging and programming for embedded systems
TLDR
Start with config file
SYNOPSIS
openocd [-f config] [-c command] [-d level] [options]
DESCRIPTION
openocd (Open On-Chip Debugger) provides debugging and programming for embedded systems. It interfaces with JTAG and SWD debug adapters to access microcontrollers.
Configuration files define the debug adapter (interface) and target device. Many boards and adapters have predefined configurations in the installation.
Programming mode flashes firmware to microcontrollers. Verify confirms the write succeeded. Reset starts the new firmware.
When running as a server, OpenOCD provides GDB server (port 3333) and telnet interface (port 4444). GDB connects for source-level debugging.
The telnet interface allows direct commands: halt, resume, step, memory read/write, register access, and breakpoint management.
Multiple targets can be debugged simultaneously. JTAG chains with several devices are supported.
PARAMETERS
-f FILE
Configuration file.-c CMD
Run command.-s DIR
Search directory.-d LEVEL
Debug level (0-3).-l FILE
Log to file.--version
Show version.--help
Show help.
CAVEATS
Requires appropriate adapter hardware. Target configuration must match device. Some features are adapter-specific. Debug permissions may need udev rules.
HISTORY
OpenOCD was started by Dominic Rath as a university project in 2005. It became the standard open-source on-chip debugger, supporting hundreds of target devices and debug adapters. Development continues under community governance.
SEE ALSO
gdb(1), arm-none-eabi-gdb(1), stlink(1), avrdude(1)
