language en Translation(s): српски


This page is dedicated to the installation and configuration of the free-software on-chip debugger
tool for various hardware architectures known as OpenOCD on Debian.
OpenOCD

#


What is OpenOCD ?

OpenOCD is a free-software tool mainly used for on-chip debugging, in-system
programming and boundary-scan testing. OpenOCD supports flashing and
debugging a wide variety of platforms such as:

The full list of supported CPU types can be accessed here: User's Guide.
The tool can be easily installed on x86_64,i386 and ARM hosts
running Debian (as well as many other Unix-Like Operating Systems)


Installation

Considerations

The OpenOCD tool can be found in Debian's repositories by default and installing works as expected.
However, (especially if you are running oldstable (Debian 9)), the packaged version
might not coincide with the latest stable release of OpenOCD.
Thus, depending on the latest changelog, you might be missing board configuration file additions, bug fixes, etc.
Installing via xpm, albeit lengthier, ensures an updated
package version and automatic integration with Eclipse Plugins (Gnu-ARM-Eclipse).

Installing via the package manager

sudo apt-get install openocd

Installing via xpm (latest)

0.If applicable, remove previous installs of npm (local prefix) with:

sudo rm -rf /usr/local/lib/nodejs
rm -rf ~/opt/npm
npm config delete prefix

1.Install Node.js and npm with nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
bash
nvm install --lts node
nvm ls
nvm use node
node --version
nvm install-latest-npm
which npm

2.Install xpm (openocd is provided as a dev-tool pack for xpm)
npm install --global xpm@latest
which xpm
xpm --version

3.Install openocd via xpm
xpm install --global @xpack-dev-tools/openocd@latest

If no errors are reported, OpenOCD should be installed
at the following location (Substitute $user with your username
and $ver with your current version of the software):
/home/$user/opt/xPacks/@xpack-dev-tools/openocd/$ver/.content/bin/

Symlinking the executable to another location such as /usr/bin might be of interest:
ln -s /home/$user/opt/xPacks/@xpack-dev-tools/openocd/$ver/.content/bin/openocd /usr/bin/openocd


Configuration