DESK-XZU-L/Development/Creating and building the Petalinux project

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes
2026/06/03 DESK-XZU-L-2.0.0 release



200px-Emblem-important.svg.png

Petalinux installation path, in this documentation, is the /opt directory. If you have chosen a different one, set it properly. The commands reported here below have been used on a native server running Ubuntu 20.04.

Creating and building the Petalinux project[edit | edit source]

Documentation reference[edit | edit source]

  • PetaLinux Tools Documentation Reference guide UG1144

Petalinux environment setup[edit | edit source]

To reproduce the Petalinux build:

  • clone the repository
git clone --recursive git@git.dave.eu:desk-xz-l/petalinux.git -b desk-xzu-l-2.0.0
cd petalinux
  • setup the Petalinux environment
source <petalinux installation path>/Xilinx/petalinux/2024.2/settings.sh
  • initialize the configuration file

You can use the proper configuration file from the following table:

Config file Boot
config_onda uSD and eMMC

In order to select a configuration file use the following command:

cp project-spec/configs/<configuration file> project-spec/configs/config
Rootfs Config file
rootfs_config_onda

In order to select a rootfs configuration file use the following command:

cp project-spec/configs/<rootfs configuration file> project-spec/configs/rootfs_config

Update the hardware description[edit | edit source]

The hardware description comes from the Vivado project. The Vivado project is already cloned into the Petalinux project.

To build the Hardware description file, please look at this page: Creating and building the Vivado project

You can use the following command to update the hardware description:

petalinux-config --get-hw-description vivado/vivado/<path to .xsa>

When applying the hardware description, the standard menuconfig interface will pop up: just save the current configuration to proceed. If the menuconfig interface will not bring up, send the following command:

petalinux-config --get-hw-description vivado/vivado/<path to .xsa> --silentconfig

Run the Petalinux build[edit | edit source]

To build petalinux-image-minimal use the following command:

petalinux-build

For building only the Linux kernel, use the following command

petalinux-build -c kernel

For building only U-Boot use the following command:

petalinux-build -c u-boot

For generating the BOOT.BIN artifact, run the following command:

petalinux-package boot --u-boot --fsbl --fpga --force

Note: BOOT.BIN includes the files below. In this case, the system.bit bitstream was generated with Vivado and imported in Petalinux with xsa file.

  • fsbl.elf
  • system.bit
  • u-boot.elf

SD card image[edit | edit source]

To generate the SD card wic image, execute the following command:

petalinux-package wic --bootfiles "BOOT.BIN boot.scr image.ub"