Prepare for Platform Packaging - 2024.1 English

Vitis Tutorials: Vitis Platform Creation

Document ID
Release Date
2024.1 English

You should prepare the following components before creating the platform.

Component Conventional Path or Filename Description
Boot components boot/bl31.elfboot/u-boot.elfboot/system.dtb All components referred in linux.bif should be in this folder
Boot components in FAT32 partition of SD Card sd_dir/boot.scr U-boot configuration file to store in FAT32 partition of SD card
Linux Software Components sw_comp/Imagesw_comp/rootfs.ext4sw_comp/sysroots Linux components for application creation and Linux booting. They can be packaged into platform or stay standalone and be linked during application creation process.

This tutorial uses the Linux software components provided by the Common Images. You can store all the necessary files for Vitis platform creation flow in the step2_sw/build/pfm directory.

  1. Download and extract the Common Images for AMD Versal™ devices.

    • Visit the Vitis Embedded Platforms download page.

    • Download the Versal common image to step2_sw/build/common from the 2023.2 page.

    • Extract the downloaded package using the cd step2_sw/build/common; tar -xzf xilinx-versal-common-v2023.2.tar.gz command.

  2. Prepare the boot components.

    From the table above, you know that the boot components include the following items:

    • bl31.elf

    • u-boot.elf

    • system.dtb

    Follow these steps to copy them to boot directory.

    • Create directory for boot components mkdir step2_sw/build/boot.

    • Copy boot components from common image directory.

      cp step2_sw/build/common/bl31.elf step2_sw/build/boot
      cp step2_sw/build/common/u-boot.elf step2_sw/build/boot
    • Copy device tree.

      cp step2_sw/build/vck190_custom_dt/psv_cortexa72_0/device_tree_domain/bsp/system.dtb step2_sw/build/boot
  3. Prepare the sd_dir directory. Contents in this directory will be packaged to FAT32 partition of SD card image by v++ package tool.

    1. Create the sd_dir directory: mkdir step2_sw/build/sd_dir

    2. Copy boot.scr from the common image directory step2_sw/build/common to the step2_sw/build/sd_dir directory. It is a script for U-Boot initialization. U-boot will read it from FAT32 partition during boot process.

  4. Prepare Linux software components for application creation. Platform packaging can add them or exclude them. Due to the software component size, they are usually kept outside of platforms so that these components can be reused among multiple platforms with the same architecture. On the other side, keeping Linux software components in the platform can prevent mix and match different combinations when delivering the platform from one team to another. Here we keep the Linux software components standalone.

    # Create sw_comp directory
    mkdir step2_sw/build/sw_comp
    cd sw_comp
    # Copy Linux kernel image
    cp <COMMON_IMAGE_PATH>/Image .
    # Copy EXT4 Root Filesystem
    cp <COMMON_IMAGE_PATH>/rootfs.ext4 .
    # Install sysroot to this directory
    <COMMON_IMAGE_PATH>/ -d ./ -y

Finally, your prepared directory structure looks like this.

tree -L 3 --charset ascii
|-- boot
|   |-- bl31.elf
|   |-- system.dtb
|   `-- u-boot.elf
|-- sd_dir
|   `-- boot.scr
|-- sw_comp
|   |-- environment-setup-cortexa72-cortexa53-xilinx-linux
|   |-- Image
|   |-- rootfs.ext4
|   |-- site-config-cortexa72-cortexa53-xilinx-linux
|   |-- sysroots
|   |   |-- cortexa72-cortexa53-xilinx-linux
|   |   `-- x86_64-petalinux-linux
|   `-- version-cortexa72-cortexa53-xilinx-linux

Note: If you run the fast track script, the boot directory only has linux.bif file because the platform creation script xsct_create_pfm.tcl uses the <petalinux_project>/images/linux directory as boot directory for components of the BIF file. To make the GUI flow easier, copy these components to the boot directory for preparation.