Actions

EmSys

Difference between revisions of "OpenOCD Ubuntu Package"

From EdWiki

m (Installing the OpenOCD Package)
m (CEDT-USB-JTAG Support)
Line 2: Line 2:
 
As an alternative to compiling [[EmSys:OpenOCD |OpenOCD]] from source, [[EmSys:OpenOCD |OpenOCD]] is available via Ubuntu's Advanced Packaging Tool (APT). Ubuntu users can download and install OpenOCD using the ''apt-get'' command.
 
As an alternative to compiling [[EmSys:OpenOCD |OpenOCD]] from source, [[EmSys:OpenOCD |OpenOCD]] is available via Ubuntu's Advanced Packaging Tool (APT). Ubuntu users can download and install OpenOCD using the ''apt-get'' command.
  
 +
<!--
 
==CEDT-USB-JTAG Support==
 
==CEDT-USB-JTAG Support==
  
 
This package is based on the OpenOCD 0.5.0 release available at http://prdownload.berlios.de/openocd/openocd-{{OPENOCD_VERNUM}}.tar.gz. It does not include support for the CEDT-USB-JTAG adapter. To compile OpenOCD with CEDT-USB-JTAG adapter support, please see [[EmSys:Compiling OpenOCD Linux |Compiling OpenOCD Linux for CEDT-USB-JTAG]].
 
This package is based on the OpenOCD 0.5.0 release available at http://prdownload.berlios.de/openocd/openocd-{{OPENOCD_VERNUM}}.tar.gz. It does not include support for the CEDT-USB-JTAG adapter. To compile OpenOCD with CEDT-USB-JTAG adapter support, please see [[EmSys:Compiling OpenOCD Linux |Compiling OpenOCD Linux for CEDT-USB-JTAG]].
 +
-->
  
 
==Installing the OpenOCD Package==
 
==Installing the OpenOCD Package==

Revision as of 03:46, 9 April 2022

As an alternative to compiling OpenOCD from source, OpenOCD is available via Ubuntu's Advanced Packaging Tool (APT). Ubuntu users can download and install OpenOCD using the apt-get command.


Installing the OpenOCD Package

Open a terminal window (Applications menu > Accessories > Terminal) and type:

sudo apt-get update
sudo apt-get install openocd

The Ubuntu APT will install OpenOCD and its config files to your computer. As with any command using sudo, you will need an administrator password to run this command.

Linking to /usr/share/openocd

The package installs config files to /usr/share/openocd/scripts, but OpenOCD looks for config files in /usr/local/share/openocd/scripts. Fix that now by creating a symbolic link in /usr/local/share to /usr/share/openocd. In the terminal window, type:

cd /usr/local/share
sudo ln -s /usr/share/openocd .

OpenOCD will now be able to find its config files. For more information on how OpenOCD searches for config files, see OpenOCD Config File Paths.

Running OpenOCD

You can run OpenOCD from a terminal window from any directory. Installing OpenOCD from the APT allows users to run OpenOCD without sudo. (If you compiled OpenOCD yourself you would need to take special steps to allow users to use OpenOCD without sudo.

In a terminal window, type:

openocd -f path_to/file.cfg [-f another_path_to/file2.cfg]

For example, to run OpenOCD for the hitex str9 comstic board, type:

openocd -f interface/hitex_str9-comstick.cfg -f target/str912.cfg

To get started, see Running OpenOCD on Linux. If you encounter errors, see OpenOCD Troubleshooting.