j-marjanovic / jtag-quartus-ft232h

GNU General Public License v3.0
44 stars 16 forks source link

JTAG library for FT232H on Pikes Peak / Storey Peak FPGA Boards

This driver allows using the on-board FT232 chip as a JTAG interface in Quartus for the Pikes Peak and Storey Peak FPGA accelerator boards.

Installation

Install pre-reqs:

# On Debian/Ubuntu hosts
sudo apt-get install -y libtool pkg-config texinfo libusb-dev libusb-1.0.0-dev libftdi-dev autoconf libjim-dev git wget build-essential cmake openocd

Build:

git clone https://github.com/j-marjanovic/jtag-quartus-ft232h
cd jtag-quartus-ft232h
mkdir build && cd build
cmake ..
make -j`nproc`

To install, copy libjtag_hw_otma.so to your quartus linux64 directory (eg. $HOME/altera/15.0/quartus/linux64).

To avoid permission errors, create an UDev rule allowing permission to the plugdev group and add your user to this group.

cat << EOF | sudo tee /etc/udev/rules.d/100-usb-ftdi.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", OWNER="root", GROUP="plugdev", TAG+="uaccess"
EOF

Add your user to plugdev group with sudo adduser $USER plugdev

Initialization

Before using this driver, run OpenOCD to initialize the FT232H:

openocd \
    -f interface/ftdi/um232h.cfg \
    -c "adapter speed 2000; transport select jtag; jtag newtap auto0 tap -irlen 10 -expected-id 0x029070dd; init; exit;"

To initialize the interface at different clock speeds, change the adapter_khz parameter.

OpenOCD prebuilt binaries can be downloaded from https://github.com/xpack-dev-tools/openocd-xpack/releases.

Current state

Download time

The following table present the bitstream download time at different clock speeds for 5SGSMD5 with the bitstream size of 213,798,880 bits (cca 26 MB).

Clock rate [MHz] Download time [mm:ss]
2 03:51
4 02:50
6 02:24
10 02:03
20 01:54

Usage example

Result after programming the bitstream:

Quartus Programmer

Useful links

Dummy device

To install the library:

sudo ln -sf $(readlink -f libjtag_hw_dummy.so) /opt/intelFPGA/19.1/quartus/linux64/

To listen do the debug log:

nc -lkuU /var/tmp/jtag-dummy.sock