MicroNova Mercury 2 FPGA Development Board

From CNC Wiki
Jump to navigation Jump to search
MicroNova Mercury 2 (front)
MicroNova Mercury 2 (back)

Overview

Xilinx Artix-7 FPGA development board. It can be programmed over USB with an on-board FTDI chip and a custom open source programming utility.

Design Software

Bitstreams are generated using Xilinx Vivado (the successor of Xilinx ISE).

Getting Started Guide - Mercury 2 — MicroNova

Bitstream Loader

Mercury 2 Programmer — MicroNova

micro-nova/mercury2_prog: Programmer app for the Mercury 2 FPGA board using FT2232H | GitHub

Linux

On Linux, the default VCP (Virtual COM Port) driver will try and bind to the FTDI device. This causes issues, since the mercury2_prog utility is built with FTDI's "D2xx" library, which in turn uses libusb1.0 to low level manipulate the device. The device must be unbound (not in use) by any other drivers for this to work. The device must also have permissions set for it to work as a normal user (non-root). To solve this, a script to unbind the device must be created, and a udev rule added to set permissions and invoke the script.

Create (or edit) the script and set it as executable:

sudo mkdir -p /etc/udev/scripts
sudo touch /etc/udev/scripts/unbind_ftdi.sh
sudo chmod a+x /etc/udev/scripts/unbind_ftdi.sh
sudo nano -w /etc/udev/scripts/unbind_ftdi.sh

Place the following inside of the script:

#!/bin/sh

# traverse sysfs to find the USB ID
# of the USB device which is parent/ancestor of ttyUSB*
# something like "1-1.6:1.0"
TTYDEV=$(basename $DEVNAME)
BOUND_DEVICES=/sys/bus/usb/drivers/ftdi_sio/*/
for DEVICE in ${BOUND_DEVICES}; do
    if [ -e $DEVICE/$TTYDEV ]; then
        USBID=$(basename $DEVICE)
        break
    fi
done

echo "$USBID" > /sys/bus/usb/drivers/ftdi_sio/unbind

Then save the file by pressing CTRL+O to output the file to disk, ENTER to confirm the filename, and then CTRL+X to quit nano.

Now create a udev rule file /etc/udev/rules.d/99-mercury2.rules with the following contents:

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="0403", ATTR{idProduct}=="6010", MODE="0666"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", KERNEL=="ttyUSB*" RUN+="/etc/udev/scripts/unbind_ftdi.sh"

Script taken from Stack Exchange answer:

linux - Blacklisting / Removing driver for a particular VID/PID - Unix & Linux Stack Exchange

Online Resources

Mercury 2 - Xilinx Artix-7 FPGA development board — MicroNova

Resources - Mercury 2 — MicroNova

https://www.micro-nova.com/s/Mercury2_reference_manual.pdf

https://www.micro-nova.com/s/mercury2xdc.zip

https://www.micro-nova.com/s/Mercury2_schematic.pdf