This section explains how to configure and build the Linux operating system for an Arm Cortex-A72 core-based APU on a Versal device. You can use the PetaLinux tool with the board-specific BSP to configure and build Linux images.
This example needs a Linux host machine. Refer to the PetaLinux Tools Documentation Reference Guide UG1144 for information on dependencies and installation procedure for the PetaLinux tool.
Important
This example uses the VPK180 PetaLinux BSP to create a PetaLinux project. Ensure that you have downloaded the respective BSP for PetaLinux (VPK180).
Board |
QSPI/SD |
OSPI |
eMMC |
|---|---|---|---|
VPK180 Production Board |
xilinx-vpk180-v2024.1-05230256.bsp <https://www.xilinx.com/member/forms/download/xef.html?filename=xilinx-vpk180-v2024.1-05230256.bsp> |
N/A |
N/A |
Copy the respective board’s PetaLinux BSP to the current directory.
Set up the PetaLinux environment
$ source <petalinux-tools-path>/settings.csh
Create a PetaLinux project using the following command.
$ petalinux-create -t project -s xilinx-vpk180-vxxyy.z-final.bsp -n led_example
Note
For VPK180 board, use xilinx-vpk180-vxxyy.z-final.bsp after the -s option in the command.
Change to the PetaLinux project directory using the following command.
$cd led_example
Copy the hardware platform project XSA to the Linux host machine.
Note
For the VPK180 board, use the XSA file that you generated in the Design Example: Using AXI GPIO.
Follow these commands to create the
sdtoutfile using the XSA.Source the Vivado tool (2025.2 release version):
$ source < vivado-tools-path >/settings64.sh
Run the
sdtgencommand to generate thesdtout:$ sdtgen sdtgen% set_dt_param -dir sdt_out -xsa <XSA_PATH> -board_dts versal-vpk180-reva sdtgen% generate_sdt sdtgen% exit
Reconfigure the BSP using the following commands.
$ petalinux-config --get-hw-description=<path till the directory containing the generated sdtout>
This command opens the PetaLinux Configuration window. For this example, no need to change anything in this window.
Click <Save> to save the above configuration and then <Exit> to exit the configuration wizard.
Create a Linux application named gpiotest within the PetaLinux project using the following command.
$petalinux-create -t apps --template install --name gpiotest --enable
Copy application files from
<design-package>/<vpk180>/linux/bootimagesto the project using the following commands.
$cp <design-package>/ch7_system_design_example_source__files/apu/gpiotest_app/gpiotest/files/* <plnxproj-root>/project-spec/meta-user/recipes-apps/gpiotest/files/ $cp <design-package>/ch7_system_design_example_source__files/apu/gpiotest_app/gpiotest/gpiotest.bb <plnx-proj-root>/project-spec/meta-user/recipes-apps/gpiotest/gpiotest.bb $cp <design-package>/ch7_system_design_example_source__files/apu/device_tree/system-user.dtsi <plnx-proj-root>/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
Enable GPIO support within kernel configuration.
$petalinux-config -c kernel
Note
This command opens the kernel configuration wizard for the PetaLinux project.
Navigate to Device drivers→ GPIO Support and enable it by pressing the <Y> key. Press Enter and enable the Debug GPIO calls and
/sys/class/gpio/...(sysfs interface)entries by pressing the <Y> key as shown in the following figure.To verify GPIO support and Zynq GPIO support are enabled, navigate to Memory mapped GPIO drivers and ensure GPIO support and Zynq GPIO support are enabled (press <Y> to enable) as shown in the following figure.
Click <Save> to save the above configuration and then <Exit> option to exit the configuration wizard.
Configure ROOTFS to disable the AIE, STDC++, and Tcl options to reduce the rootfs size to fit into both SD and OSPI/QSPI Flash partitions.
petalinux-config -c rootfs
Navigate to User Packages and disable openamp-demo-notebooks by pressing <Y> key as shown in the following figure and ensure the following configurations are disabled: aie-notebooks, packagegroup-petalinux-jupyter, pm-notebooks, and python3-ipywidgets support.
To verify libstdc++ is disabled, navigate to Filesystem Packages → misc → gcc-runtime and ensure libstdc++ support is disabled (Press <Y> to disable) as shown in the following figure.
To verify tcl support is disabled, navigate to Filesystem Packages → devel → tcltk → tcl and ensure tcl support is disabled (Press <Y> to disable) as shown in the following figure.
Click <Save> to save the above configuration and then click <Exit> to exit the configuration wizard.
Note
Only SD and QSPI boot modes will work on VPK180 Production boards.
Build the Linux images using the following command.
$ petalinux-build
Note
Skipping steps 5 and 6 in the Synthesizing, Implementing, and Generating the Device Image section will result in PLM Error Status: 0x22220001 while booting PetaLinux.
After flashing the built images, all four LEDs which are connected to slave SLR will be turned on on the VPK180 board.