This is an old revision of the document!


This page steps through building for an Ultra96V2 using an .hdf file downloaded from GitHub, and PetaLinux 2019.1.

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
$

First, source the appropriate environment file for PetaLinux 2019.1; something like:

$ source .../2019.1/settings.sh

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

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.

If you want to configure the project's kernel, first ensure that you have some appropriate terminal emulation to support the configuration window. For example, if you're connected to the build host via SSH, and that build host has the screen utility installed, simply set:

$ export TERM=screen

Once that's done, you can configure the kernel with:

$ petalinux-config -c kernel

As a common example of configuration (necessary for the Sidewinder board), you can select the PCI-related kernel feature:

  • Bus Support →
    • PCI host controller drivers →
      • Xilinx XDMA PL PCIe host bridge support

then save and exit.

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 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
  • xilinx_running_petalinux.1571505794.txt.gz
  • Last modified: 2019/10/19 17:23
  • by rpjday