Xilinx JTAG Linux OLD

This page is an older version of the new Xilinx JTAG Linux. If you are running Ubuntu 11.04 (or newer) or Xilinx ISE 13.2 (or newer), then check out the new tutorial page, Xilinx JTAG Linux.

If you make copies of this page or rehost it, please host your own images. My poor Server can’t cope!

Introduction

If you found this information helpful, you can Donate a small sum of money (of your choosing) to help me get through my degree and for the upkeep of this server.

This page originally gave a basic howto on installing the cable drivers for the Xilinx ISE (specifically iMPACT) under Linux/Unix. The page was well received, and I got many emails with various problems, which we overcome 🙂 This page was modified to include the ISE installation. This was prompted by me having to reinstall ISE on Ubuntu 9.10 (64-bit). This method I have tested on Ubuntu 8.04, 10.04_beta and Mint Gloria. It should certainly be valid for any Debian based system, and probably any system where it is possible to do what I have suggested.

Finally, I am no expert in any of this: FPGAs, Xilinx or Linux. I just applied what knowledge I did have, and made it work. I offer my experience as help to you. You may contact me here.

A Short Guide to Installing Xilinx ISE

This Install Guide refers to Ubuntu 9.10 (Karmic Koala) 64-bit Desktop Edition.

When installing Xilinx ISE, make sure that the installer is located on the hard drive. The installer needs to have write permissions to the setup files. Burning the files to DVD has been reported to create problems.

Download Xilinx ISE from their website. This guide assumes you have Xilinx_11.1_ISE_DS_SFD, which is the full version, and not the webpack. However, the webpack should work in the same manor.

Extract the archives to a place with read and write permissions, and chmod the installer file executable my all. To do this, change into the folder with the installer files are located and issue the command

sudo chmod a+x xsetup

Then you are ready to install the ISE suite. I suggest you do this as root. To start the installer, enter the following command:

sudo ./xsetup

Go though the menus, as they are fairly obvious. Here are my suggested responses:

    • Next the welcome screen.
    • Accept the License Agreement.
    • Accept the License Agreement, once again.
    • Except the default install path of /opt/Xilinx/11.1 – Feel free to change this, but the rest of this guide assumes you have left this.

: Also note, when working and referring to this path, that Xilinx begins with a capitalised X. This tricked me for some time 🙂

  • Select what you wish to be installed. I chose ISE Design Suite Product including the Design Tools, PlanAhead, DSP Tools, Embedded Dev Kit, ChipScope Pro. Next when you are ready.
  • Select the ISE Design Tools. I left everything checked: Design Enviroment Tools, WebPack Devices, Foundation/Edition Devices.
  • Keep all the suggested paths.
  • You next have to select the last few installation options. Check Aquire/Manage a License Key. Uncheck Install cable drivers (does not work, use the method outlined below) and Launch XilinxUpdate – This is a minor detail, and can be done later.
  • Review the options summary. Here is mine. Yours will look different based on Distro, and your options.

Install Location : /opt/Xilinx/11.1
Acquire or Manage a License Key
Launch XilinxUpdate

ISE Design Tools
Install Location : /opt/Xilinx/11.1/ISE
XILINX = /opt/Xilinx/11.1/ISE
PATH = ${XILINX}/bin/${PLATFORM}
LMC_HOME = ${XILINX}/smartmodel/${PLATFORM}/installed_${PLATFORM}
LD_LIBRARY_PATH = ${XILINX}/lib/${PLATFORM}
Design Environment Tools
WebPack Devices
Foundation/Edition Devices
Enable WebTalk
Set Xilinx Registry

PlanAhead Analysis Tool
Install Location : /opt/Xilinx/11.1/PlanAhead
XILINX_PLANAHEAD = /opt/Xilinx/11.1/PlanAhead
PATH = ${XILINX_PLANAHEAD}/bin
PlanAhead Common Files
Setup Environment

Embedded Development Kit (EDK)
Install Location : /opt/Xilinx/11.1/EDK
XILINX_EDK = /opt/Xilinx/11.1/EDK
LD_LIBRARY_PATH = ${XILINX_EDK}/lib/${PLATFORM}
PATH = ${XILINX_EDK}/bin/${PLATFORM}:${XILINX_EDK}/lib/${PLATFORM}
Platform Studio Tool and Processor IP

ChipScope Pro
Install Location : /opt/Xilinx/11.1/ChipScope
CHIPSCOPE = /opt/Xilinx/11.1/ChipScope
PATH = ${CHIPSCOPE}/bin/${PLATFORM}
LD_LIBRARY_PATH = ${CHIPSCOPE}/lib/${PLATFORM}:${CHIPSCOPE}/xilinx/lib/${PLATFORM}
ChipScope Pro Common Files and Serial I/O Toolkit option support

DSP Tools (System Generator, AccelDSP)
Install Location : /opt/Xilinx/11.1/DSP_Tools
XILINX_DSP = /opt/Xilinx/11.1/DSP_Tools/lin64
LD_LIBRARY_PATH = ${XILINX_DSP}/sysgen/lib
PATH = ${XILINX_DSP}/common/bin
TEMP = /tmp
TMP = /tmp
System Generator for DSP
Unix/Linux Post-installation script

    • Wait for a small eternity.
    • The Xilinx License Configuration Manager should appear:

: Select what best describes what you need. The “Start ISE WebPack” gives you unlimited access to fundamental applications, but not to everything. for help on what does what, check out the Xilinx Software Matrix, here. At this point, I select “Get my Purchased Licenses”. This opens Firefox (or your default web browser), and asks you to log into their system. You can download your licenses file from them, and browse to it using the “Copy License” button under the “Manage Xilinx License” tab. Either way, get a license from Xilinx. Once you have done so, close the License Config Manager.

  • You should be told Installation is complete 🙂 Press Okay.
  • Move onto the next steps of installing cable drivers.

Using Xilinx USB JTAG Programmers under Linux (Installing Cable Drivers)

Assuming you have followed the above installation howto, this next section should follow on. If you jumped straight here to this section the next section on installing Cable Drivers should standalone. If you have problems, please check that you have similar options set in your ISE install to those I outline in the previous section.

Xilinx JTAG Programmer (USB)

Getting what’s needed

First of all, this guide assumes you have installed Xilinx ISE (version 11.1 is used here) into the default path of /opt/Xilinx

Next, you will need to have GIT installed to get the required libraries. This approach does not use the official Xilinx libraries but a replica of them. You will also need libusb-dev which is required in the compiling of the drivers. You will also need build-essential metapackage for the compiler. On a 64-bit host, you will need to get the 32-bit version of libc6-dev-i386.

On 32-bit

sudo apt-get install gitk git-gui libusb-dev build-essential libc6-dev fxload

On 64-bit

sudo apt-get install gitk git-gui libusb-dev build-essential libc6-dev-i386 fxload
Philipp Hörauf reports there is a need to install ia32-libs-dev on some 64-bit systems, though I didn’t require this.

Download the driver source

You should firstly change to the installation directory. You need (assuming default install path) to change directory to /opt/Xilinx. Then you will be required to use git to download the source.

cd /opt/Xilinx
sudo git clone git://git.zerfleddert.de/usb-driver

Compiling the Driver

This step is once simple command, but the most important. Firstly change into the source directory created in the previous step. Then you need to issue the make command.

cd usb-driver/

On 32-bit

sudo make

On 64-bit

sudo make lib32

Linking in the Compiled Driver

This step is not needed for versions of Xilinx ISE newer than 10.1: LD_PRELOAD instructs the loader to load additional libraries into a program, beyond what was specified when it was compiled. It allows us to load the USB CableDriver into iMPACT without recompiling it (which we clearly cannot do).

export LD_PRELOAD=/opt/Xilinx/usb-driver/libusb-driver.so

Satisfying udev

udev is the device manager for the Linux 2.6 kernel series. Primarily, it manages device nodes and hotpluging, which means that it handles the adding/removing devices, including firmware loading. This is what we are required to do. The Xilinx Programmer doesn’t have any firmware, and so we need to tell the computer that when we plug in the programmer, that it should attempt to load the correct firmware to it. fxload should do this for us. Fortunately all of the complex stuff comes with the driver source downloaded previously. All we need to do is put it in the places the computer expects it. Then we need to restart udev, so it sees the new configurations.

In Ubuntu 9.10/10.04 (or if udev doesn’t appear to notice a plug-in):

sudo sed /opt/Xilinx/11.1/ISE/bin/lin/xusbdfwu.rules -e ‘s:TEMPNODE:tempnode:g’ > /etc/udev/rules.d/xusbdfwu.rules
sudo cp /opt/Xilinx/11.1/ISE/bin/lin/xusb*.hex /usr/share/
sudo /etc/init.d/udev restart

Other

sudo cp /opt/Xilinx/11.1/ISE/bin/lin/xusbdfwu.rules /etc/udev/rules.d/
sudo cp /opt/Xilinx/11.1/ISE/bin/lin/xusb*.hex /usr/share/
sudo /etc/init.d/udev restart

Fixing the Path

This step may not be required if the Xilinx install appends to your .bashrc automatically:
Running the following two lines will add the Xilinx path to the system path, and will ensure that the Xilinx binaries are accessable by the system.

32-bit

echo “PATH=\$PATH:/opt/Xilinx/11.1/ISE/bin/lin” >> ~/.bashrc
echo “export PATH” >> ~/.bashrc

64-bit

echo “PATH=\$PATH:/opt/Xilinx/11.1/ISE/bin/lin64” >> ~/.bashrc
echo “export PATH” >> ~/.bashrc

Some people reported that the 32-bit version didn’t work correctly on 64-bit host.
Ensure you are using the 64-bit version of the ISE software.
The 64-bit stuff is located in /opt/Xilinx/11.1/ISE/bin/lin64/

Running the programs

Before you can call any of the Xilinx ISE Suite, you must close the terminal you have open, and reopen a new one. This causes bash to reload, getting the new path variable. You can now run anything from the Xilinx ISE Suite. If you know the program you wish to run, for example, you can simply call it from a terminal window, like so:

user@box:~$ impact

All Done

Once you get to here, the cable drivers should work. When you plug the programmer in, you will notice that after a short while, the programmer’s status LED turns green. This indicates that the firmware was successfully loaded. If you open Xilinx’s iMPACT with the programmer connected to the computer and a circuit, you should be able to execute a boundary scan. The image below shows Xilinx iMPACT running under Linux Mint 7 (Gloria) with a Boundary Scan of my Spartan-3E board.

Xilinx iMPACT – GUI

It Working :D

Xilinx iMPACT – Log Window Text

This is the result of a boundary scan on my Spartan-3E board.

Welcome to iMPACT
iMPACT Version: 11.1
// *** BATCH CMD : setMode -bs
// *** BATCH CMD : setMode -bs
// *** BATCH CMD : setMode -bs
// *** BATCH CMD : setMode -bs
GUI — Auto connect to cable…
// *** BATCH CMD : setCable-port auto
AutoDetecting cable. Please wait.
PROGRESS_START – Starting Operation.
OS platform = i686.
Connecting to cable (Usb Port – USB21).
Checking cable driver.
File version of /opt/Xilinx/11.1/ISE/bin/lin/xusbdfwu.hex = 1030.
File version of /usr/share/xusbdfwu.hex = 1030.
Using libusb.
Max current requested during enumeration is 74 mA.
Type = 0x0004.
Cable Type = 3, Revision = 0.
Setting cable speed to 6 MHz.
Cable connection established.
Firmware version = 1028.
File version of /opt/Xilinx/11.1/ISE/data/xusb_xlp.hex = 1303.
Firmware hex file version = 1303.
Downloading /opt/Xilinx/11.1/ISE/data/xusb_xlp.hex.
Downloaded firmware version = 1303.
PLD file version = 0012h.
PLD version = 0012h.
PROGRESS_END – End Operation.
Elapsed time = 1 sec.
Attempting to identify devices in the boundary-scan chain configuration…
INFO:iMPACT – Current time: Thu Oct 8 18:50:31 2009
// *** BATCH CMD : Identify
PROGRESS_START – Starting Operation.
Identifying chain contents…’0′: : Manufacturer’s ID = Xilinx xc2c64a, Version : 0
INFO:iMPACT:1777 –
Reading /opt/Xilinx/11.1/ISE/xbr/data/xc2c64a.bsd…
INFO:iMPACT:501 – ‘1’: Added Device xc2c64a successfully.
———————————————————————-
———————————————————————-
‘1’: : Manufacturer’s ID = Xilinx xcf04s, Version : 15
INFO:iMPACT:1777 –
Reading /opt/Xilinx/11.1/ISE/xcf/data/xcf04s.bsd…
INFO:iMPACT:501 – ‘1’: Added Device xcf04s successfully.
———————————————————————-
———————————————————————-
‘2’: : Manufacturer’s ID = Xilinx xc3s500e, Version : 4
INFO:iMPACT:1777 –
Reading /opt/Xilinx/11.1/ISE/spartan3e/data/xc3s500e.bsd…
INFO:iMPACT:501 – ‘1’: Added Device xc3s500e successfully.
———————————————————————-
———————————————————————-
done.
PROGRESS_END – End Operation.
Elapsed time = 0 sec.
// *** BATCH CMD : identifyMPM

Linux Kernel

Below shows the the linux kernel reporting that it finds the device. Notice that it finds the device 3 times. It finds the chip with no firmware, then once it recognises it, it uploads firmware, and then it restarts. It finds the chip with the firmware, initilises it, and then restarts the chip. You should see this.

kernel: [690505.051492] usb 2-1: new high speed USB device using ehci_hcd and address 45
kernel: [690505.184191] usb 2-1: configuration #1 chosen from 1 choice
kernel: [690505.296118] usb 2-1: USB disconnect, address 45
kernel: [690507.251482] usb 7-1: new full speed USB device using uhci_hcd and address 2
kernel: [690507.393556] usb 7-1: not running at top speed; connect to a high speed hub
kernel: [690507.416882] usb 7-1: configuration #3 chosen from 1 choice
kernel: [690510.041561] usb 7-1: USB disconnect, address 2
kernel: [690511.800521] usb 2-1: new high speed USB device using ehci_hcd and address 47
kernel: [690511.931390] usb 2-1: configuration #2 chosen from 1 choice

The All-Telling Status LED

If you do it all correctly, once the kernel has settled, you should get the status led illuminated. This will either be the LED on the front of the JTAG box, or on the Spartan-3E board, the status LED next to the USB-B socket (shown with the red arrow).

Xilinx JTAG Programmer (SPARTAN-3E)

Troubleshooting

Thying to make a perfect guide for many different possible combinations is hard. Here is a section of things to try before you dispondantly email me.

Newer UDEV (Ubuntu 9.10/10.04)

Many people are reporting problems with the new UDEV system, usually the one used in Ubuntu 9.10. This problem is easily overcome by simply editing your udev rules. Using your favorite editor, edit /etc/udev/rules.d/xusbdfwu.rules and change any reference to $TEMPNODE to $tempnode. This is done automatically in the howto above. Remember to restart udev after this:

sudo /etc/init.d/udev restart

Impact 64-bit

If using the 64-bit version of Impact, there are some slight changes. Source 6 describes in more detail how to get the 64-bit version of Impact running, but simply all that needs to be done is:

cd /usr/lib64
sudo ln -s libusb-0.1.so.4 libusb.so

(I have not personally tested this)

Sources

    • [1] Using Xilinx USB cable on LinuxMint / Ubuntu without windvr

::(http://paddydempster.wordpress.com/2008/04/08/using-xilinx-usb-cable-on-ubuntu-without-windvr/)

::Taken on 19/Aug/2009 at 23:21 BST

    • [2] libusb/ppdev-connector for XILINX jtag tools

::(http://git.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver?a=blob;f=README;h=265dd3941b23edf68c967b3e3a627c1265f1caa3;hb=HEAD)

::Also included in /opt/Xilinx/usb-drivers/README
::Taken on 19/Aug/2009 at 23:28 BST

    • [3] udev ignoring rules? any help appreciated! ubuntu 9.10

::(http://ubuntuforums.org/showthread.php?t=1313572)

::Taken on 09/Nov/2009 at 01:11 GMT

    • [ubuntu How does USB work | Xilinx Spartan 3E driver problem

::(http://ubuntuforums.org/showthread.php?t=1307574&highlight=xilinx+ise+11.1)

::Taken on 09/Nov/2009 at 00:20 GMT
::Thanks to Mehmet Tukel, Teaching Assistant at Istanbul Technical University for this source.

    • [5] Xilinx USB programmer – problems with Debian/Linux – Solved

:: (http://groups.google.com/group/comp.arch.fpga/browse_thread/thread/2492e85c32938119/386d80ad26dbb974?lnk=gst&q=Wojtek#386d80ad26dbb974)

::Taken on 09/Nov/2009 at 00:41 GMT
::Thanks to Werner Hein for this source.

    • [6] ISE 11.2, Impact can’t find USB II cable, SLED 11 Linux 64 bit

::(http://forums.xilinx.com/xlnx/board/message?board.id=INSTALLBD&message.id=467&query.id=386680#M467)

::Taken on 13/Nov/2009 at 11:03 GMT
::Thanks to Jonathan Drolet for this source.

Updates

  • [29/Jul/2011] Added ia32-libs-dev to dependancies on 64-bit systems. (Thanks to Philipp Hörauf).
  • [05/Feb/2010] Adjusted the dependencies, seperating 32/64-bit hosts. (Thanks to Jerry G. for pointing this confusion out).
  • [15/Apr/2010] Added information for Ubuntu 10.04.

An online scrapbook full of half-baked projects and silly ideas.