In this tutorial series, we embark on an exciting journey into the world of Xilinx's KRIA Robotics platform, aligning our objectives with the needs of the DUNE (Deep Underground Neutrino Experiment). As part of the DUNE initiative, we aim to empower the groundbreaking experiment by setting up essential tools - Vivado, Vitis, and Petalinux - on an Ubuntu virtual machine.
You can follow the following tutorial for this process.
Installation of Linux Virtual MachineIn our installation process, we will use a Ubuntu virtual machine running on Windows.
For this, we will utilize VirtualBox 6, and we'll install Ubuntu 20.04.5 LTS from the official Linux page. You should follow some YouTube tutorials to properly configure the virtual machine:
Please use the command script located in /commands.sh
.
sed -i -e 's/\r$//' commands.sh
./commands.sh
Necessary configurations for Ubuntu 22.04 LTSBased on the following Tutorial:
For Ubuntu 22.04 LTS, it's necessary to perform the following preliminary configurations to prepare the operating system for Vivado and Vitis:
Start by enabling the 32-bit architecture in the system and setting the shell to bash (by default, it's configured to dash on a fresh install of Ubuntu):
sudo dpkg --add-architecture i386
sudo dpkg-reconfigure dash
Next, install the following package dependencies. They are presented here in an optimal copy+paste order:
~$ sudo apt-get install iproute2 make libncurses5-dev tftpd libselinux1 wget diffstat chrpath socat tar unzip gzip tofrodos
~$ sudo apt-get install debianutils iputils-ping libegl1-mesa libsdl1.2-dev pylint python3 python2 cpio tftpd gnupg zlib1g:i386 haveged perl
~$ sudo apt-get install lib32stdc++6 libgtk2.0-0:i386 libfontconfig1:i386 libx11-6:i386 libxext6:i386 libxrender1:i386 libsm6:i386
~$ sudo apt-get install xinetd gawk gcc net-tools ncurses-dev openssl libssl-dev flex bison xterm autoconf libtool texinfo zlib1g-dev
~$ sudo apt-get install gcc-multilib build-essential automake screen putty pax g++ python3-pip xz-utils python3-git python3-jinja2 python3-pexpect
~$ sudo apt-get install liberror-perl mtd-utils xtrans-dev libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev
~$ sudo apt-get install openssh-server util-linux sysvinit-utils google-perftools
~$ sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev libncurses5:i386 libtinfo5
~$ sudo apt-get install libstdc++6:i386 libgtk2.0-0:i386 dpkg-dev:i386
~$ sudo apt-get install ocl-icd-libopencl1 opencl-headers ocl-icd-opencl-dev
Package InstallationFirst, execute the following Linux commands to ensure stability during the installation of Xilinx software:
sudo apt-get install libtinfo5
sudo apt install libncurse
Additionally, as stated in the tutorial, it's necessary to install some Linux packages for Petalinux compilation:
sudo apt-get install lib32stdc++6
sudo apt-get install libgtk2.0-0:i386
sudo apt-get install libfontconfig1:i386
sudo apt-get install libx11-6:i386
sudo apt-get install libxext6:i386
sudo apt-get install libxrender1:i386
sudo apt-get install libsm6:i386
sudo apt-get install libqtgui4:i386
sudo apt-get install xinetd
sudo apt-get install iproute2
sudo apt-get install gawk
sudo apt-get install gcc
sudo apt-get install net-tools
sudo apt-get install ncurses-dev
sudo apt-get install openssl
sudo apt-get install libssl-dev
sudo apt-get install flex
sudo apt-get install bison
sudo apt-get install xterm
sudo apt-get install autoconf
sudo apt-get install libtool
sudo apt-get install texinfo
sudo apt-get install zlib1g-dev
sudo apt-get install gcc-multilib
sudo apt-get install build-essential
sudo apt-get install automake
sudo apt-get install screen
sudo apt-get install putty
sudo apt-get install pax
sudo apt-get install g++
sudo apt-get install python3-pip
sudo apt-get install xz-utils
sudo apt-get install python3-git
sudo apt-get install python3-jinja2
sudo apt-get install python3-pexpect
sudo apt-get install debianutils
sudo apt-get install iputils-ping
sudo apt-get install libegl1-mesa
sudo apt-get install libsdl1.2-dev
sudo apt-get install pylint3
sudo apt-get install python3
sudo apt-get install cpio
sudo apt-get install tftpd-hpa
sudo apt-get install gnupg
sudo apt-get install zlib1g:i386
sudo apt-get install haveged
sudo apt-get install perl
sudo apt-get install liberror-perl
sudo apt-get install mtd-utils
sudo apt-get install xtrans-dev
sudo apt-get install libxcb-randr0-dev
sudo apt-get install libxcb-xtest0-dev
sudo apt-get install libxcb-xinerama0-dev
sudo apt-get install libxcb-shape0-dev
sudo apt-get install libxcb-xkb-dev
sudo apt-get install openssh-server
sudo apt-get install util-linux
sudo apt-get install sysvinit-utils
sudo apt-get install cython
sudo apt-get install google-perftools
Creating the TFTP ServerPetaLinux requires a TFTP server service to support TFTP booting on a target system. In the /etc/xinetd.d/
directory, create a TFTP service file:
~$ sudo nano /etc/xinetd.d/tftp
Configure it as follows
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}
Then create the directory for the TFTP service to pull files from during the target boot process, such as the boot image file (BOOT.bin), kernel, device tree, etc. Provide the directory with the appropriate permissions and give ownership to the same user specified in the TFTP service.
sudo mkdir /tftpboot
sudo chmod -R 777 /tftpboot
sudo chown -R nobody /tftpboot
Stop and restart the host machine's extended internet services for these changes to take effect.
sudo /etc/init.d/xinetd stop
sudo /etc/init.d/xinetd start
Vivado and Vitis InstallationDownload the software from the Xilinx download center, specifically the Xilinx Unified Installer 2022.2: Linux Self Extracting Web Installer. Then, to run the installer, execute the following command in a terminal:
sudo chmod 777 ./Downloads/Xilinx_Unified_2022.2_1014_8888_Lin64.bin
sudo bash /Downloads/Xilinx_Unified_2022.2_1014_8888_Lin64.bin
Select the necessary packages for installation.
Once Vitis and Vivado are installed, they can be served and executed.
To run Vivado, execute the following commands:
source /tools/Xilinx/Vivado/2021.2/settings64.sh
vivado
For executing Vitis, use the following commands:
source /tools/Xilinx/Vitis/2021.2/settings64.sh
vitis
These commands will initialize the necessary environment variables and launch the respective software tools.
Installation of Xilinx programmer cable drivers:Navigate to the directory containing the cable drivers installation script:
cd /tools/Xilinx/Vivado/2022.2/data/xicom/cable_drivers/lin64/install_script/install_drivers/
Run the installation script for the drivers, ensuring there are no Xilinx programmer cables connected to the host machine before executing the command:
sudo ./install_drivers
Executing these commands will install the necessary drivers for Xilinx programmer cables. Remember to disconnect any Xilinx programmer cables connected to the host machine before initiating the installation process.
Petalinux InstallationYou can use the Vivado installer to download the Petalinux image or download the Petalinux installer from the official Xilinx page at this link:
You can install PetaLinux wherever you prefer, but I prefer to keep all Xilinx tools in the same place. Thus, I create a PetaLinux directory in the same location where Vivado and Vitis are installed, following the version format.Give the directory 755 permissions to ensure it's globally readable and executable:
sudo chmod -R 755 /tools/Xilinx/PetaLinux/2022.2/
Grant the PetaLinux installer 777 permissions:
sudo chmod 777 ./tools/Xilinx/PetaLinux/2022.2/bin/petalinux-v2022.2-final-installer.run
Change the ownership of the directory where you're installing PetaLinux to the user:
sudo chown -R <user>:<user> /tools/Xilinx/PetaLinux/2022.2/
Run the PetaLinux installer:
cd /tools/Xilinx/PetaLinux/2022.2/bin/
./petalinux-v2022.2-final-installer.run -d /tools/Xilinx/PetaLinux/2022.2
After installation, test it by enabling or disabling Webtalk:
source /tools/Xilinx/PetaLinux/2021.2/settings.sh
petalinux-util --webtalk off
petalinux-util --webtalk on
Note that building a PetaLinux project offline requires downloading the necessary repositories locally and configuring the PetaLinux project to access them. I'll cover this process in a different post. This configuration needs to be done for each PetaLinux project you intend to build offline.
Downloading BSP Support for Kria SOM and KR260You can download this support from the official Xilinx page:
- Kria K26 SOM BSP Download Link
- Kria KV260 Starter Kit BSP Download Link
- Kria KR260 Starter Kit BSP Download Link
Note: Exercise caution with versions. If you've installed Vivado and Vitis 2022.2, ensure you download the same version for Petalinux.
Comments
Please log in or sign up to comment.