This is an old revision of the document!
Overview
This page steps through building for a ZCU102 using an .hdf file downloaded from GitHub, and PetaLinux 2019.1.
Format of the HDF file
Downloaded from here:
Archive: ultra96.hdf
02DSH12MNEbgh3d2ADvZ8IeVwk9LCZtTVUKqK+SvpYiWc=
Length Date Time Name
--------- ---------- ----- ----
1533 05-05-2019 20:48 sysdef.xml
625712 05-05-2019 20:48 design_1.hwh
63674 05-05-2019 20:48 design_1_bd.tcl
902065 05-05-2019 20:48 psu_init.c
1639208 05-05-2019 20:48 psu_init.h
901229 05-05-2019 20:48 psu_init_gpl.c
1638594 05-05-2019 20:48 psu_init_gpl.h
51077 05-05-2019 20:48 psu_init.html
862752 05-05-2019 20:48 psu_init.tcl
127691 05-05-2019 20:48 design_1_v_proc_ss_scaler_0.hwh
12995 05-05-2019 20:48 design_1_v_proc_ss_scaler_0_bd.tcl
990723 05-05-2019 20:48 bd_c7bd_smartconnect_0_0.hwh
107924 05-05-2019 20:48 bd_c7bd_smartconnect_0_0_bd.tcl
87470 05-05-2019 20:48 design_1_mipi_csi2_rx_subsyst_0_0.hwh
12412 05-05-2019 20:48 design_1_mipi_csi2_rx_subsyst_0_0_bd.tcl
5568788 05-05-2019 20:48 design_1_wrapper.bit
--------- -------
13593847 16 files
$
PetaLinux build procedure
Preparing for the build
First, source the appropriate environment file for PetaLinux 2019.1; something like:
$ source .../2019.1/settings.sh $ echo $PETALINUX /home/rpjday/xilinx/2019.1 $
followed by creating a new (for this discussion, zynqMP-based) PetaLinux project and moving to that new project directory:
$ petalinux-create \ --type project \ --name ultra96v2 \ --template zynqMP $ cd ultra96v2
Incorporating the HDF file
Configure the new project by running petalinux-config and incorporating the aforementioned .hdf file by referring to its directory location:
$ petalinux-config --get-hw-description <dirname of HDF File>
at which time you will be placed in the PetaLinux “System Configuration” utility; if you have nothing to change, simply exit and save your configuration.
Configuring the project
$ petalinux-config $ petalinux-config -c bootloader [virtual/fsbl] $ petalinux-config -c u-boot ... hangs ... $ petalinux-config -c kernel $ petalinux-config -c rootfs $ petalinux-config -c busybox $ petalinux-config -c pmufw $ petalinux-config -c device-tree
The build process
Now that all of the project configuration is complete, kick off the PetaLinux build with:
$ petalinux-build
A successful build should generate numerous build artifacts under the project's images/linux/ directory, depending on how the project was configured:
$ ls images/linux/ bl31.bin rootfs.cpio.bz2 rootfs.its system.dtb bl31.elf rootfs.cpio.gz rootfs.jffs2 System.map.linux Image rootfs.cpio.gz.u-boot rootfs.manifest u-boot.bin image.ub rootfs.ext3 rootfs.tar.bz2 u-boot.elf pmufw.elf rootfs.ext3.bz2 rootfs.tar.gz vmlinux rootfs.bin rootfs.ext4 rootfs.testdata.json zynqmp_fsbl.elf rootfs.cpio rootfs.ext4.gz system.bit $
The packaging step
The final step in the PetaLinux build is to “package” the appropriate generated artifacts to copy to a bootable SD card to boot the target system (in this case, a Fidus Sidewinder). The simplest SD card image will contain two files:
BOOT.BINimage.ub
The FIT image file image.ub should already have been generated; to complete the process, build the BOOT.BIN file with:
$ petalinux-package \ --boot \ --force \ --format BIN \ --fsbl images/linux/zynqmp_fsbl.elf \ --fpga images/linux/system.bit \ --u-boot $
whereupon you can see the target boot file BOOT.BIN being constructed, generating output something like:
INFO: File in BOOT BIN: ".../myproj/images/linux/zynqmp_fsbl.elf" INFO: File in BOOT BIN: ".../myproj/images/linux/pmufw.elf" INFO: File in BOOT BIN: ".../myproj/images/linux/system.bit" INFO: File in BOOT BIN: ".../myproj/images/linux/bl31.elf" INFO: File in BOOT BIN: ".../myproj/images/linux/u-boot.elf" INFO: Generating ZynqMP binary package BOOT.BIN...
You can optionally create a .bsp file for import into a future PetaLinux project with:
$ petalinux-package \ --bsp \ --project . \ --output myproj.bsp