For beginners, development boards based on the Zynq-7000 System-on-Chip (SoC) are a great starting point. They offer a good balance of accessible online learning material, manageable complexity, and useful resources on both the programmable logic (PL) and processing system (PS) sides. These features make them well suited for building interesting projects, learning HDL programming, and becoming familiar with ARM Cortex-A9 processors. From my personal experience, starting with this SoC as a “warm-up” before moving to the Ultrascale+ MPSoC was the right decision, as it helped me avoid dealing with too much complexity at once.
In this tutorial, we will cover the basics of how to run a simple application using PetaLinux on the Arty Z7-20 development board while using Windows 11 as the main operating system. The tutorial will walk through the steps from setting up a virtual machine (VM), to creating a PetaLinux project, and finally to running a simple application that uses the switches and LEDs available on the board.
In this tutorial, we will use Vivado, Vitis, and PetaLinux 2025.2. Vivado and Vitis will be installed on the Windows operating system.
Important Documents / FilesBefore proceeding through specific steps, make sure to either download / open in your browser tab following documents:
- UG1144: PetaLinux Tools Documentation: Reference Guide
- PetaLinux 2025.2: Product update Release Notes and Known Issues (Make sure to Login to the AMD portal)
- AMD Embedded Software Downloads Page: Petalinux Tools – Installer
Screenshot below from UG1144 shows minimum requirements that we should consider when setting up VM.
Considering we cannot use the newest version of Ubuntu, go to the following link and download ubuntu-22.04-desktop-amd64.iso. This version of Ubuntu matches with the requirement provided from AMD.
In Oracle VirtualBox, create a New Virtual Machine as shown below.
Make sure Disk size is at least 100GB and if available set number of CPUs >1. With only 1 CPU VM might not work fast enough and efficiently.
After initial setup, go to the settings of a newly created VM, go to Storage and In Optical Driver menu of Controller: IDE set the downloaded image (.iso) file of Ubuntu.
Scroll down in the same menu and set the shared folder, which will be used to share files between Windows OS and Ubuntu VM.
Launch VM and after initial setup, go to “Drag and Drop” menu and set it to Bidirectional.
Open a new terminal and execute following commands:
sudo su
cd /media
mkdir cdrom
cd cdrom
llRun the following:
sh .VBoxLinuxAdditions.run
rebootAfter restart, open again terminal and run the following commands:
sudo su
cd /
cd opt
mkdir pkg
chown guga:guga pkg/
chmod 777 pkg/Note that we need to change owner as we need to be in non-root owner. After above-mentioned steps, we need to do the same for the petalinux directory.
cd /pkg
mkdir petalinux
chown guga:guga petalinux/
chmod 777 petalinux/Then, open.xlsx file that was downloaded at the beginning of this guide, and copy command under “Ubuntu Desktop / Server 64 Bit” field and paste it into the terminal. This will install all the necessary packages required for Petalinux.
Also install the following:
sudo apt-get install libtinfo5Petalinux tools require host system to be ‘bash’as shown in screenshot below.
run following commands in terminal:
sudo dpkg-reconfigure dash
cd ../Downloads/
chmod 755 petalinux-v2025.2-11160223-installer.run
./petalinux-v2025.2-11160223-installer.run --dir /opt/pkg/petalinuxOutput should look like something like this:
After successfully installing petalinux, keep in mind that from now on, every time new terminal is open following commands need to be executed:
sudo dpkg-reconfigure dash
source /opt/pkg/petalinux/settings.shBuilding Vivado / Vitis ProjectFor this example, I will build a simple design in Vivado that will utilize LEDs, buttons and switches available on our development board. It is better you one of the LED’s will be completely controlled from PL side – This way we will make sure that hardware was correctly configured after loading the program. Rest of the LEDs and RGBs will be controlled through PS side.
Export the hardware from Vivado and create platform+ Hello_World project in Vitis. I have modified my.c code in a way that I can control RGBs using switches and buttons.
By running a baremetall code from Vitis, we can make sure and double check that our design/code works and software is read to be migrated to Petalinux.
Copy.XSA file generated from Vivado into the shared folder. After that, in VM, open a new terminal and run following commands:
sudo su
cd /shared/ (Or different name for your shared folder)
llWe can see that XSA file is visible from VM as well.
Open another terminal and run following commands:
mkdir xilinx
mkdir xilinx/arty
cd Xilinx/arty/copy an XSA file to this directory either through terminal or using GUI and then run following:
sudo chown user:user “file_name.xsa”
sudo chmod 777 “file_name.xsa”petalinux-create --type project --template zynq --name exampleThis will create a project folder called “example”. Go to the project folder and copy an xsa file there.
petalinux-config –get-hw-description and the name of the xsaFor our simple example, system configuration can be left as it is so we can just exit and proceed with building a petalinux project.
Building a petalinux project for the first time might take a long time, considering the size of the project, configuration, resources allocated to VM, etc. (Sometime more than 1 hour).
petalinux-build
petalinux-package --boot --fsbl zynq_fsbl.elf --fpga system.bit --u-bootcopy following files to the shared folder
Format SD card in FAT32 format, copy above-mentioned 3 files into sd card. Plug SD card into arty z7 board and power it up.
Open any serial terminal you want (I use PuTTY) and you should directly see Petalinux booting on your board. If, after successfully boot it will ask you for a login, username usually is “petalinux”.
Plug ethernet cable between your board and PC/Router. If you use router, there will be an IP address automatically allocated to your board. In order to see an IP address use following command:
IfconfigIf there is a direct connection between your board and IP, you will have to set a static IP address using the following command:
sudo ifconfig enx000a35001e53 192.168.1.10 netmask 255.255.255.0 upIt is also possible to set a static IP address during Petalinux system configuration page, but this will not be covered in this tutorial.
Open a command prompt on your PC and ping board’s IP address to make sure there is an existing connection between 2 devices.
In vitis, create “Linux Hello World” example project.
Modify your.C code, as some of the librarier and functions are not available in Linux environment. For example my modified example code looks like this:
Go to Vitis -> Target connections and create a new Linux TCF Agent. Make sure to Test Connection before saving it to make sure that everything works well.
Modify launch.json of Hello World project accordingly:
After successfully going through the above-mentioned steps and pressing debug button, user should be able to step over each line and test code functionality.
We can also directly run our code, by executing.elf file loaded into our board as shown in the screenshot below.
Disclaimer
This tutorial reflects my personal work, experience, and opinions. It is provided for educational purposes only and is not affiliated with, endorsed by, or representative of any company, employer, or organization I am or have been associated with.












Comments