Setting up the Altera Quartus JTAG Programmer on Ubuntu 16.04
Preparation:
Run dmesg -w
to show you the logstream of USB devices connecting and disconnecting
Before launching Quartus
Before starting the JTAG programmer in Quartus, the dmesg
entries should look like this:
Start the Quartus Programmer
Starting the programmer will do 2 things:
- Load the JTAG server (
jtagd --user-start --config ~/.jtagd.conf
) - Load the driver for the USB connection
Unable to select the device in the Quartus programmer?
The most likely issue is that currently, you do not have permission to access the device, as by default, USB devices are only accessible as root. Luckily, (as long as you have root access in your system), you can fix this.
-
Figure out where the USB device lives on the filesystem. In UNIX, everything is a file, including USB devices. Go to
/dev/bus/usb
, where you will find several folders. The first level indicates the (internal) USB hub, the second level the device number. As seen before, my device has number 25, therefore there is only 1 candidate:/dev/bus/usb/001/025
. -
Set read-write permissions for all users on that file, eg
sudo chmod 666 /dev/bus/usb/001/025
. This has to be done every time you plug in your FPGA, which can get very tedious. -
Luckily, the linux kernel devs have thought of this and added a feature called udev rules. These are commands that are run, as root, when a USB device of a specific signature connects. Create the file
/etc/udev/rules.d/52-usbblaster.rules
. Any number between 0 and 100 and name will do but usually the high and low 10 are reserved for system purposes. Do make sure it adheres to the format{number}-{name}.rules
. In this file create one udev entry. Mine is shown below. Ensure that the idVendor and idProduct actually match the codes displayed in yourdmesg
output. The rest of the entry is self-explanatory. Finally, restart the udev service bysudo service udev restart
, forcing it to reload the udev rules. -
Check whether your udev rules has worked. Replug your USB connection and verify that your device now has read and write permissions for all users, eg:
Any further issues?
I believe this should be a comprehensive guide for getting Altera FPGAs working on Ubuntu 16.04. If you still have issues, please leave a comment so we can resolve it and add it to the guide.
Subscribe via RSS