Use PetaLinux to Create bootable SD card
Table of Contents
1 Start Petalinux
This training session provide hardware design file for Ultra96v2,
but key file used in petalinx is BSP files, it shall be access from
since petalinux has been installed, start petalinux environment with
source ~/tools/Xilinx/Petalinux/PetaLinux/2022.1/settings.sh
2 Create Petalinux Project
Create petalinux project for petalinux-create command,
petalinux-create -t project -s u96v2_sbc_base_2021_2.bsp -n Lab1
change directory and the config the project with petalinux-config,
after a while the text format GUI appears, first line is ZYNQMP core configuration,
press enter and go into submenu,
go further the SD card settings
choose psu_sd_0, this part links with hardware design,
go back to config UART setting,
use psu_uart_1
press escape and exit the configuration,save the configuration file,
the configuration is OK. This is standard yocto configuration with customized Zynqmp core.
3 Build Petalinux Project
Build the project with petalinux-build,
petalinux-build -c avnet-image-minimal
most of the sdk file shall be download from github or third part web, it the link lost, build ceased with error,
if successful, the file needed for boot image is ready to included in images/linux.
cd images/linux
There are always web link lost in build process, so far is the lab training process.
There are solutions, download cache files from AMD xilinx website and redirect the mirror link, but that is 60G, take a while.
4 Packing Petalinux Project
Packing the files the with petalinux-package
petalinux-package --boot --fsbl zynqmp_fsbl.elf --u-boot u-boot.elf --pmufw pmufw.elf --fpga system.bit
to generate BOOT.BIN
Then prepare SD card with the following layout
- Partition 1:
- Format: FAT32
- Size: 1GB
- Label: boot
- Partition 2:
- Format: ext4
- Size: 4GB or more
- Label: rootfs
Partition 1 use less then 500M, so it shall be >500M, copy BOOT.BIN and image.ub here,
Partition 2 shall use image burner like echet, rufus or linux command dd as
sudo dd if=rootfs.ext4 of=/dev/sdX2 sync
Plug the SD card into the slot and boot the Ultra96 to run petalinux.
The FPGA bitstream is binding with the petalinux in build and packing process, if there is any changes in hardware design. Repeat the process.
Top Comments