===== Overview ===== This page steps through building for a ZCU102 using an ''.hdf'' file downloaded from GitHub, and PetaLinux 2019.1. ===== Format of the ZCU102 HDF file ===== -rw-r--r--. 1 rpjday rpjday 46772 May 5 15:09 design_1_bd.tcl -rw-r--r--. 1 rpjday rpjday 124564 May 5 15:09 design_1.hwh -rw-r--r--. 1 rpjday rpjday 26510901 May 5 15:09 design_1_wrapper.bit -rw-r--r--. 1 rpjday rpjday 922239 May 5 15:09 psu_init.c -rw-r--r--. 1 rpjday rpjday 921403 May 5 15:09 psu_init_gpl.c -rw-r--r--. 1 rpjday rpjday 1660902 May 5 15:09 psu_init_gpl.h -rw-r--r--. 1 rpjday rpjday 1661516 May 5 15:09 psu_init.h -rw-r--r--. 1 rpjday rpjday 52815 May 5 15:09 psu_init.html -rw-r--r--. 1 rpjday rpjday 881371 May 5 15:09 psu_init.tcl -rw-r--r--. 1 rpjday rpjday 1007 May 5 15:09 sysdef.xml ''system.xml'': ===== 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 zcu102 \ --template zynqMP $ cd zcu102 End result: $ tree -d . └── project-spec ├── configs ├── hw-description └── meta-user ├── conf ├── recipes-apps │   ├── gpio-demo │   │   └── files │   └── peekpoke │   └── files ├── recipes-bsp │   ├── device-tree │   │   └── files │   │   └── multi-arch │   └── u-boot │   └── files └── recipes-core └── images ==== 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 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//. Major result is new content under ''project-spec/meta-plnx-generated''. ===== Configuration options ===== $ petalinux-config $ petalinux-config -c bootloader [virtual/fsbl] $ petalinux-config -c u-boot [virtual/bootloader] $ 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.BIN'' * ''image.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