Setting Up FPGA Boards

This page is intended for people setting up or maintaining the VLAB infrastructure, and is not relevant for general VLAB users.

Setting Serial Numbers

The VLAB uses serial numbers of JTAG and UART devices (through udev) to identify a board. This requires each board to have a unique serial number, and for the UART and JTAG serials to match.

Setting Digilent JTAG serial (FTDI chip)

The serial number of Digilent JTAG devices (present on most 7-series Xilinx FPGA boards) can be set using dadutil, the Digilent Adept command line utility, available from https://reference.digilentinc.com/reference/software/adept/start.

Once installed, the utility can set the user name and serial number of the device, which will also change that seen by udev for the FTDI chip. For boards that have a combined UART and JTAG interface (e.g. the Zybo), this will set the serial for both.

The board user name is not used for the VLAB, but it is useful to set at the same time as the serial number so the board can be identified.

It is generally good practice to use only the end four characters of the serial and pad the rest with zeroes, as some other devices (such as the CP210x UART) only allow four characters in total (the VLAB udev scripts will zero-pad this to twelve).

The following example sets the user name and serial number of a device (currently JtagSmt2 and 000000000001) to zc706-abcd and 00000000abcd respectively. Note that the dadutil enum command will display all connected Digilent devices.

$ dadutil enum
Device: JtagSmt2
    Product Name:   Digilent JTAG-SMT2
    User Name:      JtagSmt2
    Serial Number:  000000000001

$ dadutil setusr --usr zc706-abcd -d JtagSmt2
 
$ dadutil enum
Device: zc706-abcd
    Product Name:   Digilent JTAG-SMT2
    User Name:      zc706-abcd
    Serial Number:  000000000001
$ dadutil setsn --sn 00000000abcd -d zc706-abcd

$ dadutil enum
Device: zc706-abcd
    Product Name:   Digilent JTAG-SMT2
    User Name:      zc706-abcd
    Serial Number:  00000000abcd

Setting CP210x UART serial

The serial number of CP210x UART chips (present on most 7-series Xilinx FPGA boards) can be set using the Silicon Labs Interface Software Development Kit, available from http://www.silabs.com/products/development-tools/software/interface.

On Linux, the required tools are in USBXpressHostSDK/CP210x/bin/x86_64 once the archive is extracted. The libraries folder at USBXpressHostSDK/CP210x/lib must be added to LD_LIBRARY_PATH in order to run the tools.

Before programming, a config file must be created to match the part number and VID and PID of the chip. For the CP2103 devices used on Xilinx boards, these are as follows:

config.txt
FilterPartNumByte { { 03 } }
FilterVidPid { { 10c4 } { ea60 } }

Devices can be listed using cp210xsmt --list as follows, showing one device with serial number 0001:

$ sudo LD_LIBRARY_PATH=../../lib ./cp210xsmt --list config.txt
--- devices --------------
VID: 10c4 PID: ea60 Prod Str: CP2103 USB to UART Bridge Controller Ser #: 0001
--------------------------

Serial numbers can then be programmed as follows, which will set the serial to abcd. This command can be modified for multiple devices using a comma-separated list if required.

sudo LD_LIBRARY_PATH=../../lib ./cp210xsmt --device-count 1 --set-and-verify-config config.txt --serial-nums \{ abcd \}