Examples - Examples - 2026.1 English - UG1144

PetaLinux Tools Documentation: Reference Guide (UG1144)

Document ID
UG1144
Release Date
2026-06-23
Version
2026.1 English
Few examples for building the SDK:
  1. Adding a cross compiling qt toolchain

    To build SDK with qt toolchain:

    1. Create the <plnx-proj-root>/project-spec/meta-user/recipes-core/images/petalinux-image-minimal.bbappend file.
    2. Add inherit populate_sdk_qt5 in the newly created file.
    3. Run petalinux-config -c rootfs and select packagegroup-petalinux-qt.
    4. Run petalinux-build -s.
    5. Run petalinux-package sysroot.

    To verify:

    1. Open a new terminal.
    2. Go to <plnx-proj-root>/image/linux/sdk.
    3. Run source environment-setup-aarch64-xilinx-linux.
    4. Run which qmake. This confirms that the qmake is coming from the SDK.
  2. Building OpenCV applications
    1. Create a PetaLinux project.
    2. Add packagegroup-opencv in the RootFS menu config.
    3. To build a static library for an OpenCV application, you need to edit the <proot>/project-spec/meta-user/conf/petalinuxbsp.conf file to include the static library (.a) in the root file system. For example:
      IMAGE_INSTALL:append = " opencv-staticdev"
    4. Build SDK.
      petalinux-build --sdk

      This command builds SDK and deploys it at <plnx-proj-root>/images/linux/sdk.sh.

    5. Install SDK.
      petalinux-package sysroot

      This command installs SDK at <plnx-proj-root>/images/linux/sdk.

    6. Use the images/linux/sdk directory as sysroot for building the OpenCV applications.