Getting Started with PYNQ on Kria KV260 Vision AI Starter Kit

Kria KV260 Vision AI Starter Kit

Kria KV260 Vision AI Starter Kit is an out-of-the-box platform for vision AI applications. Apart from that, there is also a Kria KR260 Robotics Starter Kit variant specifically for robotic applications.

The following table contains a comparison of FPGA resources from Kria K26 with other FPGAs.

MicroSD Setup

Even though this board is called an "out-of-the-box" platform, unfortunately the Micro SD card you get has not been setup (pre-installed), so we have to setup it ourselves, unlike other boards, which are usually pre-installed.

Required programs:

How to write the image to a microSD card:

  1. Extract the file with WinRAR.

  2. Write the image file to the microSD card with the Win32DiskImager program.

    • Select Image File: iot-limerick-kria-classic-desktop-2204-x07-20230302-63.img

    • Select Device: adjust to the microSD device on your laptop or computer.

    • Select Write to write the image.

How to boot the board:

  1. Insert the microSD card into the Kria board, connect the micro USB cable to the PC, and connect the power supply.

  2. Open the PuTTY program and set up a serial connection. Select the appropriate COM port by looking at Device Manager (Windows).

    • Baud rate = 115200

    • Data bits = 8

    • Stop bits = 1

    • Flow control = None

    • Parity = None

  3. The default username and password are:

    • Username: ubuntu

    • Password: ubuntu

  4. Then you will be asked to enter a new password:

    • New password: xilinx_kria

Important

If you want to turn off the board, you should shutdown it; don't immediately remove the power supply. This is done to avoid corrupted microSD, which can cause boot failure.

How to turn off the board:

sudo shutdown -h now

Install PYNQ Framework

To use the PYNQ library, you need to install it first from GitHub.

  1. Connect the board to a router connected to the internet with dynamic IP (DHCP) (in this example, I use a 4G router via Ethernet). If you have to use a static IP, the method is in the next section.

  2. Clone PYNQ from GitHub, go to the folder, and then run the installation script.

git clone https://github.com/Xilinx/Kria-PYNQ.git
cd Kria-PYNQ/
sudo bash install.sh -b KV260
  1. Note: during the installation process, errors may occur due to an unstable internet connection. If this happens, you can restart the board (if needed) and repeat running the installation script.

  2. How to restart the board:

sudo reboot
  1. Wait until the PYNQ installation is completed.

Setup Static IP

If you want to connect to the board via Ethernet directly from the laptop, you need to set up a static IP.

  1. Run this command:

sudo nano /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
  1. Add this to the file:

network: {config: disabled}
  1. Change the IP setting from DHCP to static:

sudo nano /etc/netplan/50-cloud-init.yaml
  1. Add this to the file:

network:
    renderer: NetworkManager
    version: 2
    ethernets:
      eth0:
        dhcp4: no
        addresses: [192.168.2.1/20]
        nameservers:
          addresses: [8.8.8.8,8.8.4.4]
  1. Reboot the board:

sudo reboot
  1. Check your IP address:

ifconfig

Jupyter Notebook

After the board is connected to the PC either directly or using a router, we can log in to Jupyter Notebook via a web browser:

  • URL: 192.168.2.1:9090

  • Password: xilinx

Graphical User Interface

The Ubuntu 22.04 OS has a GUI feature, so we can connect an HDMI monitor, USB keyboard, and mouse to the board.

The Ubuntu 22.04 GUI appears on the monitor and the PuTTY console on the laptop.

The use of a monitor and keyboard is optional. For PYNQ development in this tutorial, a monitor and keyboard are not actually needed.

We replaced it with a PuTTY terminal via serial and a network connection with Ethernet to open Jupyter Notebook and transfer files with FileZilla.

Download and Upload File

To upload files, such as bitstreams, from the laptop to the board, you can use FileZilla via the Ethernet connection on the board.

Required programs:

The connections required are:

  • Host: 192.168.2.1

  • Username: ubuntu

  • Password: xilinx_kria

  • Port: 22

Vivado Installation

Important

The version of Vivado that can be used for the Kria board is version 2021.1 or later. Because in the previous version, the board library was not available.

Several things you need to pay attention to when installing and using Vivado:

  • Do not install Vivado in a folder or sub-folder that has space. Because usually there will be errors during the synthesis process.

  • Don't create Vivado projects in folders such as: Users folder in C:, Program Files folder, or system folders that are protected or read only because usually there will be errors during the synthesis process.

Select Vitis during installation. These options include Vivado.

Just choose the device you need, for example Zynq-7000 (Zybo) or Zynq Ultrascale MPSoC (Kria), so it doesn't take up HDD/SSD space.

Continue installation until complete.

References

Last updated