OpenOCD - grandideastudio/jtagulator GitHub Wiki

The JTAGulator can interface directly with OpenOCD, a cross-platform, open source software tool that provides on-chip debugging, in-system programming, and boundary-scan testing for embedded target devices. This allows the JTAGulator to manipulate target devices once the JTAG interface is discovered without the need for a separate hardware adapter.

Usage

The feature is accessible within the JTAG menu using the O command. The JTAGulator emulates the OpenOCD binary protocol used by the Bus Pirate. You will need to provide a correct JTAG pinout for the target (TDI, TDO, TMS, TCK). This can be determined with the JTAG Scan (J) if it is not already known. Targets that use SWD are not supported.

The JTAGulator's LED will turn RED when it is in the OpenOCD mode and ready to accept communication from OpenOCD. This mode will persist across resets, power cycles, and firmware updates of the JTAGulator. It can only be exited manually by the user.

Once the OpenOCD mode has been entered, you can close the terminal program and invoke OpenOCD from the command line as recommended below. The OpenOCD mode will remember your target voltage setting (VADJ) and JTAG pinout. If you are using OpenOCD with different targets, be aware that you may need to exit OpenOCD mode and adjust VADJ to match your current target's I/O voltage.

Due to the nature of the Bus Pirate protocol, data transfer speeds are quite slow (in the hundreds of bytes/second range depending on the target). This may result in OpenOCD appearing non-responsive as data is transferred between the software, JTAGulator, and target. The JTAGulator's LED will toggle between RED and YELLOW during data transfer to provide a visual indication of activity.

To exit OpenOCD mode and return to normal JTAGulator functionality, open your terminal program and press Ctrl-X. You will be presented with the command prompt (>) and the JTAGulator's LED will turn GREEN.

Installation

JTAGulator has been tested with OpenOCD 0.11.0+dev (as of September 6, 2021) on Ubuntu 18.04 LTS, macOS Mojave 10.14, and Windows 10. We strongly recommend using a Linux distribution. Issues related to macOS or Windows will not be supported.

OpenOCD must be compiled from source in order to include the required Bus Pirate binary protocol support. This process will vary depending on your operating system (Linux, macOS, Windows).

Recommended steps for Linux are as follows:

sudo apt-get install git
sudo apt-get install libtool autoconf texinfo libusb-dev libftdi-dev
git clone git://git.code.sf.net/p/openocd/code openocd-git
./bootstrap
./configure --enable-maintainer-mode --disable-werror --enable-buspirate
make
sudo make install

The precompiled OpenOCD package for Linux (obtained with sudo apt-get install openocd) may already contain support for the Bus Pirate binary protocol. To test if your installation of OpenOCD is compliant, run the following:

strings $(which openocd) | grep pirate

Command Line

Replace <port> with your JTAGulator's serial port and <target> with your desired target/CPU file. See OpenOCD's man page and User's Guide for additional command-line arguments and usage examples. Before starting OpenOCD, wait for the JTAGulator's LED to turn RED.

openocd -f interface/buspirate.cfg -c "transport select jtag; buspirate port <port>" -f <target>

Screenshots

Ubuntu 18.04 Windows 10
OpenOCD + LoFive-R1 on Ubuntu 18.04 OpenOCD + LoFive-R1 on Windows 10

JTAGulator HW Rev. B and earlier may have compatibility issues with certain target devices. This is caused by the JTAGulator's front-end circuitry (level translators, diodes, and series resistors) affecting signal levels between the JTAGulator and target. Consider implementing the recommended hardware modifications if needed.

If you experience other problems, please visit the official OpenOCD project bug list before opening an issue.

⚠️ **GitHub.com Fallback** ⚠️