This project provides a step-by-step guide for installing Ubuntu 23.04 LTS on the Zynq ZC7010 board using Petalinux 2022.4. The following instructions will help you set up your environment and successfully install Ubuntu on your Zynq ZC7010 board.
Before starting the installation process, make sure you have the following prerequisites:
- Zynq ZC7010 board
- Petalinux 2022.4 software
- Ubuntu 23.04 LTS installation files
- SD card (8GB or larger)
- A host computer with Linux OS (preferably Ubuntu)
- Xillinx Vivado 2020.1
- Install the required dependencies by executing the following command:
sudo apt-get install tofrodos iproute2 gawk gcc git make net-tools libncurses5-dev tftpd zlib1g-dev libssl-dev flex bison libselinux1 gnupg wget diffstat chrpath socat xterm autoconf libtool tar unzip texinfo zlib1g-dev gcc-multilib build-essential libsdl1.2-dev libglib2.0-dev screen pax gzip
- Download the Petalinux 2022.4 installer from the Xilinx website and follow the installation instructions provided.
- If some packages are not available they have to be manually installed. Information on the specific packages required by the Petalinux software can be found on https://docs.xilinx.com/r/en-US/ug1144-petalinux-tools-reference-guide/Steps-to-Set-Up-PetaLinux-Working-Environment
- Insert the SD card into your host computer.
- Identify the device name assigned to your SD card (e.g.,
/dev/sdX
). Use thelsblk
command to list all available block devices and identify the SD card. - Run the following command to partition and format the SD card:
sudo fdisk /dev/sdX
- Inside the
fdisk
command-line interface, create a new partition table (g
command) and a new primary partition (n
command). - Set the partition type to FAT32 by using the
t
command and choosing the appropriate code (e.g.,b
for FAT32). - Write the changes to the SD card by executing the
w
command and exitfdisk
. - Format the partition with the FAT32 filesystem by running the following command:
sudo mkfs.vfat /dev/sdX1
- Mount the required Ubuntu bootfile into the SD card. Ubuntu version can be found at: https://ubuntu.com/download
- Launch Xilinx Vivado on your host machine.
- Create a new project by selecting "Create Project" from the Vivado welcome screen.
- Specify a name and location for your project, and choose an appropriate project directory.
- Select the Zynq ZC7010 board as the target device for your project.
- Choose "RTL Project" as the project type and click "Next".
- Add your source files, constraints, and other necessary design files to the project.
- Proceed with the default settings for project options and IP integrator.
- After completing the project creation, click "Generate Bitstream" to generate the bitstream file for your design.
- Once the bitstream generation is complete, export the hardware design by selecting "File" -> "Export" -> "Export Hardware."
- Choose "Include bitstream" and click "OK" to export the hardware design.
- Open a terminal window and navigate to the project directory. Run the following command to create a new Petalinux project:
petalinux-create -t project -s project-spec/template.yml
- Change the directory to the newly created Petalinux, then open the configuration menu, and make the necessary changes to configure the project according to your requirements. Ensure that the Ubuntu 23.04 LTS root filesystem is selected as the rootfs type. Run the following commands:
cd petalinux
petalinux-config //to build the project
- After configuring the project, save and exit the configuration menu. This is to install the necessary components and generate the bootable files for the Zynq ZC7010 board. Initially, this can take up to 8 hours, but if we retry to rebuild the project it will rebuild within 15 minutes. Start the build process by running the following command:
petalinux-build
- Once the build process completes, copy the generated image.ub and BOOT.bin files to the SD card.
- Insert the SD card into the Zynq ZC7010 board.
- Connect a designated GPIO and MIO peripherals devices (this depends on the .xsa file).
- Power on the board.
- Using any Linux terminal emulator (in our case we used PuTTY) send commands to the FPGA.
BSP Files: https://github.com/Digilent/Zybo-Z7/releases/tag/10%2FPetalinux%2F2022.1-1?_ga=2.1236145.1035339971.1685692008-1734108723.1681792619
Pin configuration: https://digilent.com/reference/programmable-logic/zybo-z7/demos/petalinux
Tutorial Followed: https://medium.com/developments-and-implementations-on-zynq-7000-ap/install-ubuntu-16-04-lts-on-zynq-zc702-using-petalinux-2016-4-e1da902eaff7
Using Yocto to build custom Petalinux image (for missing packages which can be found on Rocko):
https://www.youtube.com/watch?v=FMCfn0zwhaQ&t=1435s
Installation Guide for Petalinux: https://docs.xilinx.com/r/en-US/ug1144-petalinux-tools-reference-guide/Steps-to-Set-Up-PetaLinux-Working-Environment