Versal Prime -VCK190 Evaluation Kit Tutorial

Building Petalinux

Building Petalinux

Introduction

This tutorial walks through the typical steps of creating and customizing a bootable Linux image for the VCK190 Evaluation Board.

In the follwing sections, you will:

  1. Build the BSP with the default rootfs configuration.
  2. Learn how to add your own Vivado or Vitis generated bitstream firmware components.

Prerequisites

  1. PetaLinux 2021.2 tools installation

Accessing the Tutorial Reference Files

Note: Skip the following steps if the design files have already been cloned and extracted to a working repository
  1. Download the 2021.2 TRD petalinux source files
  2. Navigate to the xilinx-vck190-trd which is the working directory.

To Build Designs and Petalinux in one step:

  1. Go to the working directory
cd $working_dir/

Note: The xilinx-vck190-trd directory inside petalinux directory must have the .petalinux folder to build petalinux.

User needs to copy the .petalinux folder from the default vck190 production bsp petalinux project.

  1. To build and generate sdcard image (wic), run the following command. The Makefile calls a lower level Makefile to build petalinux. If a platform is not already available, it builds it.
make sdcard YES=1

Modifying/Configure the petalinux project manually

The project needs to be configured with the xsa file from the Vivado project.

petalinux-config --get-hw-description=<path of xsa> --silentconfig
Note: The xsa needs to match the platform and design selected in the previous step.

Build the Image

Run the below commands to build and package the wic image in compressed format:

petalinux-build
petalinux-package --wic --wic-extra-args "-c xz"
Note : Before running above command copy binary_container_1.xclbin into images/linux folder.

The generated compressed image file will be located at images/linux/petalinux-sdimage.wic.xz.

Tip: The generated wic file assumes a fixed partition size. The file size can be significantly lower by compressing the file e.g. using xz:

To uncompress wic file use following command

xz -d -v images/linux/petalinux-sdimage.wic.xz

This generates a output file named images/linux/petalinux-sdimage.wic with uncompressed wic file

Flash the image on an SD card using Balena Etcher. This image is functionally equivalent to the prebuilt sdcard image provided with package

Build the SDK

A cross-compilation SDK is useful for application development on a host machine for a specific target architecture e.g. X86 host and ARM 64-bit target. Run the below command to generate a cross-compilation that can be used outside the PetaLinux:

petalinux-build -s

The resulting self-extracting shell script installer file is located at images/linux/sdk.sh.

The SDK installer script can be copied to the application developer’s host machine and installed by simply running the script. Follow the prompts on the screen.

$ images/linux/sdk.sh
PetaLinux SDK installer version  2021.2
============================================
Enter target directory for SDK (default: /opt/petalinux/ 2021.2): ./images/linux/sdk

Once the SDK is installed, source the file images/linux/sdk/environment-setup-aarch64-xilinx-linux to set up the cross-development environment.

Next Step

References

License

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.

You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright© 2021 Xilinx