Avnet Ultra96-V2
- Introduction
- Required Bill-of-Materials
- Hardware set-up
- Serial communication with the Ultra96-V2
- Adding support for Ultra96-V2 board in Vivado
Introduction
For this course on Xilinx Zynq UltraScale+ MPSoC development, we have selected the Avnet Ultra96-V2 platform as the reference development kit. There are several advantages in using this platform for an introductory course, enabling the potential reach to a wider audience:
- The Avnet Ultra96-V2 is powered by a Xilinx ZU3EG device that contains a fully featured processing system (PS) and a smaller programmable logic (PL) supported by free Xilinx development licenses.
- The Avnet Ultra96-V2 is one of the cheapest development kits based on the Xilinx Zynq UltraScale+ MPSoC devices, which makes it the ideal choice for both hobbyist and enterprise level courses.
- The Avnet Ultra96-V2 follows the 96 Boards standard promoted by Linaro for advanced ARM based platforms, so it supports a huge range of commercially available mezzanine and expansion cards.
Required Bill-of-Materials
In addition to a properly configured development host machine, you need the following Ultra96-V2 based BOM from Farnell, an Avnet company:
- FARNELL ref 3050481: Ultra96-V2 Zynq UltraScale+ ZU3EG Single Board Computer
- FARNELL ref 3216978: Ultra96 Power Supply Kit, 12V, 4A 03AH7039
- FARNELL ref 2915522: Adapter Board, USB To JTAG/UART Adapter Module, For Ultra96 Development Board
- FARNELL ref 1617586: USB cable type A to micro type B, 1.5m, USB 2.0
Ultra96-V2 SBC package contents
In the Ultra96-V2 SBC package we must find four different components:
- The Ultra96-V2 SBC itself in an antistatic bag.
- An empty 16GB microSD plus a SD adapter, that we will need to program as explained later.
- A Getting Started basic documentation brochure.
- A device-locked voucher for the Xilinx SDSoC development tool (note that this is not actually required, as SDSoC has been superseded by Vitis).
USB to JTAG/UART adapter package contents
In the USB to JTAG/UART adapter package we must find two different components:
- The USB to JTAG/UART adapter card itself in an antistatic bag.
- A Getting Started basic documentation brochure.
Power supply kit package contents
In the power supply package kit we must find five different components:
- The AC/DC power supply with a connection compatible with the Ultra96 power jack.
- 4x different power plug cables to match different electrical outlets in several countries.
Hardware set-up
In this section, we will provide an step-by-step guide on how assembly the hardware set-up required for the course.
Connecting the USB to JTAG/UART adapter
In first place, we need to take the Ultra96-V2 and the USB to JTAG/UART adapter out of the antistatic bag and align them as shown in the picture. You can check that the adapter has two female pin strips that matches with the male UART and JTAG ones in the Ultra96-V2 board:
Now, we need to carefully insert the JTAG and UART pin strips without forcing them:
Note that each of the connectors lay in different sides of the PCBs, so attaching them may be a little bit tricky. This procedure is specially hard for the JTAG connection, as this connector is placed just between the Ultra96-V2 PCB and its heatsink:
Connecting the power supply
After selecting the appropriated power cord for our country and inserting it in the AC/DC power adapter, we can insert the barrel connector in the Ultra96-V2 power jack:
Programming and inserting the microSD
The 16GB microSD card supplied by Avnet is empty, so we will need to program it before we can use the Ultra96-V2 for the first time.
In order to do that, we will download the Ultra96-V2 OOB (Out-Of-the-Box) microSD image provided by Avnet, a full-featured embedded Linux runtime created with the Xilinx Petalinux tools. We can download it from:
Once the download has finished, this is the file we get:
- ultra96v2_oob_2018_3_190917_8GB.zip
Now we need to unzip it to get its actual contents:
unzip ultra96v2_oob_2018_3_190917_8GB.zip
After decompressing, we get these files:
- ultra96v2_oob_2018_3_190917_8GB.img: the actual OOB image we want to transfer to the microSD.
- Ultra96v2_Factory_Image_Write_190611.pdf: instructions on how to create the microSD from the OOB image by using the balena Etcher tool.
As we are using Linux, we can alternatively create the microSD by just using the dd command line tool.
First, we introduce the microSD in the SD adapter and insert it in our host development machine. Once done, we need to identify which device the microSD is in Linux. For that purpose, we can use the dmesg command, e.g.:
dmesg
[...]
[ 1107.127824] mmc0: cannot verify signal voltage switch
[ 1107.303205] mmc0: new ultra high speed SDR104 SDHC card at address 5048
[ 1107.311876] mmcblk0: mmc0:5048 DDINC 14.9 GiB
[ 1107.312976] mmcblk0: p1
So, in this machine, the microSD is identified as the device mmcblk0 (it may be different in your system). Now, we need to unmount the partitions in the microSD:
sudo umount /dev/mmcblk0*
Once done, we can copy the image to the microSD with the following command:
sudo dd if=ultra96v2_oob_2018_3_190917_8GB.img of=/dev/mmcblk0 ; sync
Once the process has finished, we can reinsert the microSD in the development host and check that two partitions have been created:
- boot (FAT32): bootloader and Kernel for the embedded Linux image.
- root (EXT4): root filesystem for the embedded Linux image.
Finally, we can unmount the microSD and introduce it in the Ultra96-V2 for its future use. In the image below, you can check that the boot mode switch is configured to SD:
Boot mode selection
The Ultra96-V2 is able to boot from SD or JTAG. In order to configure the boot mode, we need to configure Switch 3 (SW3) accordingly:
SW3 | 1 | 2 |
---|---|---|
JTAG | ON | ON |
SD | OFF | ON |
In this start-up test we need to configure the Ultra96-V2 to boot from SD.
Connecting the USB cable
We need to take the USB cable and insert the micro type B male side into the female micro USB socket in the JTAG/UART adapter card:
Complete system overview
Finally, the final steps for completing the hardware setup are:
- Plug the power cord in the supply adapter kit to a wall outlet.
- Attach the USB cable A male side from the JTAG/UART adapter to an USB port in the development machine.
Once done, our development system set-up is complete and it should looks like this:
Serial communication with the Ultra96-V2
In order to check that our Ultra96-V2 set-up is working properly, we will use a UART based serial connection to see in the development host terminal the boot log from the Ultra96-V2 Operating System we have deployed in the microSD.
In Ubuntu and most of the Linux distributions, with no additional driver installation required, the USB to JTAG/UART adapter works out of the box and you should see the following new devices:
/dev/ttyUSB0 # JTAG Interface in Ultra96-V2
/dev/ttyUSB1 # UART Interface in Ultra96-V2
If we don't want to require user privileges to access these ttyUSB devices, we need to add our development user to the dialout group, e.g. (change jgarcia to your user name!):
sudo adduser jgarcia dialout
After doing this, you we need to completely logout and login again to apply the changes (a reboot may be required).
In order to communicate with the UART interface in the Ultra96-V2, we will need a serial communications program. There are multiple choices here, but a very robust option is the terminal application minicom.
In Ubuntu or Debian based distributions, you can install minicom with this command:
sudo apt-get install minicom
Once this is installed, we can configure the minicom connection with this command:
sudo minicom -s
The proper UART configuration for connecting with the Ultra96-V2 board by using minicom is the following (this configuration parameters must be used with other serial communication programs too):
+-----------------------------------------------------------------------+
| A - Serial Device : /dev/ttyUSB1 |
| B - Lockfile Location : /var/lock |
| C - Callin Program : |
| D - Callout Program : |
| E - Bps/Par/Bits : 115200 8N1 |
| F - Hardware Flow Control : No |
| G - Software Flow Control : No |
| |
| Change which setting? |
+-----------------------------------------------------------------------+
After we have properly configured the connection, we can save it as the default configuration and exit the program.
From now onward, once the configuration has been stored, we can use minicom without superuser privileges with the following command:
minicom
Once we have properly configured and established our connection, we can just push the power button (PWR_BTN) in the Ultra96-V2 and we will see that the LEDs in the board start to blink and that our terminal program captures the output coming from the Linux Operating System in the microSD while booting.
NOTE: be sure that the boot mode is configured to SD.
If we want to login in the embedded Linux from our terminal, we can use the default user at the prompt:
- User: root
- Password: root
Adding support for Ultra96-V2 board in Vivado
Board Definitions Files
In order to work with different boards easily, Vivado includes a collection of Board Definition Files (BDF) that serves as templates and wizards when creating new design projects.
This collection includes all of the official Zynq UltraScale+ MPSoC based kits from Xilinx, but the Ultra96-V2 is not included by default as it's a product from Avnet. You can check the supported boards by checking this folder in the Vivado toolchain (we assume that the tools have been installed in the default location; modify the path accordingly if this is not the case):
/tools/Xilinx/Vivado/2019.2/data/boards/board_files
Fortunately, Avnet provides a Github repository that contains all of the Board Definition Files for its own brand platforms:
In this way, in order to provide support for the Ultra96-V2 board in Vivado, as a first step we must clone the Avnet's BDF repository:
git clone https://github.com/Avnet/bdf.git
Now, all we need to do is copying the Ultra96-V2 specific BDF files to the board_files folder in Vivado:
sudo cp -r bdf/ultra96v2 /tools/Xilinx/Vivado/2019.2/data/boards/board_files
Once this is done, the next time we create a project in Vivado we will be able to select Ultra96-V2 as a template board for our design.
JTAG udev rules
The Ultra96-V2 USB to JTAG/UART adapter is programmed whit the necessary firmware to allow Vivado to make use of the JTAG. In any case, it may be required to add the Linux udev rules to make the host machine to actually recognize the adapter when plugged to a USB port.
In order to be sure your machine will recognize the JTAG functionality, run the following script included in the Vivado installation to update your udev rules:
cd /tools/Xilinx/Vivado/2019.2/data/xicom/cable_drivers/lin64/install_script/install_drivers
sudo ./install_drivers
Once done, you need to reboot your system or, alternatively, reload the rules and rearm udev with the following commands:
sudo udevadm control --reload-rules
sudo udevadm trigger