OpenOCD

Precompiled binaries

Compile on Linux

Get OpenOCD latest version:

git clone https://github.com/ntfreak/openocd.git
cd openocd

./bootstrap
./configure

Build:

make
sudo make install

Compile on Windows

We do not offer support for this.

Cross compilation for Windows

Build MXE toolchain

Full instructions here: https://mxe.cc/

Get the repo:

git clone https://github.com/mxe/mxe.git

Compile required files:

# Basic mingw32
make -j cc
# USB/FTDI libs for openocd
make -j libusb1 libftdi1

Install or set PATH:

export PATH=/path_to_my_directory/mxe/usr/bin:$PATH

You now have the required “i686-w64-mingw32.static” compiler.

Build OpenOCD

Get OpenOCD latest version:

git clone https://github.com/ntfreak/openocd.git
cd openocd

./bootstrap
./configure --prefix= --host=i686-w64-mingw32.static --enable-ftdi

Build:

make pkgdatadir=

Create a Windows package layout:

make pkgdatadir= DESTDIR=/tmp/openocd install
cd /tmp

ls -l openocd/
total 0
drwxr-x---  2 po po  60 Jan 16 13:57 bin
drwxr-x---  2 po po  60 Jan 16 13:57 OpenULINK
drwxr-x--- 11 po po 300 Jan 16 13:57 scripts
drwxr-x---  4 po po  80 Jan 16 13:57 share

zip -r openocd-win.zip openocd/

openocd-win.zip

WinUSB driver for Windows

Before using OpenOCD with the JTAG Cable, you need to replace the default FTDI driver with WinUSB.

To do that, download Zadig and run it.

  1. Connect the JTAG Cable to your computer.

  2. List all devices in Zadig.

_images/zadig_listall.png
  1. Assign “WinUSB” driver to the device “Quad RS232-HS (Interface 0)”.

_images/zadig_replace.png

Done !

_images/zadig_success.png