Skip to content

Instantly share code, notes, and snippets.

@makestuff
Last active December 28, 2015 00:48
Show Gist options
  • Save makestuff/7415578 to your computer and use it in GitHub Desktop.
Save makestuff/7415578 to your computer and use it in GitHub Desktop.
Running blinky demo on Spartan-3AN
First, add these two lines to /etc/udev/rules.d/10-local.rules (create the file if it doesn't
already exist):
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="03eb", ATTR{idProduct}=="2ffa", GROUP="users", MODE="0660"
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1d50", ATTR{idProduct}=="602b", GROUP="users", MODE="0660"
...so you can talk to the relevant USB devices without sudo. Then connect your JTAG port to
your Minimus (TDO->PB3, TDI->PB2, TCK->PB1, TMS->PB0, +3.3V->VCC and GND->GND - keep the
connections short), and power up the board. No need to connect the USB cable to the FPGA board,
just the Minimus.
$ # Make sure you have your Xilinx ISE distribution added to ${PATH}:
$ echo $PATH | tr ':' '\n' | grep Xilinx
/opt/Xilinx/14.1/ISE_DS/ISE/bin/lin
$ which xst
/opt/Xilinx/14.1/ISE_DS/ISE/bin/lin/xst
$ # Make sure you've got the pre-requisites:
$ sudo apt-get install libusb-1.0-0-dev libreadline-dev dfu-programmer
$ # Fetch the proper firmware:
$ wget -q https://gist.github.com/makestuff/7414980/raw/408d24c3ef34e6f1ffcbe9936e47ac72bafa204e/minimus16.hex
$ # Put the Minimus in DFU mode (press HWB, press RESET, release HWB, release RESET), and:
$ dfu-programmer at90usb162 erase
$ dfu-programmer at90usb162 flash minimus16.hex
$ dfu-programmer at90usb162 reset
$ dfu-programmer at90usb162 reset
$ # Now fetch & build the tools and the "blinky" demo:
$ mkdir $HOME/20131101
$ cd $HOME/20131101
$ wget -qO- http://www.swaton.ukfsn.org/bin/makestuff-lindar-20130829.tar.gz | tar zxf -
$ cd makestuff/apps
$ ../scripts/msget.sh makestuff/flcli/20131101
$ cd flcli
$ make deps
$ cd ../..
$ scripts/msget.sh makestuff/hdlmake
$ echo dev > hdlmake/.branch
$ cd hdlmake/apps
$ ../bin/hdlmake.py -g makestuff/blinky
$ cd makestuff/blinky/vhdl
$ ../../../../bin/hdlmake.py -t ../templates/null -b s3an-kit -p fpga
$ # Now query the JTAG-chain:
$ $HOME/20131101/makestuff/apps/flcli/lin.x64/rel/flcli -v 1D50:602B -q B3B2B0B1
Attempting to open connection to FPGALink device 1D50:602B...
The FPGALink device at 1D50:602B scanned its JTAG chain, yielding:
0x01414093 <- You'll get something different here
0x05045093 <- But there should nonetheless be TWO IDs found
$ # And finally program the FPGA:
$ $HOME/20131101/makestuff/apps/flcli/lin.x86/rel/flcli -v 1D50:602B -p J:B3B2B0B1:fpga.xsvf
At this point you should see the LEDs on your board blinking slowly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment