Changes

initial page creation
[[File:MicroNova_Mercury_2_Stock_Photo_Front.jpg|thumb|MicroNova Mercury 2 (front)]]

[[File:MicroNova_Mercury_2_Stock_Photo_Back.jpg|thumb|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 ==

Xilinx Vivado

[https://www.micro-nova.com/mercury2-getting-started-guide Getting Started Guide - Mercury 2 — MicroNova]

== Bitstream Loader ==

[https://www.micro-nova.com/mercury2-programmer Mercury 2 Programmer — MicroNova]

[https://github.com/micro-nova/mercury2_prog 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:

<pre>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</pre>

Place the following inside of the script:

<pre>#!/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</pre>

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

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

<pre>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"</pre>

Script taken from Stack Exchange answer:

[https://unix.stackexchange.com/questions/305439/blacklisting-removing-driver-for-a-particular-vid-pid/319398#319398 linux - Blacklisting / Removing driver for a particular VID/PID - Unix & Linux Stack Exchange]

== Online Resources ==

[https://www.micro-nova.com/mercury-2 Mercury 2 - Xilinx Artix-7 FPGA development board — MicroNova]

[https://www.micro-nova.com/resources-mercury-2 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