You are here: HomeNotesAltera FPGAsEnabling Altera's USB Blaster on LINUX (OpenSUSE 11.4)

Enabling Altera's USB Blaster on LINUX (OpenSUSE 11.4)

 

Introduction

USB blasterWhen installing Altera's Quartus II software on LINUX (see previous article) although the installation of the software is fairly straight forward difficulties sometimes arise in detecting the USB Blaster. In this article the technique used to provide a working hardware configuration capability for the LINUX version of Quartus II and the USB Blaster is presented.

In the first instance an attempt is made to detect the USB Blaster built-into Altera's Cyclone III Starter Kit and in the second an attempt is made to detect a standalone USB Blaster.

This method is broken in OpenSuse 13.1, as SYSFS has been deprecated and replaced with ATTR. An update to this blog post is Altera (1) - Introduction, Installing Quartus 14.1 On Linux (3.11.10-21, x86-64)

Problem Statement

On this system Quartus II 11sp1 32-bit has been installed in user mode although root access is available. Ultimately, we are attempting to program a development board using a USB Blaster in user mode. So here we go!

Firstly, the development board with a built-iin USB Blaster should be  powered-up and a check should be made to see if the USB Blaster is recognised by LINUX. Open a terminal window and list all the available USB devices by typing the following command.

>> lsusb

The partial and relevant result of listing the available USB devices, on this system, is shown in the Figure below.

blg000003

The important entry is the last one in the figure. It tells us that an USB device with a textual description "Altera Blaster" with a vendor  ID = 09fb and a product ID = 6001 has been recognised.

Secondly, to see what action LINUX attempts to perform investigate the kernel (?) by typing the following:

>> sudo cat /var/log/messages

The result is shown in the output below.

blg000004

This confirms that the USB device has been recognised and provides more detailed information. More importantly, it informs us that the JTAG daemon has been started (Not sure what  the "jtagd: No remote JTAG because stops when idle" means.)..

Start the Quartus II software and then navigate to Tools->Programmer to start the programmer.

blg000006

Click on the "Hardware Setup" button and confirm that the USB Blaster has been recognised.

blg000007

Closing this window returns us to the previous one. When you click on the "Auto Detect" button in order to detect the JTAG chain, that the USB Blaster is connected to, the message below appears.

blg000008

So what do we do next?

Solution

Solutions provided on the Internet always require that a udev rules file is created and saved in the /etc/udev/rules.d directory. udev provides us with the means to name a device, like the USB Blaster, so that it is recognised, when it is plugged and unplugged, persistently. It also directs the kernal to which additional actions it should perform when this happens.

So firstly, I added the lines, shown in the listing below, to the file 51-usbblaster.rules, as root, under /etc/udev/rules.d/ using a text editor. Any text editor like Emacs will do.

BUS=="usb", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6001", 
MODE="0666", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf /proc/bus/usb/%%03i/%%03i$${K%%%%.*} $${K#*.}'", 
RUN+="/bin/chmod 0666 %c"
BUS=="usb", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6002", MODE="0666", 
PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf /proc/bus/usb/%%03i/%%03i$${K%%%%.*} $${K#*.}'", RUN+="/bin/chmod 0666 %c"
BUS=="usb", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6003", 
MODE="0666", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf /proc/bus/usb/%%03i/%%03i$${K%%%%.*} $${K#*.}'", 
RUN+="/bin/chmod 0666 %c"

Now let us dismantle one of the rules so that we can attempt to understand what it does:

BUS=="usb" : If the inserted, or removed, device is on the usb(assignment key ) BUS(match key).

SYSFS{idVendor}=="09fb" : ... with a sysfs filesystem attribute, vendor ID, that matches 09fb and ...

SYSFS{idProduct}=="6001" : ...with a sysfs filesystem attribute, product ID, ihat matches 6001. Then it must be a USB Blaster. Do the following

MODE="0666" : Set the device mode to 0666 which means allow it to be read and written to by all user groups ( as no specific user groups have been specified).

PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf /proc/bus/usb/%%03i/%%03i$${K%%%%.*} $${K#*.}'" : Execute this shell script  when a matching device is inserted (or removed?).

RUN+="/bin/chmod 0666 %c" :

After unplugging the USB Blaster the /var/log/messages has been checked as can be seen below. It appears that the 51-usbblaster.rules has been recognised although some of  the match keys will be deprecated and replaced with others in future versions.

blg000009

After inserting the USB Blaster cable, after the previous removal, the following status is provided in /var/log/messages

blg000010

Next restart Quartus II and repeat the sequence carried out above. Click on the "Auto Detect" button and Bob's your uncle. The following dialogue appears.

 blg000011

This is all that has been done, to enable the USB Blaster,  when using Quartus II  11sp1 wih OpenSUSE 11.4 .

blg000012

Conclusion

There are many solutions available on how to get Quartus I and Quartus II to work with LINUX in general and openSUSE LINUX in particular .  Now, it seems that all that is required is to include the appropriate rules.

Go to comments start