Using a Raspberry Pi as a JTAG Dongle

ref. https://github.com/synthetos/PiOCD/wiki/Using-a-Raspberry-Pi-as-a-JTAG-Dongle

RaspberryPiをJTAGアダプタに仕立てる

SSH from Mac

% ssh pi@192.168.0.10

pi@raspberrypi:~ $ sudo apt-get update
$ sudo apt-get install -y autoconf libtool libftdi-dev texinfo pkg-config pkgconf git
以下のパッケージには満たせない依存関係があります:
 pkgconf : 破壊: pkg-config (>= 0.29-1)

// try to install pkg-config separately
$ sudo apt-get install -y autoconf libtool libftdi-dev texinfo pkgconf git
$ sudo apt-get install pkg-config
以下のパッケージは「削除」されます:
  pkgconf
以下のパッケージが新たにインストールされます:
  pkg-config
続行しますか? [Y/n] n
中断しました。

$ git clone --recursive git://git.code.sf.net/p/openocd/code openocd-git && cd openocd-git

~/openocd-git $ ./bootstrap
$./configure 
--enable-sysfsgpio     --enable-maintainer-mode      --disable-werror      --enable-ft2232_libftdi      --enable-ep93xx      --enable-at91rm9200      --enable-usbprog      --enable-presto_libftdi      --enable-jlink      --enable-vsllink      --enable-rlink      --enable-arm-jtag-ew      --enable-dummy      --enable-buspirate      --enable-ulink      --enable-presto_libftdi      --enable-usb_blaster_libftdi      --enable-ft2232_libftdi         --prefix=/usr\
configure: error: libusb-1.x is required for the Keil ULINK JTAG Programmer
$ sudo apt-get install libusb-1.0-0-dev

$./configure 
--enable-sysfsgpio     --enable-maintainer-mode      --disable-werror      --enable-ft2232_libftdi      --enable-ep93xx      --enable-at91rm9200      --enable-usbprog      --enable-presto_libftdi      --enable-jlink      --enable-vsllink      --enable-rlink      --enable-arm-jtag-ew      --enable-dummy      --enable-buspirate      --enable-ulink      --enable-presto_libftdi      --enable-usb_blaster_libftdi      --enable-ft2232_libftdi         --prefix=/usr\
...
OpenOCD configuration summary
--------------------------------------------------
MPSSE mode of FTDI based devices        yes (auto)
ST-Link Programmer                      yes (auto)
TI ICDI JTAG Programmer                 yes (auto)
Keil ULINK JTAG Programmer              yes
Altera USB-Blaster II Compatible        yes (auto)
Bitbang mode of FT232R based devices    yes (auto)
Versaloon-Link JTAG Programmer          yes
TI XDS110 Debug Probe                   yes (auto)
CMSIS-DAP v2 Compliant Debugger         yes (auto)
OSBDM (JTAG only) Programmer            yes (auto)
eStick/opendous JTAG Programmer         yes (auto)
Andes JTAG Programmer                   yes (auto)
USBProg JTAG Programmer                 yes
Raisonance RLink JTAG Programmer        yes
Olimex ARM-JTAG-EW Programmer           yes (auto)
CMSIS-DAP Compliant Debugger            no
Nu-Link Programmer                      no
Cypress KitProg Programmer              no
Altera USB-Blaster Compatible           yes (auto)
ASIX Presto Adapter                     yes (auto)
OpenJTAG Adapter                        yes (auto)
Linux GPIO bitbang through libgpiod     no
SEGGER J-Link Programmer                yes
Use Capstone disassembly framework      no

$ sudo make install

$ sudo cp -r tcl/ /usr/share/openocd
$ cd /usr/share/openocd/board
$ ls
tcl
$ cd /usr/share/openocd/tcl/board
$ sudo wget https://gist.github.com/giseburt/e832ed40e3c77fcf7533/raw/e8c71233970e4d42eed7c3bf4b13390cdcf2a1fd/raspberrypi-due.tcl