Xilinx USB Cable on Ubuntu

Here’s what I did to install the "Xilinx Platform Cable USB II" on Ubuntu.

First, install the following two packages:

$ sudo aptitude install fxload libusb-dev

Then, download and compile the USB driver for the cable:

$ git clone git://git.zerfleddert.de/usb-driver
$ cd usb-driver
$ make
$ make lib32
$ ./setup_pcusb /opt/Xilinx/14.5/ISE_DS/ISE

If everything worked, you should see the status LED on the programmer light up after it’s plugged in.

Programming Avnet Spartan 3A FPGA Eval Board with Linux

I own a small FPGA Board by Avnet with a Spartan 3A FPGA on it. The board is nice, but unfortunately, the flash chips on the board aren’t on the JTAG chain. Instead, there is a small PSoC microcontroller that lets you programm the flashes via UART. There is a Windows tool to perform that programming which is shipped with the board. Here’s what I did to program the SPI configuration flash on Linux.

Via the FPGALibre site, I found a link to a tool called ASTriAEKiPro, which allows me to write to the FPGA SPI Configuration flash via UART and the PSoC microcontroller.

Compiling the tool is as simple as running this command:

$ make

To erase the SPI configuration flash, I used this command:

$ ./astriaekipro -p /dev/ttyACM0 -e
Avnet Spartan 3A Eval Kit Programmer v1.2.1
Copyright (c) 2009 Salvador E. Tropea 
Copyright (c) 2009 Instituto Nacional de Tecnolog�a Industrial
Embedded BPI server provided by Avnet Inc. http://www.em.avnet.com/

Erasing the memory, be patient (>1 minute) ...

To write a configuration to the SPI flash:

$ ./astriaekipro -p /dev/ttyACM0 -w 
  -b ~/sandbox/avnet_lpc/projects/13.3/avnet_lpc/avnet_i2c.bit 
Avnet Spartan 3A Eval Kit Programmer v1.2.1
Copyright (c) 2009 Salvador E. Tropea 
Copyright (c) 2009 Instituto Nacional de Tecnolog�a Industrial
Embedded BPI server provided by Avnet Inc. http://www.em.avnet.com/

Writing 235820 bytes to the serial flash, offset 0x0000000
Erasing: sector   3 (100.00 %)
Bytes written:   235820 (100.00 %)
All written!

Avnet Spartan-3A Eval Board

So I got this Xilinx Spartan-3A Board by Avnet recently. I bought it because it features a fairly large parallel flash chip (32 MBit) and an even larger SPI flash (128 Mbit).

The board also features three clocks. One 16MHz clock is driven by an on-board oscillator while the other two (12 MHz and 32 kHz) are derived from a small controller.

For the last few evenings, I tried to get the parallel flash to work. Since a single cycle of the slow 32 kHz clock meets the timing requirements of the parallel flash chip, I thought I’d try to use that before enhancing the design to also work w/ the faster clock(s).

Unfortunately, that didn’t work. When using the slow clock, mapping a signal directly to an output (LED) worked just fine, but routing the signal through more than few flip-flops didn’t work at all. Apparently, the FPGA didn’t like the slow clock too much.

Bottom line: Took me three days to figure out that the board doesn’t work with the slow 32 kHz clock. Oh well, at least I learned something new…