Recently I went to image a new SD card with the official Ubuntu image for Xilinx to use on my Kria KV260 and I hit a few snags that I felt would be worth documenting here. To summarize: I'm walking through imaging a new SD card with the official Ubuntu image for Xilinx devices, updating the boot binary on the Kria, prepping the Ubuntu environment specifically for Xilinx, then installing Pynq.
Prep SD Card with Ubuntu ImageDownload the official Ubuntu image for the Kria KV260 and image it onto an SD card using an application such as balenaEtcher.
Then insert the SD card into the slot on the Kria KV260.
Update Boot Binary on KriaThere have been some major upgrades to the boot binary for the Kria KV260 to support Ubuntu 20.04 desktop, I recommend using the Ethernet recovery tool as outlined in UG1089. Find the latest version of the Kria boot binary here. At the time of this writing, I'm using KV260 2021.1 Boot FW Update 2 (2021.2_update2_BOOT.BIN).
Start by connecting the Kria KV260 directly to a host PC via Ethernet and configuring the network connection. The Ethernet recovery tool is configured with a static IP address of 192.168.0.111 so configure the host PC with the following settings:
- IPv4 address: 192.168.0.x (anything from 2 - 255, but not 111)
- Subnet mask: 255.255.255.0
- Gateway/router: 192.168.0.1
Once the network settings are configured on the host PC, power cycle the KV260 while holding down the FWUEN (SW1) button. This will boot the Kria into recovery mode. The USB UART will confirm the Kria has been booted into recovery mode and print instructions for you to connect to IP 192.168.0.111 from a browser window on the host PC.
Note: Only FireFox and Google Chrome are supported with the latest versions of the Ethernet recover tool and boot binary image.
Upload the new boot binary (2021.1_update2_BOOT.BIN) to side A of the QSPI flash memory (Image A).
Once the recovery tool indicates that the new boot binary has been successfully update Image A, power cycle the KV260 by pressing the reset button (SW2).
Again, the USB UART will confirm the flash memory has been updated:
I found that the desktop image seemed to be laggy and gnome-shell was crashing quite a bit. I then noticed in the Xilinx documentation for Ubuntu that display resolutions above 1080 weren't recommended. So once I changed the resolution in Ubuntu display settings to 1280x720, all lag and gnome crashes stopped.
Install the Xilinx system management snap package and run the Xilinx environment setup script for Ubuntu:
ubuntu@kria:~$ sudo snap install xlnx-config --classic
ubuntu@kria:~$ xlnx-config.sysinit
Select Y when prompted to execute the setup.
IMPORTANT: Upon booting the Kria for the first time with Ubuntu 20.04, do not run sudo apt update or sudo apt upgrade until AFTER running the Xilinx environment setup script and installing Pynq. This seems to be an issue unique to the current release of the official Xilinx Ubuntu 20.04 image and Pynq versions at the time I am writing this.
Install PynqI found that Pynq is a handy tool for rapid prototyping of HLS and accelerated IP designs, and since there is a bug that makes it conflict with something on the backend of sudo apt upgrade/update, it's the first thing that needs to be installed before anything else is done.
Clone the Xilinx Pynq repository:
ubuntu@kria:~$ git clone https://github.com/Xilinx/Kria-PYNQ.git
Then change directories into the cloned repository and run the install script:
ubuntu@kria:~$ cd ./Kria-PYNQ
ubuntu@kria:~$ sudo bash install.sh
Then connect to Jupyter in a browser window to test that Pynq installed properly:
Check out my other recent project posts like this one to see how I'm using Pynq for IP development on the Kria KV260.
Comments