0% found this document useful (0 votes)
41 views299 pages

PetaLinux UG1144 2024-1

The PetaLinux Tools Documentation Reference Guide (UG1144 v2024.1) provides comprehensive instructions for using the PetaLinux SDK, which is designed for developing embedded Linux systems on FPGA-based SoCs. It includes setup instructions, project creation, configuration, building, and booting processes, along with advanced configurations and debugging techniques. The document also highlights new features in the 2024.1 release, such as OS support changes and the removal of certain BSPs.

Uploaded by

Ayyaz Yyaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views299 pages

PetaLinux UG1144 2024-1

The PetaLinux Tools Documentation Reference Guide (UG1144 v2024.1) provides comprehensive instructions for using the PetaLinux SDK, which is designed for developing embedded Linux systems on FPGA-based SoCs. It includes setup instructions, project creation, configuration, building, and booting processes, along with advanced configurations and debugging techniques. The document also highlights new features in the 2024.1 release, such as OS support changes and the removal of certain BSPs.

Uploaded by

Ayyaz Yyaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 299

See all versions

of this document

PetaLinux Tools
Documentation

Reference Guide
UG1144 (v2024.1) May 30, 2024

AMD Adaptive Computing is creating an environment where


employees, customers, and partners feel welcome and included. To
that end, we’re removing non-inclusive language from our products
and related collateral. We’ve launched an internal initiative to remove
language that could exclude people or reinforce historical biases,
including terms embedded in our software and IPs. You may still find
examples of non-inclusive language in our older products as we work
to make these changes and align with evolving industry standards.
Follow this link for more information.
Table of Contents
Chapter 1: Overview.................................................................................................... 7
Introduction................................................................................................................................. 7
Navigating Content by Design Process.................................................................................... 9

Chapter 2: Setting Up Your Environment...................................................... 10


Installation Steps.......................................................................................................................10
PetaLinux Working Environment Setup................................................................................. 14
Design Flow Overview...............................................................................................................15

Chapter 3: Creating a Project................................................................................17


Creating a Project Using PetaLinux BSP.................................................................................17
Configuring a Hardware Platform with Vivado Design Suite...............................................19
Exporting a Hardware Platform to PetaLinux Project.......................................................... 20
Creating an Empty Project from a Template..........................................................................21

Chapter 4: Configuring and Building................................................................23


Version Control.......................................................................................................................... 23
Importing Hardware Configuration........................................................................................24
Building a System Image..........................................................................................................27
System Devicetree flow to Build Images................................................................................ 30
Build Optimizations...................................................................................................................33

Chapter 5: Packaging and Booting.................................................................... 36


Packaging Boot Image............................................................................................................. 36
Packaging Prebuilt Images...................................................................................................... 43
BSP Packaging........................................................................................................................... 44
Booting PetaLinux Prebuilt Images........................................................................................ 45
Booting PetaLinux Image on QEMU....................................................................................... 47
Booting PetaLinux Image on Hardware with an SD Card.................................................... 50
Booting PetaLinux Image on Hardware with JTAG............................................................... 53
Booting PetaLinux Image on Hardware with TFTP............................................................... 56
Booting PetaLinux Image on Hardware with QSPI or OSPI.................................................58

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 2
Boot from HBM/Higher DDR/LP DDR.....................................................................................62

Chapter 6: Upgrading the Workspace...............................................................65


Upgrading Between Minor Releases (2024.1 Tool with 2024.x Tool) ................................. 65
Upgrading the Installed Tool with More Platforms.............................................................. 67
Upgrading the Installed Tool with your Customized Platform............................................68

Chapter 7: Customizing the Project.................................................................. 69


Configuring Firmware Version................................................................................................ 69
Configuring Root File System Type......................................................................................... 70
Configuring U-Boot Boot Script (boot.scr).............................................................................71
Configuring Primary Flash Partition....................................................................................... 74
Configuring INITRD Boot......................................................................................................... 75
Configuring INITRAMFS Boot.................................................................................................. 76
Configuring TFTP/PXE Boot..................................................................................................... 77
Configuring NFS Boot............................................................................................................... 78
Configuring JFFS2 Boot............................................................................................................. 79
Configuring UBIFS Boot............................................................................................................81
Configuring SD Card ext File System Boot............................................................................. 85
Managing Image Size............................................................................................................... 87

Chapter 8: Customizing the Root File System............................................. 90


Including Prebuilt Libraries......................................................................................................90
Including Prebuilt Applications............................................................................................... 90
Creating and Adding Custom Libraries.................................................................................. 91
Creating Apps in PetaLinux Project.........................................................................................92
Creating and Adding Custom Applications............................................................................ 92
Creating and Adding Custom Kernel Modules...................................................................... 94
Building User Applications....................................................................................................... 95
Testing User Applications.........................................................................................................97
Building User Modules............................................................................................................. 98
PetaLinux Auto Login................................................................................................................99
Application Auto Run at Startup.............................................................................................. 99
Adding Layers.......................................................................................................................... 100
Adding an Existing Recipe into the Root File System..........................................................101
Adding a Package Group........................................................................................................102
Appending Root File System Packages.................................................................................103

Chapter 9: Debugging............................................................................................. 104

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 3
Debugging the Linux Kernel in QEMU..................................................................................104
Debugging Applications with TCF Agent..............................................................................106
Debugging Zynq UltraScale+ MPSoC and Versal Adaptive SoC Applications with GDB.118
Debugging Individual PetaLinux Components................................................................... 123

Chapter 10: Advanced Configurations........................................................... 124


Menuconfig Usage.................................................................................................................. 124
PetaLinux Menuconfig System.............................................................................................. 124
Open Source Bootgen for On-target Use for Zynq Devices, Versal Adaptive SoC, and
Zynq UltraScale+ MPSoC....................................................................................................155
Configuring Out-of-tree Build................................................................................................155
Configuring Project Components......................................................................................... 159

Chapter 11: Yocto Features................................................................................... 165


SDK Generation (Target Sysroot Generation)......................................................................165
Accessing BitBake/Devtool in a Project................................................................................ 167
Shared State Cache................................................................................................................. 168
Downloading Mirrors..............................................................................................................169
Machine Support..................................................................................................................... 170
SoC Variant Support................................................................................................................171
Image Features........................................................................................................................172
Filtering RootFS Packages Based on License....................................................................... 173
Creating and Adding Patches For Software Components within a PetaLinux Project... 173
Adding Extra Users to the PetaLinux System...................................................................... 174

Chapter 12: Technical FAQs.................................................................................. 176


Troubleshooting ..................................................................................................................... 176

Appendix A: Migration............................................................................................. 185


PetaLinux Supported Dynamic Configuration.....................................................................185
Login Changes......................................................................................................................... 196
Systemv to Systemd................................................................................................................ 197
Yocto Override Syntax Changes............................................................................................ 197
Yocto Recipe Name Changes................................................................................................. 198
U-Boot Image Changes.......................................................................................................... 198
MCS File Support..................................................................................................................... 199
BIF File Changes...................................................................................................................... 199
Use Yocto Environment Variables in petalinux-config Option.......................................... 200
Host GCC Version Upgrade.................................................................................................... 200

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 4
Removed config.project ........................................................................................................ 200
Usage of uenv.txt.................................................................................................................... 201
Renamed ARM Trusted Firmware Configuration................................................................ 201

Appendix B: PetaLinux to Create PL Applications and Install on


Target............................................................................................................................ 202

Appendix C: PetaLinux Project Structure......................................................203


Project Layers.......................................................................................................................... 206

Appendix D: Generating Boot Components.................................................207


Platform Loader and Manager Firmware (PLM)................................................................. 207
Processing System Management Firmware (PSM)............................................................. 208
Image Selector.........................................................................................................................208
First Stage Boot Loader for Zynq UltraScale+ and Zynq 7000 Devices............................. 209
Trusted Firmware-A (TF-A)..................................................................................................... 210
PMU Firmware......................................................................................................................... 211
FS-Boot for MicroBlaze Platform Only.................................................................................. 211

Appendix E: QEMU Virtual Networking Modes.......................................... 213

Appendix F: AMD IP Models Supported by QEMU.....................................214

Appendix G: Xen Zynq UltraScale+ MPSoC and Versal Adaptive


SoC Example.............................................................................................................. 215
Prerequisites............................................................................................................................ 215
Boot Prebuilt Linux as dom0..................................................................................................215
Rebuild Xen.............................................................................................................................. 216
Boot Built Linux as dom0....................................................................................................... 217

Appendix H: Booting Prebuilt OpenAMP....................................................... 218

Appendix I: Partitioning and Formatting an SD Card............................ 219

Appendix J: Auto-mounting an SD Card......................................................... 221

Appendix K: Deprecated BSP Support............................................................. 223

Appendix L: PetaLinux Commands................................................................... 225


petalinux-create...................................................................................................................... 225

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 5
petalinux-config...................................................................................................................... 229
petalinux-build.........................................................................................................................232
petalinux-boot......................................................................................................................... 236
petalinux-package...................................................................................................................276
petalinux-util............................................................................................................................287
petalinux-upgrade.................................................................................................................. 289
petalinux-devtool.................................................................................................................... 290

Appendix M: Additional Resources and Legal Notices.......................... 297


Finding Additional Documentation.......................................................................................297
Support Resources.................................................................................................................. 298
Revision History....................................................................................................................... 298
References................................................................................................................................298
Please Read: Important Legal Notices................................................................................. 299

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 6
Chapter 1: Overview

Chapter 1

Overview

Introduction
PetaLinux is an embedded Linux Software Development Kit (SDK) targeting FPGA-based system-
on-a-chip (SoC) designs or FPGA designs.

You are expected to possess fundamental proficiency in Linux, including the ability to execute
Linux commands. You should also know the OS and host system functionalities, such as the OS
version, Linux distribution, security privileges, and elementary concepts of Yocto.

The PetaLinux tool contains the following:

• Yocto Extensible SDK (eSDK)


• XSCT and toolchains
• PetaLinux Command Line Interface (CLI) tools

Note: AMD Vitis™ unified software platform is the integrated design environment (IDE) for creating
embedded applications on AMD microprocessors. For more details, refer to Vitis Unified Software Platform
Documentation: Embedded Software Development (UG1400).

PetaLinux SDK is an AMD development tool that contains everything necessary to build, develop, test, and
deploy embedded Linux systems.

From 2024.1 onwards, there are two ways to build the PetaLinux images. .

• XSCT Flow: Using the XSCT flow by providing xsa file as input to petalinux-config.

• system-device-tree: Using system-device-tree, you can also build the images without relying on XSCT.
The input to petalinux-config is system-device-tree instead of XSA

Note: For 2024.1 release, SDT support is provided only for ZynqMP and Versal. This does not include Kria,
System Controller, Zynq, MicroBlaze, and EmbeddedPlus.

More details can be found in this link https://github.com/Xilinx/system-device-tree-xlnx

Note: The pre-built images that are delivered as part of PetaLinux BSPs, source code, and configurations
are provided for demonstration purposes only and change to are not suitable outside of a development
environment, including for production purposes. Before production and deployment of any Linux-based
system, it is recommended that all relevant security updates are applied, and a mechanism for in-field
updates is made available throughout the lifetime of the relevant product

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 7
Chapter 1: Overview

New Features in 2024.1

Table 1: New Features

Sr No. New Features Section


1 Removed RHEL and CENTOS support Installation Requirements
Remove OS support for Ubuntu 18.04.1 LTS, 18.04.2 LTS,
18.04.3 LTS, 18.04.4 LTS, 18.04.5 LTS, 18.04.06 LTS
Add OS support for ubuntu 22.04.3 LTS version
2 New BSPs added in 2024.1. VEK280 Production Silicon BSP.
3 Sunset BSPs Removed zcu1275 and zcu1285 BSPs.

Yocto Extensible SDK

The following table details the three extensible SDKs installed.

Table 2: Extensible SDKs

Path Architecture
PETALINUX/components/yocto/aarch64 AMD Zynq™ UltraScale+™ MPSoC and AMD Versal™ adaptive
SoC.
PETALINUX/components/yocto/arm AMD Zynq™ 7000 devices.
PETALINUX/components/yocto/microblaze MicroBlaze™ platform.

Note: Earlier, the eSDKs were extracted in the specified path, but now they are in self-extractable TAR
files. From the 2021 release onwards, your eSDK scripts have the same names. They are extracted into
<plnx-proj-root>/components/yocto when you run the petalinux-config or the
petalinux-build command in the PetaLinux project. The project extracts the corresponding eSDK; for
example, if you create a Zynq UltraScale+ MPSoC project, only the aarch64 eSDK is extracted into the
<plnx-proj-root>/components/yocto project.

XSCT and tool chains

PetaLinux tool uses the XSCT underneath to configure and build all the embedded software
applications.

XSCT tool chain path: $PETALINUX/components/xsct

PetaLinux Command Line Interface (CLI) tools

This contains all the PetaLinux commands that you require. The CLI command tools are:

Note: From 2024.1 onwards, PetaLinux uses the Python interface for the command line utils as going
towards Open sourcing.

• petalinux-create
• petalinux-config

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 8
Chapter 1: Overview

• petalinux-build
• petalinux-util
• petalinux-package
• petalinux-upgrade
• petalinux-devtool
• petalinux-boot

Navigating Content by Design Process


AMD Adaptive Computing documentation is organized around a set of standard design
processes to help you find relevant content for your current development task. You can access
the AMD Versal™ adaptive SoC design processes on the Design Hubs page. You can also use the
Design Flow Assistant to better understand the design flows and find content that is specific to
your intended design needs.

• Embedded Software Development: Creating the software platform from the hardware
platform and developing the application code using the embedded CPU. Also covers XRT and
Graph APIs. Topics in this document that apply to this design process include:

• Chapter 3: Creating a Project


• Chapter 4: Configuring and Building
• Chapter 5: Packaging and Booting
• Chapter 7: Customizing the Project
• Chapter 8: Customizing the Root File System

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 9
Chapter 2: Setting Up Your Environment

Chapter 2

Setting Up Your Environment

Installation Steps
Installation Requirements
The PetaLinux tools installation requirements are:

• Minimum workstation requirements:


○ 8 GB RAM (recommended minimum for AMD tools)

○ 2 GHz CPU clock or equivalent (minimum of eight cores)

○ 100 GB free HDD space

○ Supported OS:
- Completely removed RHEL and CENTOS to align with upstream Yocto.
- Ubuntu Desktop/Server 20.04.2 LTS, 20.04.3 LTS, 20.04.4 LTS, 20.04.5 LTS(64-
bit),20.04.6 LTS, 22.04 LTS, 22.04.1 LTS, 22.04.2 LTS, and 22.04.3 LTS
- OpenSuse Leap 15.3 and 15.4
- AlmaLinux 8.7 and 9.1
• You need access to install the required packages mentioned in the release notes. The
PetaLinux tools need to be installed as non-root users.
• PetaLinux requires standard development tools and libraries installed on your Linux host
workstation. Install the libraries and tools listed in the release notes on the host Linux.
• PetaLinux tools require your host system /bin/sh to be 'bash.' If you use Ubuntu distribution
and your /bin/sh is 'dash,' consult your system administrator to change your default system
shell /bin/sh with the sudo dpkg-reconfigure dash command.

Note: For package versions, refer to the PetaLinux 2024.1 Release Notes and Master Answer Record:
000035006.

CAUTION! Consult your system administrator if unsure about the correct host system package
management procedures.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 10
Chapter 2: Setting Up Your Environment

IMPORTANT! PetaLinux 2024.1 works only with hardware designs exported from AMD Vivado™ Design
Suite 2024.1.

Prerequisites
• The PetaLinux tools installation requirements are met. See the Installation Requirements for
more information.
• The PetaLinux installer is downloaded. You can download the PetaLinux installer from
PetaLinux Downloads.

Installing the PetaLinux Tool


The PetaLinux tool is installed into the current working directory by default, if the installer is run
without any options.

chmod 755 ./petalinux-v<petalinux-version>-final-installer.run


./petalinux-v<petalinux-version>-final-installer.run

Alternatively, you can specify an installation path.

./petalinux-v<petalinux-version>-final-installer.run [--log <LOGFILE>] [-


d|--dir <INSTALL_DIR>] [options]

Table 3: PetaLinux Installer Options

Options Description
--log <LOGFILE> Specifies where the log file should be created. By default, it
is petalinux_installation_log in your working
directory.
-y Using '-y' means yes for all the prompts while installing the
tool. Which will also skips the License acceptance.
-D Enable verbose prints on console.
-d|--dir [INSTALL_DIR] Specifies the directory where you want to install the tool kit.
If not specified, the tool kit is installed in your working
directory.
-p|--platform <arch_name> Specifies the architecture:
• aarch64: Sources for Zynq UltraScale+ MPSoC devices
and Versal devices.
• arm: sources for Zynq devices.
• microblaze: sources for MicroBlaze devices. If -p is not
specified, it installs all the platforms by default.

For example: To install PetaLinux tools at /home/<user>/petalinux/<petalinux-


version>:

mkdir -p /home/<user>/petalinux/<petalinux-version>
./petalinux-v<petalinux-version>-final-installer.run --dir /home/<user>/
petalinux/<petalinux-version>

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 11
Chapter 2: Setting Up Your Environment

Note: You cannot install PetaLinux as the root user. If you try to run PetaLinux commands as root, you
might get a BitBake sanity check failure that prevents the build from continuing. This check is done
because it is very risky to run builds as root; if any build script mistakenly tries to install files to the root
path (/) instead of where it is supposed to, it must be made to fail immediately and not (in the worst case)
overwrite files critical to your Linux system's operation, for example, in /bin or /etc. Thus, running the
build as root is not supported. The only time root access is needed (completely outside of a build) when the
runqemu script uses sudo to set up TAP devices for networking.

This installs the PetaLinux tool into the /home/<user>/petalinux/<petalinux-


version> directory. By default, it installs all three eSDKs compressed script files. To install a
specific eSDK as part of the PetaLinux tool, see Installing a Preferred eSDK as part of the
PetaLinux Tool.

IMPORTANT! You cannot move or copy the installed directory once installed. In the previous example,
you cannot move or copy /home/<user>/petalinux/<petalinux-version> because the full
path is stored in the Yocto e-SDK environment file.

Note: While installing the software, ensure that /home/<user>/petalinux is writable for you. After
installation, you can change the permissions to make it globally read-execute (0755). Installing the tool in /
home/<user>/petalinux directory is not mandatory. You can install it at any location that has the 755
permissions.

Reading and agreeing to the PetaLinux End User License Agreement (EULA) is integral to the
PetaLinux tools installation process. You can read the license agreement before running the
installation by reading the following files. If you wish to keep the license for your records, the
licenses are available in plain ASCII text in the following files:

• $PETALINUX/license/petalinux_EULA.txt: EULA specifies the rights and restrictions


that apply to PetaLinux.

• $PETALINUX/license/Third_Party_Software_EULA.txt: This third-party license


agreement details the licenses of the distributable and non-distributable components in
PetaLinux tools.

Installing a Preferred eSDK as part of the PetaLinux Tool


As described in Installing the PetaLinux Tool, the PetaLinux tool has three eSDKs: aarch64, arm,
and MicroBlaze.

While installing the tool, you can specify your preferred eSDK, for example, if you are working on
a Zynq platform, you can opt to install the Arm eSDK into the PetaLinux tool.

By default, all platform eSDKs are installed into the tool install directory. To install the desired
eSDK, follow these examples:

• To install eSDKs for all AMD-supported architectures like Zynq, Zynq UltraScale+ MPSoC,
Versal, MicroBlaze:
./petalinux-v<petalinux-version>-final-installer.run --dir <INSTALL_DIR>

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 12
Chapter 2: Setting Up Your Environment

• To install only the Zynq eSDK for arm architecture:


./petalinux-v<petalinux-version>-final-installer.run --dir <INSTALL_DIR>
--platform "arm"

• To install the Zynq, Zynq UltraScale+ MPSoC, and Versal devices eSDKs for arm and aarch64
architecture:
./petalinux-v<petalinux-version>-final-installer.run --dir <INSTALL_DIR>
--platform "arm aarch64"

• To install MicroBlaze device eSDKs for MicroBlaze architecture:


./petalinux-v<petalinux-version>-final-installer.run --dir <INSTALL_DIR>
--platform "microblaze"

Troubleshooting
This section describes some common issues you can experience while installing the PetaLinux
tool. If the PetaLinux tool installation fails, the file petalinux_installation_log is
generated in your PetaLinux installation directory.

Table 4: PetaLinux Installation Troubleshooting

Problem / Error Message Description and Solution


WARNING: You have less than 1 GB Problem Description:
free space on the installation This warning message indicates that the installation drive is almost full. After
drive the installation, it's possible that you might not have sufficient available
space to carry out the development of the hardware or software project.
Solution:
Clean up the installation drive to clear some more free space.
Alternatively, move the PetaLinux installation to another hard disk drive.
WARNING: No tftp server found Problem Description:
This warning message indicates that you do not have a TFTP service running
on the workstation. Without a TFTP service, you cannot download Linux
system images to the target system using the U-Boot network/TFTP
capabilities. This warning can be ignored for other boot modes.
Solution:
Enable the TFTP service on your workstation. Contact your system
administrator if you are unsure how to enable this service.
ERROR: GCC is not installed - Problem Description:
unable to continue. Please This error message indicates that you do not have gcc installed on the host
install and retry workstation.
Solution:
Install gcc using your Linux workstation package management system. If you
are unsure how to do this, contact your system administrator. See
Installation Steps.
ERROR: You are missing the Problem Description:
following system tools required This error message indicates that you do not have the required tools or
by PetaLinux: missing-tools-list libraries listed in the "missing-tools-list" or "missing-library-list."
or Solution:
ERROR: You are missing these Install the packages of the missing tools. For more information, see
development libraries required by Installation Requirements.
PetaLinux: missing-library-list

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 13
Chapter 2: Setting Up Your Environment

Table 4: PetaLinux Installation Troubleshooting (cont'd)

Problem / Error Message Description and Solution


./petalinux-v<petalinux-version>- Problem Description:
final-installer.run: line 52: This error message indicates that the PetaLinux installed directory does not
petalinux_installation_log: have writable permissions.
Permission denied
Solution:
Set 755 permissions to the install directory.

PetaLinux Working Environment Setup


After the installation, the remaining setup is completed by sourcing the provided settings
scripts.

Prerequisites
This section assumes that the PetaLinux tools installation is complete. For more information, see
Installation Steps.

Steps to Set Up PetaLinux Working Environment


1. Source the appropriate settings script. PetaLinux can work with any interactive shell, and
examples are as follows:
• For Bash as a user shell:
source <path-to-installed-PetaLinux>/settings.sh

• For C shell as a user shell:


Note: From 2024.2 onwards PetaLinux settings.csh support will be deprecated. Recommend to use
the settings.sh from bash.

source <path-to-installed-PetaLinux>/settings.csh

Following is an example of the output when sourcing the setup script for the first time:
PetaLinux environment set to '/opt/pkg/petalinux'
INFO: Checking free disk space
INFO: Checking installed tools
INFO: Checking installed development libraries
INFO: Checking network and other services
WARNING: No tftp server found - please refer to "UG1144 <petalinux-
version> PetaLinux Tools Documentation Reference Guide" for its impact
and solution

2. Verify that the working environment has been set:


echo $PETALINUX

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 14
Chapter 2: Setting Up Your Environment

Example output: /opt/pkg/petalinux


Environment variable $PETALINUX should point to the installed PetaLinux path. The output
can differ from this example based on the PetaLinux installation path.

Troubleshooting
This section describes some common issues that you can experience while setting up PetaLinux
Working Environment.

Table 5: PetaLinux Working Environment Troubleshooting

Problem / Error Message Description and Solution


WARNING: /bin/sh is not Problem Description:
bash This warning message indicates that your default shell is linked to dash.
Solution:
PetaLinux tools require your host system /bin/sh is bash. If you are using Ubuntu
distribution and your /bin/sh is dash, consult your system administrator to change
your default host system /bin/sh with the sudo dpkg-reconfigure dash
command.
Failed to open PetaLinux Problem Description:
lib This error message indicates that a PetaLinux library failed to load. The possible
reasons are:
• The PetaLinux settings.sh has not been loaded.
• The Linux Kernel that is running has SELinux configured. This can cause issues
with regards to security context and loading libraries.
Solution:
1. Source the settings.sh script from the top-level PetaLinux directory. For more
information, see PetaLinux Working Environment Setup.
2. If you have SELinux enabled, determine if SELinux is in enforcing mode. If
SELinux is configured in enforcing mode, either reconfigure SELinux to
permissive mode (see the SELinux manual) or change the security context of the
libraries to allow access.

cd $PETALINUX/tools/xsct/lib/lnx64.o

chcon -R -t textrel_shlib_t lib

Design Flow Overview


In general, the PetaLinux tool follows a sequential workflow model. The following table provides
an example design workflow, demonstrating the order in which the tasks should be completed
and the corresponding tool or workflow for that task.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 15
Chapter 2: Setting Up Your Environment

Table 6: Design Flow Overview

Design Flow Step Tool / Workflow


Hardware platform creation (for custom hardware only) AMD Vivado™ design tools
Create a PetaLinux project petalinux-create project

Initialize a PetaLinux project (for custom hardware only) petalinux-config --get-hw-description

Configure system-level options petalinux-config

Create user components petalinux-create apps petalinux-create modules

Configure U-Boot petalinux-config -c u-boot

Configure the Linux kernel petalinux-config -c kernel

Configure the root filesystem petalinux-config -c rootfs

Build the system petalinux-build

Package for deploying the system petalinux-package

Boot the system for testing petalinux-boot

Upgrades the workspace petalinux-upgrade

Use Yocto devtools command petalinux-devtool

Use debug utilities petalinux-util

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 16
Chapter 3: Creating a Project

Chapter 3

Creating a Project

Creating a Project Using PetaLinux BSP


PetaLinux board support packages (BSPs) are reference designs on supported boards for you to
start working with and customizing your projects. In addition, these designs can be used as a
basis for creating your projects on supported boards. PetaLinux BSPs are provided as BSP files,
including all necessary design and configuration files, pre-built and tested hardware, and software
images ready for downloading on your board or booting in the QEMU system emulation
environment. You can download a BSP to any location of your choice.

BSPs are not included in the PetaLinux tools installer and need to be downloaded separately.
PetaLinux BSP packages are available on the Xilinx.com Download Center. A README is
available for each BSP.

Note: Download only the BSPs you need.

CAUTION! BSPs can cause conflict with custom board settings. If you are using a custom board, create a
project using template flow and import the custom board design with petalinux-config --get-
hw-description.

Prerequisites
This section assumes that the following prerequisites are satisfied:

• PetaLinux BSP is downloaded. You can download PetaLinux BSP from PetaLinux Downloads.
• PetaLinux working environment setup is completed. For more details, see PetaLinux Working
Environment Setup.

Creating a Project from a BSP


1. Change to the directory under which you want PetaLinux projects to be created. For
example, if you want to create projects under /home/user:
cd /home/user

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 17
Chapter 3: Creating a Project

2. Run petalinux-create command on the command console:


petalinux-create project -s <path-to-bsp>

The board being referenced is based on the BSP installed. The output is similar to the
following output:
INFO: Create project:
INFO: Projects:
INFO: * xilinx-zcu102-v<petalinux-version>
INFO: has been successfully installed to /home/user/
INFO: New project successfully created in /home/user/

In the previous example, when the command runs, it tells you the project is extracted and
installed from the BSP. If the specified location is on the Network File System (NFS), it
changes the project's TMPDIR to /tmp/<projname-timestamp-id>; otherwise, it is set
to $PROOT/build/tmp

CAUTION! Do not create the symbolic link to an NFS file system from a local file system. You cannot
use NFS to locate the ‘tmp’ directory in the build; it fails.

Note: PetaLinux requires a minimum of 50 GB and a maximum of 100 GB space on TMPDIR to build
the project successfully when you create the project on NFS.

If /tmp/<projname_timestamp-id> is also on NFS, it throws an error. You can change


TMPDIR while creating the PetaLinux project using the following command:
petalinux-create project -s <PATH_TO_PETALINUX_PROJECT_BSP> --tmpdir
<TMPDIR PATH>

Alternatively, you can create or modify it anytime using petalinux-config → Yocto-settings.


Do not configure the same location as TMPDIR for two different PetaLinux projects, as it can
cause build errors.
Run ls from /home/user to see the created project(s). For more details on the structure of
a PetaLinux project, see Appendix C: PetaLinux Project Structure.

CAUTION! Do not create PetaLinux projects in the tool install area or use the tool install area as a tmp
build area.

To enable XRT if not enabled in BSP, see Create PetaLinux Project with XRT.

Troubleshooting
This section describes some common issues you can experience while installing PetaLinux BSP.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 18
Chapter 3: Creating a Project

Table 7: PetaLinux BSP Installation Troubleshooting

Problem / Error Message Description and Solution


petalinux-create: command not found Problem Description:
This message indicates that it is unable to find petalinux-
create command and therefore it cannot proceed with BSP
installation.
Solution:
You have to setup your environment for PetaLinux tools. For
more information, see the PetaLinux Working Environment
Setup.

Configuring a Hardware Platform with Vivado


Design Suite
This section describes how to make a hardware platform ready for PetaLinux using Vivado tool.

Configuring a Hardware Platform for Linux


You can create your hardware platform with AMD Vivado™ tools. Regardless of how the
hardware platform is created and configured, a small number of hardware IP and software
platform configuration settings are required to make the hardware platform Linux ready. These
are described as following:

Zynq UltraScale+ MPSoC and Versal Adaptive SoC

The following is a list of hardware requirements for an AMD Zynq™ UltraScale+™ MPSoC and an
AMD Versal™ adaptive SoC hardware project to boot Linux:

• External memory of at least 2 GB (required).


• UART for serial console (required).
• Non-volatile memory, for example, QSPI flash and SD/MMC. This memory is optional, without
which only JTAG boot can work.
• Ethernet (optional, essential for network access).

IMPORTANT! If soft IP with an interrupt or external PHY device with an interrupt is used, ensure the
interrupt signal is connected.

Zynq 7000 Devices

The following is a list of hardware requirements for a Zynq 7000 hardware project to boot Linux:

• One Triple Timer Counter (TTC) (required).

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 19
Chapter 3: Creating a Project

IMPORTANT! If multiple TTCs are enabled, the Zynq 7000 Linux kernel uses the first TTC block from
the device tree. Make sure others do not use the TTC.

• External memory controller with at least 512 MB of memory (required).


• UART for serial console (required).
• Non-volatile memory, for example, QSPI flash and SD/MMC. This memory is optional, but
only the JTAG boot can work.
• Ethernet (optional, essential for network access).

IMPORTANT! If soft IP is used, ensure the interrupt signal is connected. If soft IP with an interrupt or an
external PHY device with an interrupt is used, ensure the interrupt signal is connected.

MicroBlaze processors (AXI)

The following is a list of requirements for a MicroBlaze™ hardware project to boot Linux:

• IP core checklist:
○ External memory controller with at least 512 MB of memory (required)

○ Dual channel timer with interrupt connected (required)

○ UART with interrupt connected for serial console (required)

○ Non-volatile memory such as Linear Flash or SPI Flash (required)

○ Ethernet with interrupt connected (optional, but required for network access)

• MicroBlaze processor configuration:


○ MicroBlaze processor initial boot loader fs-boot needs a minimum of 4 KB of block RAM
for parallel flash and 8 KB for SPI flash when the system boots from non-volatile memory.

Note: PetaLinux only supports 32-bit MicroBlaze processors.

Note: Do not disable any instruction set-related options enabled by the template unless you understand
the implications of such a change.

Exporting a Hardware Platform to PetaLinux


Project
This section describes how to export a hardware platform to a PetaLinux project.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 20
Chapter 3: Creating a Project

Prerequisites
This section assumes that a hardware platform is created with the Vivado Design Suite. For more
information, see Configuring a Hardware Platform with Vivado Design Suite.

Exporting a Hardware Platform


After you have configured your hardware project, the PetaLinux project requires a hardware
description file (.xsa file) with information about the processing system. You can get the
hardware description file by running Export Hardware from the AMD Vivado™ Design Suite.

During project initialization (or update), PetaLinux generates a device tree source file, U-Boot
configuration header files (MicroBlaze processors only), and enables the Linux kernel drivers
(MicroBlaze processors only) based on the hardware description file. These details are discussed
in Appendix C: PetaLinux Project Structure.

Creating an Empty Project from a Template


This section describes how to create an empty project from a template. Projects created from
templates must be configured to an actual hardware instance before they can be built for a
custom Vivado design.

Prerequisites
This section assumes that the PetaLinux working environment setup is complete. For more
information, see PetaLinux Working Environment Setup.

Creating an Empty Project


The petalinux-create command is used to create a new PetaLinux project:

petalinux-create project --template <PLATFORM> --name <PROJECT_NAME>

The parameters are as follows:

• --template <PLATFORM> - The following platform types are supported:


○ versal (for Versal adaptive SoC)

○ zynqMP (for Zynq UltraScale+ MPSoC)

○ zynq (for Zynq 7000 devices)

○ microblaze (for MicroBlaze processor)

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 21
Chapter 3: Creating a Project

Note: The MicroBlaze template option cannot be used with Zynq 7000 devices or Zynq UltraScale+
or Versal designs in the Programmable Logic (PL).

• --name <PROJECT_NAME> - The name of your project.


This command creates a new PetaLinux project folder from a default template.

For more information, see Importing Hardware Configuration.

CAUTION! When a PetaLinux project is created on NFS, petalinux-create automatically changes its
TMPDIR to /tmp/<projname-timestamp> . If /tmp is on NFS, it throws an error. You can change the
TMPDIR to local storage while creating the PetaLinux project by running petalinux-create
project -s <PATH_TO_PETALINUX_PROJECT_BSP> --tmpdir <TMPDIR PATH> or
selecting petalinux-config → Yocto-settings → TMPDIR. Do not configure the same location as TMPDIR
for two different PetaLinux projects. This can cause build errors. If TMPDIR is at /tmp/.., deleting the
project does not delete the TMPDIR. To delete the TMPDIR, run petalinux-build -x mrproper.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 22
Chapter 4: Configuring and Building

Chapter 4

Configuring and Building

Version Control
This section details about version management/control in PetaLinux project.

Prerequisites
This section assumes that you have created a new PetaLinux project or have an existing
PetaLinux project. See Creating an Empty Project from a Template for more information on
creating a PetaLinux project.

Version Control
You can have version control over your PetaLinux project directory <plnx-proj-root>,
excluding the following:

• <plnx-proj-root>/.petalinux
• <plnx-proj-root>/!.petalinux/metadata
• <plnx-proj-root>/build/
• <plnx-proj-root>/images/linux
• <plnx-proj-root>/pre-built/linux
• <plnx-proj-root>/components/plnx-workspace/
• <plnx-proj-root>/components/yocto/
• <plnx-proj-root>/*/*/config.old
• <plnx-proj-root>/*/*/rootfs_config.old
• <plnx-proj-root>/*.o
• <plnx-proj-root>/*.log
• <plnx-proj-root>/*.jou

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 23
Chapter 4: Configuring and Building

By default, these files are added into <plnx-proj-root>/.gitignore while creating the
project.

Note: A PetaLinux project should be cleaned using petalinux-build -x mrproper before submitting
to the source control.

Note: In concurrent development, TMPDIR in petalinux-config should be unique for each user.

Importing Hardware Configuration


This section explains the process of updating an existing/newly created PetaLinux project with a
new hardware configuration. This enables you to make the PetaLinux tools software platform
ready for building a Linux system, customized to your new hardware platform.

Prerequisites
This section assumes that the following prerequisites are satisfied:

• You have exported the hardware platform and .xsa file is generated. For more information, see
Exporting a Hardware Platform.
• You have created a new PetaLinux project or have an existing PetaLinux project. For more
information on creating a PetaLinux project, see Creating an Empty Project from a Template.

Importing a Hardware Configuration


Steps to import hardware configuration are:

1. Change into the directory of your PetaLinux project.


cd <plnx-proj-root>

2. Import the hardware description with petalinux-config command using the following
steps:
• Using path of the directory containing the .xsa file:
petalinux-config --get-hw-description <PATH-TO-XSA Directory>

Or
• Using the XSA file path as follows:
When you have multiple XSA files in a specified folder petalinux-config gives you an
error. To avoid these kind of errors you can provide complete XSA file path as follows:
petalinux-config --get-hw-description <PATH-TO-XSA-FILE>

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 24
Chapter 4: Configuring and Building

3. Note: Changing the XSA file in the <PATH-TO-XSA directory> later gives an INFO: Seems like your
hardware design:<PATH-TO-XSA Directory>/system.xsa has changed warning for all subsequent
executions of the petalinux-config/petalinux-build commands. This means that your XSA
has changed. To use the latest XSA, run petalinux-config --get-hw-description again.

4. This launches the top system configuration menu. When the petalinux-config --get-
hw-description command runs for the PetaLinux project, the tool detects the changes in
the imported hardware design and launches the menu.

Figure 1: System Configuration Menu

Ensure DTG Settings → (template) MACHINE_NAME is selected and use the option as follows:

• Keep the BSP setting as AUTO when using an AMD evaluation board with the default BSP/
hardware project. The DTG machine configuration is automatically determined based on your
specific design.
• For the custom board, keep the default value.
• For customized hardware design implemented on an AMD evaluation board, use the values in
the following table.

Table 8: BSP and Machine Names

BSP Machine
ZCU102 zcu102-rev1.0
ZCU104 zcu104-revc
ZCU106 zcu106-reva
ZCU111 zcu111-reva
ZCU1275 zcu1275-revb
ZCU1285 zcu1285-reva
ZCU216 zcu216-reva
ZCU208 zcu208-reva

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 25
Chapter 4: Configuring and Building

Table 8: BSP and Machine Names (cont'd)

BSP Machine
ZCU670 zcu670-revb
ZCU208-SDFEC zcu208-reva
ZCU100 zcu100-revc
ZC702 zc702
ZC706 zc706
ZEDBOARD zedboard
AC701 ac701-full
KC705 kc705-full
KCU105 kcu105
VCU118 vcu118-rev2.0
SP701 sp701-rev1.0
VCK190 versal-vck190-reva-x-ebm-01-reva
VPK120 versal-vpk120-reva
VMK180 versal-vmk180-reva-x-ebm-01-reva
VPK180 versal-vpk180-reva
VEK280 versal-vek280-revb

Ensure Subsystem AUTO Hardware Settings is selected, and go into the menu which is similar to
the following:

Figure 2: Subsystem AUTO Hardware Settings

The Subsystem AUTO Hardware Settings → menu allows customizing system-wide hardware
settings. You have a choice to select the processor, memory bank, serial console, or flash.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 26
Chapter 4: Configuring and Building

This step can take a few minutes to complete because the tool parses the hardware description
file for hardware information required to update the device tree, PetaLinux U-Boot configuration
files (only for MicroBlaze), and the kernel config files (only for MicroBlaze) based on the “Auto
Config Settings --->” and “Subsystem AUTO Hardware Settings --->” settings.

Note: For more details on the Auto Config Settings menu, see the Auto Config Settings.

Silentconfig
The --silentconfig option allows you to reuse a prior configuration. Old configurations have
the file name CONFIG.old within the directory containing the specified component for
unattended updates.

You can change the configurations without opening system level configuration menu. You can
directly edit <plnx-proj-root>/project-spec/configs/config file and issue
petalinux-config --silentconfig.

Building a System Image


Prerequisites
This section assumes that you have PetaLinux tools software platform ready for building a Linux
system that is customized to your hardware platform. For more information, see Importing
Hardware Configuration.

Building a PetaLinux System Image


1. Change into the directory of your PetaLinux project.
cd <plnx-proj-root>

2. Run petalinux-build to build the system image:


petalinux-build

This step generates a device tree DTB file, a first stage boot loader (for Zynq 7000 devices,
Zynq UltraScale+ MPSoC, and MicroBlaze), PLM (for Versal adaptive SoC), PSM (for Versal
adaptive SoC) and TF-A (for Zynq UltraScale+ MPSoC and Versal adaptive SoC), U-Boot, the
Linux kernel, a root file system image, and the U-Boot boot script (boot.scr). Finally, it
generates the necessary boot images.
3. The compilation progress shows on the console. Wait until the compilation finishes.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 27
Chapter 4: Configuring and Building

TIP: A detailed compilation log is in <plnx-proj-root>/build/build.log.

When the build finishes, the generated images are stored in the <plnx-proj-root>/images/
linux and /tftpboot directories.

The console shows the compilation progress. For example:

petalinux-build
[INFO] Building project
[INFO] Extracting yocto SDK to components/yocto. This may take time!
[INFO] Getting Platform info from HW file
[INFO] Generating Kconfig for project
[INFO] Silentconfig project
[INFO] Generating kconfig for rootfs
[INFO] Silentconfig rootfs
[INFO] Generating configuration files
[INFO] Adding user layers
[INFO] Generating machine conf file
[INFO] Generating plnxtool conf file
[INFO] Generating workspace directory
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup/build/cache/
prserv.sqlite3, Address: 127.0.0.1:40371, PID: 2736
INFO: Specified workspace already set up, leaving as-is
INFO: Enabling workspace layer in bblayers.conf
[INFO] bitbake petalinux-image-minimal
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup/build/cache/
prserv.sqlite3, Address: 127.0.0.1:38405, PID: 2812
Loading cache: 100%
|
| ETA: --:--:--
Loaded 0 entries from dependency cache.
Parsing recipes: 100% |
############################################################################
#####################| Time: 0:00:27
Parsing of 4478 .bb files complete (0 cached, 4478 parsed). 6427 targets,
384 skipped, 2 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
NOTE: Fetching uninative binary shim file:///wrk/everest_fcv_nobkup/
kavyasre/_logs_/_vck190_/xilinx-vck190-2024.1/components/yocto/downloads/
uninative/5fab9a5c97fc73a21134e5a81f74498cbaecda75d56aab971c934e0b803bcc00/
x86_64-nativesdk-
libc-3.8.1.tar.xz;sha256sum=5fab9a5c97fc73a21134e5a81f74498cbaecda75d56aab97
1c934e0b803bcc00 (will check PREMIRRORS first)
Initialising tasks: 100% |
############################################################################
##################| Time: 0:00:05
Checking sstate mirror object availability: 100% |
######################################################################|
Time: 0:00:41
Sstate summary: Wanted 1822 Local 0 Mirrors 1121 Missed 701 Current 0 (61%
match, 0% complete)
NOTE: Executing Tasks
WARNING: zocl-202320.2.17.0-r0 do_package_qa: QA Issue: File /lib/modules/
6.6.10-xilinx-v2024.1-ga33033bade74/updates/zocl.ko in package kernel-
module-zocl-6.6.10-xilinx-v2024.1-ga33033bade74 contains reference to
TMPDIR [buildpaths]
NOTE: Tasks Summary: Attempted 4918 tasks of which 4069 didn't need to be
rerun and all succeeded.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 28
Chapter 4: Configuring and Building

Summary: There was 1 WARNING message.


[INFO] Failed to copy built images to tftp dir: /tftpboot
[INFO] Successfully built project

Default Boot Images


When you run petalinux-build, it generates FIT images for Versal adaptive SoC, Zynq
UltraScale+ MPSoC, Zynq 7000 devices, and MicroBlaze platforms. The RAM disk image
rootfs.cpio.gz.u-boot is also generated.

The full compilation log build.log is stored in the build sub-directory of your PetaLinux
project. The final image, <plnx-proj-root>/images/linux/image.ub, is a FIT image. The
kernel image (including RootFS, initramfs, if any,) is Image for Zynq UltraScale+ MPSoC and
Versal platform, zImage for Zynq 7000 devices, and image.elf for MicroBlaze processors. The
build images are located in the <plnx-proj-root>/images/linux directory. A copy is also
placed in the /tftpboot directory if the option is enabled in the system-level configuration for
the PetaLinux project.

IMPORTANT! By default, besides the kernel, RootFS, and U-Boot, the PetaLinux project is configured to
generate and build the other boot components for AMD Zynq™ FSBL, for Zynq UltraScale+ MPSoC FSBL
and PMU firmware and for Versal PLM and PSM firmware . For more details on the auto generated boot
components, see Appendix D: Generating Boot Components.

Troubleshooting
This section describes some common issues/warnings you can experience while building a
PetaLinux image.

Warnings/Errors

Table 9: Warnings/Errors Description

Warning or Error Message Description Solution


Skipping recipe linux-xlnx as it It appears if the provided recipe You can ignore this warning message.
does not produce a package with name does not match with the
the same name packages provided by it, for
example, if linux-xlnx provides
kernel-image, kernel-base, kernel-
dev, and kernel-modules
packages and these does not
match with the name linux-xlnx
which was in workspace directory.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 29
Chapter 4: Configuring and Building

Table 9: Warnings/Errors Description (cont'd)

Warning or Error Message Description Solution


WARNING: TMPDIR buildpath warnings are These warnings can be ignored safely as there is no
mc:cortexa53-0-zynqmp-fsbl- observed on several packages functional issue.
baremetal:uartps-2024.1+gitAUTO while building sdt bsp.
INC+f9813dcf08-r0do_package_qa:
QA Issue: File /usr/lib/libuartps.a
in package uartps-staticdev
contains reference to TMPDIR
[buildpaths]
<package-name> do_package: When the tool is installed, all
Could not copy license file <plnx- license files in <plnx-proj- • Method 1: Manually modify permissions of the license
proj-root>/components/ root>/components/yocto// files coming from the layers chmod 666 <plnx-proj-
yocto/layers/core/meta/ layers/core/meta/files/ root>/components/yocto/layers/core/meta/
files/common-licenses/ common-licenses/ have 644 files/common-licenses/*
to /opt/pkg/petalinux/ permissions. Therefore, they are When creating the hard link, you have write
build/tmp/work/<machine- readable by others but not permissions to the source of the link.
name>-xilinx-linux/ writable.
image/usr/share/licenses/ • Method 2: Disable hard linking protection on the
<package-name>/COPYING.MIT kernelsysctl fs.protected_hardlinks=0
The kernel does not allow the source to be writable by
[Errno 1] Operation not the current user when creating the hard link.
permitted:
• Method 3: Set the following Yocto variables in <plnx-
proj-root>/meta-user/conf/petalinuxbsp.conf
LICENSE_CREATE_PACKAGE_forcevariable = "0"
SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "none"
The build system does not try to create the link and the
license is not on the final image.

Note: It is recommended to use the troubleshooting


solutions specified in method 1 and method 3 because
method 2 requires all the users to have sudo access.

System Devicetree flow to Build Images


Setting Up the System Devicetree
Before proceeding, be sure to place the system device-tree files provided by the hardware
developer in a location accessible by the user who will be running the PetaLinux builds.

Generate the system device-tree files using the steps mentioned on the: System Device Tree
Generator from xsa.

For Building Project refer Chapter 4: Configuring and Building.

For Booting refer Chapter 5: Packaging and Booting.

Note: SDT flow in PetaLinux is supported only for ZynqMP and AMD Versal™ BSPs only, SOM and SC
BSP's are excluded.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 30
Chapter 4: Configuring and Building

Building the project using Template Flow


1. Source the installed PetaLinux tool:
source /opt/petalinux/settings.sh

2. Create the project:


petalinux-create project -n <myproj> --template <versal/zynqMP>

3. Go to the PetaLinux project:


cd myproj

4. Configure the project with the above generated system device-tree:


petalinux-config --get-hw-description <sdt-path-dir>

5. Build the project:


petalinux-build

6. Perform qemu boot/hardware boot:


petalinux-boot --qemu/--jtag

Building the project using BSP Flow


1. Source the installed PetaLinux tool:
source /opt/petalinux/settings.sh

2. Create the PetaLinux project using the following command:


petalinux-create -t project -s xilinx-vmk180-sdt-v2024.1-
final.bsp(downloaded .bsp path)

3. Go to project:
cd xilinx-vmk180-sdt-2024.1/

4. Build the project:


petalinux-build

5. Perform qemu/hw boot:


petalinux-boot --qemu/--jtag

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 31
Chapter 4: Configuring and Building

Building multiconfig Applications


In SDT flow, PetaLinux is capable of building multi-domain applications such as baremetal, r5,
and freertos. By default, multiconfigs are set to minimal domains, enable the required multiconfig
domains to build the specific domain applications.

Figure 3: Multiconfig Application

If you want to build multiconfig Applications, go to petalinux-config → Yocto Settings →


Multiconfig Targets and select the required target.

If you want to build specific application, perform the following steps:

1. To build baremetal fsbl, run the following command:


petalinux-build -c "multiconfig:cortexa53-0-zynqmp-fsbl-baremetal:fsbl-
firmware"

2. To build hello-world baremetal app, run the following command:


petalinux-build -c "multiconfig:cortexa53-0-zynqmp-fsbl-baremetal:hello-
world"

• The supported multiconfig applications can be found here.


• Follow the link to build Multiconfig firmware.
• Follow the link for Multiconfig drivers.
• Follow the link for Multiconfig libraries.
Note: The build application/driver/firmware/library, elf or bin can be found in <plnx-
proj>/build/tmp-multiconfig/tm-machine-name/deploy/images.

Ex: /tmp/xilinx-zcu102-sdt-2024.1-2024.03.13-06.51.58-msN-multiconfig/tmp-cortexa53-0-zynqmp-
baremetal/deploy/images/xlnx-zynqmp-zcu102-rev1-0/gpiops-example

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 32
Chapter 4: Configuring and Building

Table 10: Simple Domain Specific Machine Names Mapping

Domain/Processor Name Machine Name Notes


cortexa53MULTIDRAG cortexa53-0-zynqmp-fsbl-baremetal Use Machine cortexa53-0-zynqmp-
cortexa53-0-zynqmp-baremetal fsbl-baremetal for compiling
cortexa53-0-zynqmp-freertos fsbl
cortexa53-1-zynqmp-baremetal
cortexa53-1-zynqmp-freertos
cortexa53-2-zynqmp-baremetal
cortexa53-2-zynqmp-freertos
cortexa53-3-zynqmp-baremetal
cortexa53-3-zynqmp-freertos
PMU Microblaze microblaze-0-pmu
cortexr5 cortexr5-0-zynqmp-fsbl-baremetal
cortexr5-0-zynqmp-baremetal
cortexr5-0-zynqmp-freertos
cortexr5-1-zynqmp-baremetal
cortexr5-1-zynqmp-freertos
cortexr5-0-versal-baremetal
cortexr5-0-versal-freertos
cortexr5-1-versal-baremetal
cortexr5-1-versal-freertos
cortexa72 cortexa72-0-versal-baremetal
cortexa72-0-versal-freertos
cortexa72-1-versal-baremetal
cortexa72-1-versal-freertos
PLM Microblaze microblaze-0-pmc
PSM Microblaze microblaze-0-psm

Build Optimizations
This section describes the build optimization techniques with the PetaLinux tools.

Deselecting Default Components

You can deselect default components, if they are not needed. To disable the FSBL and PMU
firmware for AMD Zynq™ UltraScale+™ MPSoC, deselect the following options in petalinux-
config → Linux Components Selection.

• FSBL → [ ] First Stage Boot Loader


• PMUFW → [ ] PMU Firmware

To disable the PLM and PSM firmware for AMD Versal™ adaptive SoCs, deselect the following
option in petalinux-config → Linux Components Selection.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 33
Chapter 4: Configuring and Building

• PLM → [ ] PLM
• PSM → [ ] PSM Firmware

Deselecting these components removes these components from the default build flow.

Note: If the FSBL, PMU firmware, PLM firmware, and PSM firmware are not built with PetaLinux, they must
be built in the AMD Vitis™ software platform. The final load image must include all required components
regardless of which tool built them.

Local Mirror Servers

You can set internal mirrors on the NFS or web server which can speed up the builds. By default,
PetaLinux uses sstate-cache and download mirrors from https://petalinux.xilinx.com/sswreleases/
rel-v2024/. Follow these steps to work with local, NFS, or the internal web server copy of sstate
in PetaLinux. You can download the sstate from the download area along with PetaLinux.

Table 11: Local Mirror Servers

Server Description
downloads Source of download files are available.
aarch64 sstate mirrors for Zynq UltraScale+ MPSoC/RFSoC , and Versal devices.
arm sstate mirrors for Zynq 7000 SoCs.
microblaze sstate mirrors for MicroBlaze™ processors.

Source Mirrors

You can set source mirrors through petalinux-config → Yocto-settings → Add pre-mirror URL.
Select file://<local downloads path> for all projects. Save the configuration to use the
download mirrors and verify the changes in build/conf/plnxtool.conf.

Example: file:///home/user/daily-downloads-2024

Reduce Build Time

To reduce the build time by disabling the network sstate feeds, de-select the petalinux-config →
Yocto Settings → Enable Network sstate feeds.

Sstate Feeds

You can set sstate feeds through petalinux-config.

• sstate feeds on NFS: Go to petalinux-config → Yocto Settings → Local sstate feeds settings
and enter the full path of the sstate directory. By enabling this option, you can point to your
own shared state which is available at a NFS/local mount point.
For example, to enable, use /opt/petalinux/sstate-cache_2024/aarch64.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 34
Chapter 4: Configuring and Building

• sstate feeds on webserver: Go to petalinux-config → Yocto Settings → Enable Network sstate


feeds → Network sstate feeds URL and enter the URL for sstate feeds.
For more information, see How to reduce build time using SSTATE CACHE.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 35
Chapter 5: Packaging and Booting

Chapter 5

Packaging and Booting

Packaging Boot Image


This section describes how to generate the Boot Image for PetaLinux Build images.

Generate Boot Image for Versal Adaptive SoC


This section is for AMD Versal™ adaptive SoC only and describes how to generate BOOT.BIN for
Versal adaptive SoC.

Prerequisites
This section assumes that you have built PetaLinux system image. For more information, see
Building a System Image.

Generate Boot Image


A boot image usually contains a PDI file (imported from hardware design), PLM, PSM firmware,
Arm® trusted firmware, U-Boot, and DTB.

Execute the following command to generate the boot image in .bin format:

petalinux-package boot --u-boot

Note: Specifying --u-boot adds all the required images to boot up to U-Boot into BOOT.BIN

petalinux-package --boot --u-boot


[NOTE] Argument: "--boot" has been deprecated. It is recommended to start
using new python command line Argument.
[NOTE] Use: petalinux-package boot [OPTIONS]
[INFO] Getting Default pdi file
[INFO] File in BOOT BIN: "/wrk/everest_fcv_nobkup/xilinx-vck190-2024.1/
project-spec/hw-description/vpl_gen_fixed.pdi"
[INFO] File in BOOT BIN: "/wrk/everest_fcv_nobkup/xilinx-vck190-2024.1/
images/linux/plm.elf"
[INFO] File in BOOT BIN: "/wrk/everest_fcv_nobkup/xilinx-vck190-2024.1/
images/linux/psmfw.elf"
[INFO] File in BOOT BIN: "/wrk/everest_fcv_nobkup/xilinx-vck190-2024.1/
images/linux/system.dtb"
[INFO] File in BOOT BIN: "/wrk/everest_fcv_nobkup/xilinx-vck190-2024.1/

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 36
Chapter 5: Packaging and Booting

images/linux/bl31.elf"
[INFO] File in BOOT BIN: "/wrk/everest_fcv_nobkup/xilinx-vck190-2024.1/
images/linux/u-boot.elf"
[INFO] Generating versal binary package BOOT.BIN...
[INFO]

****** Bootgen v2023.2


**** Build date : Sep 4 2023-15:57:12
** Copyright 1986-2022 Xilinx, Inc. All Rights Reserved.
** Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.

[INFO] : Bootimage generated successfully

[INFO] Generating QEMU boot images...


[INFO] File in qemu_boot.img: /wrk/everest_fcv_nobkup/images/linux/BOOT.BIN
[INFO] File in qemu_boot.img: /wrk/everest_fcv_nobkup/images/linux/boot.scr
[INFO] File in qemu_boot.img: /wrk/everest_fcv_nobkup/images/linux/
ramdisk.cpio.gz.u-boot
[INFO] Binary is ready.
[INFO] Successfully Generated BIN File
[WARNING] Unable to access the TFTPBOOT folder /tftpboot!!!
[WARNING] Skip file copy to TFTPBOOT folder!!!

This generates BOOT.BIN, BOOT_bh.bin, and qemu_boot.img in images/linux directory.


The default DTB load address is 0x1000. For more information, see Bootgen User Guide
(UG1283).

To change the DTB load address, use this command:

petalinux-package boot --plm --psmfw --u-boot --dtb --load <load_address>

This generates a BOOT.BIN with a specified load address for DTB. Ensure that you have also
changed the load address for DTB in petalinux-config and in the U-Boot menuconfig.

Note: The files versal-qemu-multiarch-pmc.dtb and versal-qemu-multiarch-ps.dtb are


QEMU DTBS and required to boot multiarch QEMU.

For detailed usage, see the --help option and petalinux-package boot.

Generate MCS Image


An MCS image for Versal usually contains a PDI file (imported from hardware design), PLM, PSM
firmware, Arm® trusted firmware, U-Boot, DTB, and Kernel Fit image (optional).

Execute the following command to generate the MCS image to boot up to U-Boot using build
images:

petalinux-package boot --u-boot --format MCS

Note: Specifying --u-boot adds all the required images to boot up to U-Boot into boot.mcs file .

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 37
Chapter 5: Packaging and Booting

Execute the following command to generate the MCS image to boot up to U-Boot using prebuilt
images:

cd <plnx-proj-root>
$ petalinux-package boot --u-boot pre-built/linux/images/u-boot.elf --dtb
pre-built/linux/images/system.dtb --plm pre-built/linux/images/plm.elf --
psmfw pre-built/linux/images/psmfw.elf --atf pre-built/linux/images/
bl31.elf --format MCS

This generates boot.mcs in <plnx-proj-root>/images/linux directory. The default DTB


load address is 0x1000. For more information on Bootgen arguments, see Bootgen User Guide
(UG1283).

Execute the following command to generate the MCS image to boot up to Linux using build
images:

petalinux-package boot --u-boot --kernel --offset 0xF40000 --format MCS

Execute the following command to generate the MCS image to boot up to Linux using prebuilt
images:

cd <plnx-proj-root>
$ petalinux-package boot --u-boot pre-built/linux/images/u-boot.elf --dtb
pre-built/linux/images/system.dtb --plm pre-built/linux/images/plm.elf --
psmfw pre-built/linux/images/psmfw.elf --atf pre-built/linux/images/
bl31.elf --kernel pre-built/linux/images/image.ub --offset 0xF40000 --boot-
script pre-built/linux/images/boot.scr --format MCS

This generates boot.mcs in images/linux directory containing images to boot up to Linux


using Fit image (with tiny root file system if switch_root is enabled) loaded at 0xF40000 Flash
offset.

For detailed usage, see the --help option and petalinux-package boot.

Generate Boot Image for Zynq UltraScale+ MPSoC


This section is for AMD Zynq™ UltraScale+™ only and describes how to generate BOOT.BIN.

Prerequisites
This section assumes that you have built the PetaLinux system image. For more information, see
Building a System Image.

Generate Boot Image


The boot image can be put into Flash or SD card. When you power on the board, it can boot from
the boot image. A boot image usually contains a first stage boot loader image, FPGA bitstream,
PMU firmware, TF-A, and U-Boot.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 38
Chapter 5: Packaging and Booting

Execute the following command to generate the boot image in .BIN format.

petalinux-package boot --u-boot

Note: Specifying --u-boot adds all the required images to boot up to U-Boot into the BOOT.BIN.

petalinux-package boot --u-boot pre-built/linux/images/u-boot.elf --dtb pre-


built/linux/images/system.dtb --fsbl pre-built/linux/images/zynq_fsbl.elf --
format MCS

[INFO] File in BOOT BIN: "/wrk/everest_fcv_nobkup/_zc706_/xilinx-


zc702-2024.1/pre-built/linux/images/zynq_fsbl.elf"
[INFO] File in BOOT BIN: "/wrk/everest_fcv_nobkup/_zc706_/xilinx-
zc702-2024.1/pre-built/linux/images/u-boot.elf"
[INFO] File in BOOT BIN: "/wrk/everest_fcv_nobkup/_zc706_/xilinx-
zc702-2024.1/pre-built/linux/images/system.dtb"
[INFO] Generating zynq binary package boot.mcs...

[INFO] : Bootimage generated successfully

[INFO] Binary is ready.


[INFO] Successfully Generated MCS File
[WARNING] Unable to access the TFTPBOOT folder /tftpboot!!!
[WARNING] Skip file copy to TFTPBOOT folder!!!

For detailed usage, see the --help option or petalinux-package boot.

Generate MCS Image


An MCS image for Zynq UltraScale+ MPSoC usually contains a First Stage Boot Loader Image
(FSBL), FPGA bitstream, PMU firmware, TF-A, U-Boot, DTB, and Kernel Fit image (optional).

Execute the following command to generate the MCS image to boot U-Boot using build images:

petalinux-package boot --u-boot --format MCS

Note: Specifying --u-boot adds all the required images to boot up to U-Boot into boot.mcs file .

Execute the following command to generate the MCS image to boot up to U-Boot using prebuilt
images:

petalinux-package boot --u-boot pre-built/linux/images/u-boot.elf --dtb pre-


built/linux/images/system.dtb --pmufw pre-built/linux/images/pmufw.elf --
fsbl pre-built/linux/images/zynqmp_fsbl.elf --atf pre-built/linux/images/
bl31.elf --format MCS

This generates boot.mcs in <plnx-proj-root>/images/linux directory. For more


information on Bootgen arguments see Bootgen User Guide (UG1283).

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 39
Chapter 5: Packaging and Booting

Execute the following command to generate the MCS image to boot up to Linux using build
images:

petalinux-package boot --u-boot --kernel --offset 0xF40000 --format MCS

Execute the following command to generate the MCS image to boot up to Linux using prebuilt
images:

petalinux-package boot --u-boot pre-built/linux/images/u-boot.elf --dtb pre-


built/linux/images/system.dtb --pmufw pre-built/linux/images/pmufw.elf --
fsbl pre-built/linux/images/zynqmp_fsbl.elf --atf pre-built/linux/images/
bl31.elf --kernel pre-built/linux/images/image.ub --offset 0xF40000 --boot-
script pre-built/linux/images/boot.scr --format MCS

This generates boot.mcs in the images/linux directory containing images to boot up to


Linux using Fit image (with tiny root file system if switch_root enabled) loaded at 0xF40000
Flash offset.

For detailed usage, see the --help option and petalinux-package boot.

Generate Boot Image for Zynq 7000 Devices


This section is for AMD Zynq™ 7000 devices only and describes how to generate BOOT.BIN.

Prerequisites
This section assumes that you have built the PetaLinux system image. For more information, see
Building a System Image.

Generate Boot Image


The boot image can be put into Flash or SD card. When you power on the board, it can boot from
the boot image. A boot image usually contains a first stage boot loader image, FPGA bitstream
and U-Boot.

Follow the step to generate the boot image in .BIN format.

petalinux-package boot --u-boot

Note: Specifying --u-boot adds all the required images to boot up to U-Boot into the BOOT.BIN.

petalinux-package --boot --u-boot --kernel --offset 0x1080000 --format MCS


--force
[NOTE] Argument: "--boot" has been deprecated. It is recommended to start
using new python command line Argument.
[NOTE] Use: petalinux-package boot [OPTIONS]
[INFO] File in BOOT BIN: "/wrk/everest_fcv_nobkup/_zc706_/xilinx-
zc702-2024.1/images/linux/zynq_fsbl.elf"
[INFO] File in BOOT BIN: "/wrk/everest_fcv_nobkup/_zc706_/xilinx-
zc702-2024.1/images/linux/u-boot.elf"

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 40
Chapter 5: Packaging and Booting

[INFO] File in BOOT BIN: "/wrk/everest_fcv_nobkup/_zc706_/xilinx-


zc702-2024.1/images/linux/system.dtb"
[INFO] File in BOOT BIN: "/wrk/everest_fcv_nobkup/_zc706_/xilinx-
zc702-2024.1/images/linux/boot.scr"
[INFO] File in BOOT BIN: "/wrk/everest_fcv_nobkup/_zc706_/xilinx-
zc702-2024.1/images/linux/image.ub"
[INFO] Generating zynq binary package boot.mcs...
[INFO]

****** Bootgen v2023.2


**** Build date : Sep 4 2023-15:57:12
** Copyright 1986-2022 Xilinx, Inc. All Rights Reserved.
** Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.

[WARNING]: Partition zynq_fsbl.elf.0 range is overlapped with partition


boot.scr.0 memory range
[WARNING]: Partition zynq_fsbl.elf.0 range is overlapped with partition
image.ub.0 memory range
[WARNING]: Partition system.dtb.0 range is overlapped with partition
image.ub.0 memory range
[WARNING]: Partition boot.scr.0 range is overlapped with partition
image.ub.0 memory range

[INFO] : Bootimage generated successfully

[INFO] Binary is ready.


[INFO] Successfully Generated MCS File
[WARNING] Unable to access the TFTPBOOT folder /tftpboot!!!
[WARNING] Skip file copy to TFTPBOOT folder!!!

For detailed usage, see the --help option or petalinux-package boot.

Generate MCS Image


An MCS image for Zynq usually contains a First stage boot loader image (FSBL), FPGA bitstream,
Arm® trusted firmware, U-Boot, DTB, and Kernel Fit image (optional).

Execute the following command to generate the MCS image to boot up to U-Boot using build
images:

petalinux-package boot --u-boot --format MCS

Note: Specifying --u-boot adds all the required images to boot up to U-Boot into boot.mcs file.

Execute the following command to generate the MCS image to boot up to U-Boot using prebuilt
images:

cd <plnx-proj-root>
petalinux-package boot --u-boot pre-built/linux/images/u-boot.elf --dtb pre-
built/linux/images/system.dtb --fsbl pre-built/linux/images/zynq_fsbl.elf --
format MCS

This generates boot.mcs in <plnx-proj-root>/images/linux directory. For more


information on Bootgen arguments, see Bootgen User Guide (UG1283).

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 41
Chapter 5: Packaging and Booting

Execute the following command to generate the MCS image to boot up to Linux using build
images:

petalinux-package boot --u-boot --kernel --offset 0x1080000 --format MCS

Execute the following command to generate the MCS image to boot up to Linux using prebuilt
images:

cd <plnx-proj-dir>
petalinux-package boot --u-boot pre-built/linux/images/u-boot.elf --dtb pre-
built/linux/images/system.dtb --fsbl pre-built/linux/images/zynq_fsbl.elf --
kernel pre-built/linux/images/image.ub --offset 0x1080000 --boot-script pre-
built/linux/images/boot.scr --format MCS

This generates boot.mcsin images/linux directory containing images to boot up to Linux


using Fit image (with tiny root file system if switch_root enabled) loaded at 0x1080000 Flash
offset.

For detailed usage, see the --help option and petalinux-package boot.

Generate Boot Image for MicroBlaze Processor


This section is for MicroBlaze processor only and describes how to generate an MCS file for
MicroBlaze processor.

Prerequisites
Note: To generate MCS file, package the MMI file and bitstream as a part of Vivado or Vitis exported XSA.

This section assumes that you have built the PetaLinux system image. For more information, see
Building a System Image.

• To generate an MCS boot file, you must install the AMD Vivado™ Design Suite. You can
download the Vivado Design Suite from Vivado Design Tool Downloads.
• You have set up the Vivado tools working environment. If you have not, source the
appropriate settings scripts as follows:
source <installed-vivado-path>/settings64.sh

Generate Boot Image


Execute the following command to generate MCS boot file for MicroBlaze processors.

petalinux-package boot --fpga <FPGA bitstream> --u-boot --kernel

It generates boot.mcs in your working directory and it copies it to the <plnx-proj-root>/


images/linux/ directory. With the previous command, the MCS file contains FPGA bitstream,
fs-boot, U-Boot, and kernel image image.ub.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 42
Chapter 5: Packaging and Booting

Command to generate the MCS file with fs-boot and FPGA bitstream only:

petalinux-package boot --fpga <FPGA bitstream>

Command to generate the MCS file with FPGA bitstream, fs-boot, and U-Boot:

petalinux-package boot --fpga <FPGA bitstream> --u-boot

For detailed usage, see the --help option or petalinux-package boot.

Note: PetaLinux only supports 32-bit MicroBlaze processors.

Modify Bitstream File for MicroBlaze Processor


Prerequisites
This section assumes that you have built the PetaLinux system image and FSBL. For more
information, see Building a System Image.

Modify Bitstream
Execute the following command to modify the bitstream file for MicroBlaze™ processor.

petalinux-package boot --fpga <FPGA bitstream> --fsbl <fs-boot> --format


DOWNLOAD.BIT

This generates download.bit in the <plnx-proj-root>images/linux/ directory. With


the previous command, it merges the fs-boot into the FPGA bitstream by mapping the ELF data
onto the memory map information (MMI) for the block RAMs in the design. For detailed usage,
see the --help option or see petalinux-package boot.

Note: PetaLinux only supports 32-bit MicroBlaze processors.

Packaging Prebuilt Images


This section describes how to package newly built images into a prebuilt directory.

This step is typically done when you want to distribute your project as a BSP to other users.
After running this step, continue to the BSP Packaging section.

Prerequisites
This section assumes that the following prerequisites are satisfied:

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 43
Chapter 5: Packaging and Booting

• For Zynq UltraScale+ MPSoC, Zynq 7000 devices, and Versal devices, you have generated the
boot image. For more information, see Generate Boot Image for Zynq UltraScale+ MPSoC.
• For MicroBlaze processors, you have generated the system image. For more information, see
Building a System Image.

Packaging Prebuilt Image


1. Change into the root directory of your project.
cd <plnx-proj-root>

2. Use petalinux-package prebuilt to package the prebuilt images.


petalinux-package prebuilt --fpga <FPGA bitstream>

For detailed usage, see the --help option or see petalinux-package prebuilt.

BSP Packaging
PetaLinux BSPs are useful for distribution between teams and customers. Customized PetaLinux
projects can be shipped to next-level teams or external customers through BSPs. This section
explains, with an example, how to package a BSP with the project.

Prerequisites
This section assumes that you have PetaLinux Tools software platform ready for building a Linux
system customized to your hardware platform. For more information, see Importing Hardware
Configuration.

BSP Packaging
Steps on how to package a project are as follows:

1. Navigate outside the PetaLinux project directory to run petalinux-package command.


2. Use the following commands to package the BSP.
petalinux-package bsp -p <plnx-proj-root> --output MY.BSP

This generates MY.BSP, including the following elements from the specified project:
• <plnx-proj-root>/project-spec/
• <plnx-proj-root>/config.project
• <plnx-proj-root>/.petalinux/

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 44
Chapter 5: Packaging and Booting

• <plnx-proj-root>/pre-built/
• <plnx-proj-root>/.gitignore
• <plnx-proj-root>/components

Additional BSP Packaging Options


1. BSP packaging with hardware source.
petalinux-package bsp -p <plnx-proj-root> --hwsource <hw-project-root> --
output MY.BSP

It does not modify the specified PetaLinux project <plnx-proj-root>. It puts the specified
hardware project source to <plnx-proj-root>/hardware/ inside MY.BSP archive.
2. Exclude workspace changes.
The default petalinux-package --bsp command checks for sources in components/
plnx-workspace/sources directory and applies those changes to the meta-user layer. To
skip this, use --exclude-workspace as shown in the following code snippet:
petalinux-packge bsp -p <plnx-proj-root> --exclude-workspace

Alternatively, you can clean the project before executing the petalinux-package --bsp
command as follows:
petalinux-build -x mrproper -f

This removes the sources and appends directories from components/yocto/


workspace/.
3. BSP packaging with external sources.
The support for search path is obsolete. It is your responsibility to copy the external sources
under <plnx-proj-root>/components/ext_sources. For more information, see
Using External Kernel and U-Boot with PetaLinux.

Booting PetaLinux Prebuilt Images


You can boot PetaLinux image using the petalinux-boot command. Use the --qemu option
for software emulation (QEMU) and --jtag option to boot on hardware. This section describes
different boot levels for the prebuilt option.

Prerequisites
This section assumes that you have packaged prebuilt images. For more information, see
Packaging Prebuilt Images.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 45
Chapter 5: Packaging and Booting

Boot Levels for Prebuilt Option


--prebuilt <BOOT_LEVEL> boots prebuilt images (override all settings). Supported boot
levels are 1 to 3. The command for JTAG boot:

petalinux-boot jtag --prebuilt <BOOT_LEVEL> --hw_server-url hostname:3121

The command for the QEMU boot is as follows:

petalinux-boot qemu --prebuilt <BOOT_LEVEL>

Note: The QEMU boot does not support BOOT_LEVEL 1.

• Level 1: Download the prebuilt FPGA bitstream.


○ It boots FSBL and PMU firmware for AMD Zynq™ UltraScale+™ MPSoC.

○ It boots FSBL for AMD Zynq™ 7000 devices.

• Level 2: Download the prebuilt FPGA bitstream and boot the prebuilt U-Boot.
○ For Zynq 7000 devices: It boots FSBL before booting U-Boot.

○ For Zynq UltraScale+ MPSoC: It boots PMU firmware, FSBL, and TF-A before booting U-
Boot.
○ For AMD Versal™ devices: It loads the required cdo files from .pdi file, PLM, PSM firmware,
and TF-A before booting U-Boot.
• Level 3: Download and boot the prebuilt Linux
○ For MicroBlaze™ processors: Downloads the prebuilt FPGA bitstream and boots the
prebuilt kernel image on target.
○ For Zynq 7000 devices: Downloads the prebuilt FPGA bitstream and FSBL, boots the
prebuilt U-Boot, and boots the prebuilt kernel on target.
○ For Zynq UltraScale+ MPSoC: Downloads prebuilt FPGA bitstream, prebuilt FSBL, prebuilt
PMU firmware, prebuilt TF-A, prebuilt U-Boot and prebuilt kernel on target.
○ For Versal devices: It loads the required cdo files from .pdi file, PLM, PSM firmware, TF-A,
and U-Boot before booting Kernel.

Example to show the usage of boot level for prebuilt option:

petalinux-boot jtag --prebuilt 3

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 46
Chapter 5: Packaging and Booting

Booting PetaLinux Image on QEMU


This section describes how to boot a PetaLinux image under software emulation (QEMU)
environment.

For details on AMD IP Models supported by QEMU, see Appendix F: AMD IP Models Supported
by QEMU.

Prerequisites
This section assumes that the following prerequisites are satisfied:

• You have a PetaLinux system image by either installing a PetaLinux BSP (see Creating a Project
Using PetaLinux BSP) or by building your own PetaLinux project (see Building a System
Image).
• If you are going to use --prebuilt option for QEMU boot, you need to have prebuilt
images packaged. For more information, see Packaging Prebuilt Images.
• To boot QEMU for AMD Versal™ Aadaptive SoC, you should generate BOOT.BIN first. Refer
Generate Boot Image for Versal Adaptive SoC for more information on how to generate
BOOT.BIN.

IMPORTANT! Unless otherwise indicated, the PetaLinux tool command must be run within a project
directory (<plnx-proj-root>).

Booting a PetaLinux Image on QEMU


PetaLinux provides QEMU support to enable testing of PetaLinux software image in a simulated
environment without any hardware.

Use the following steps to test the PetaLinux reference design with QEMU:

1. Change to your project directory and boot the prebuilt Linux kernel image:
petalinux-boot qemu --prebuilt 3

If you do not wish to use prebuilt capability for QEMU boot, see the Additional Options for
Booting on QEMU.
The qemu option tells petalinux-boot to boot QEMU instead of real hardware.
• The --prebuilt 1 performs a Level 1 (FPGA bitstream) boot. This option is not valid for
QEMU.
• A level 2 boot includes U-Boot.
• A level 3 boot includes a prebuilt Linux image.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 47
Chapter 5: Packaging and Booting

To know more about different boot levels for prebuilt option, see Booting PetaLinux Prebuilt
Images.

TIP: To exit the emulator when you are finished, press Ctrl + A, release, and press X.

Additional Options for Booting on QEMU


• To download the newly built <plnx-proj-root>/images/linux/u-boot.elf with
QEMU:
petalinux-boot qemu --u-boot

○ For Zynq UltraScale+ MPSoC and Versal adaptive SoC, it loads <plnx-proj-root>/
images/linux/u-boot.elf and boots the TF-A image <plnx-proj-root>/
images/linux/bl31.elf with QEMU. The TF-A boots the loaded U-Boot image.
○ For MicroBlaze CPUs and Zynq 7000 devices, it boots <plnx-proj-root>/images/
linux/u-boot.elf with QEMU.
• To download the newly built kernel with QEMU:
petalinux-boot qemu --kernel

○ For MicroBlaze processors, it boots <plnx-proj-root>/images/linux/image.elf


with QEMU.
○ For Zynq 7000 devices, it boots <plnx-proj-root>/images/linux/zImage with
QEMU.
○ For Zynq UltraScale+ MPSoC, it loads the kernel image <plnx-proj-root>/images/
linux/Image and boots the TF-A image <plnx-proj-root>/images/linux/
bl31.elf with QEMU. The TF-A boots the loaded kernel image, with PMU firmware
running in the background.
○ For AMD Versal™ adaptive SoC, it loads the kernel image <plnx-proj-root>/images/
linux/Image and boots the TF-A image <plnx-proj-root>/images/linux/
bl31.elf with QEMU. The TF-A boots the loaded kernel image with PLM and PSM
firmware running in the background.
Note: For Versal adaptive SoC, QEMU boots up to the tiny root file system if switch_root is
enabled and gives you the rootfs prompt with ERROR: There's no '/dev' on rootfs..
message. This is because PetaLinux uses the SD boot mode in QEMU and the SD image has only
FAT with tiny rootfs by default.

After Linux booted successfully, ensure to first login with username petalinux and change the
password. Try commands such as ls, ifconfig, cat/proc/cpuinfo. They behave the same
as on real hardware. To exit the emulator when you are finished,

1. press Ctrl A + X

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 48
Chapter 5: Packaging and Booting

• To download a customized U-Boot image with --uboot/--u-boot option:


petalinux-boot qemu --u-boot/--uboot <specify custom u-boot.elf path>

• To download a customized kernel image with --kernel option:


○ For Zynq UltraScale+ MPSoC and Versal adaptive SoC, use image:
petalinux-boot qemu --kernel <specify custom Image path>

○ For Zynq 7000 devices, use zImage:


petalinux-boot qemu --kernel <specify custom zimage path>

○ For MicroBlaze processors, use Image.elf:


petalinux-boot qemu --kernel <specify custom Image.elf path>

• To download a customized root file system image with --rootfs option:


petalinux-boot qemu --kernel --rootfs <specify custom cpio.gz.u-boot path>

• To download a customized DTB image with --kernel option:


petalinux-boot qemu --kernel <specify custom kernel path> --dtb <specify
custom dtb path>

• To download a customized DTB image with --uboot/--u-boot option:


petalinux-boot qemu --u-boot/--uboot <specify custom u-boot path> --dtb
<specify custom dtb path>

This is not supported by Versal adaptive SoCs.


• To download a customized pmufw image with the --kernel option:
petalinux-boot qemu --kernel <specify custom kernel path>

• To download a customized pmufw image with --uboot/--u-boot option:


petalinux-boot qemu --uboot/--u-boot <specify custom u-boot path>

• To change the boot mode to QSPI for the board which does not have SD :
○ The default petalinux-boot command with QEMU work in SD boot mode. If your board
does not have the SD and support QSPI or OSPI, follow the steps to change the boot mode
to QSPI or OSPI

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 49
Chapter 5: Packaging and Booting

○ Note: In the following command, boot mode is specified as 8, which works with vck190 board. To
check the boot mode number of the respective board, refer to the board user guide of that board
mentioned in the BSP README file.

petalinux-package boot --uboot


dd if=/dev/zero bs=1G count=1 > <QEMU_QSPI>.bin
dd if=prebuilt/linux/images/BOOT.BIN of=<QEMU_QSPI>.bin bs=1 seek=0
conv=notrunc
petalinux-boot qemu --prebuilt 3 --qemu-args=" -drive
file=<QEMU_QSPI>.bin,if=mtd,format=raw,index=4 -boot mode=8"
booti [<addr> [<initrd>[:<size>]] [<fdt>]]

Note: QEMU version has been upgraded to 7.1. The old options are deprecated in the new version but
remain functionally operational. Warning messages are displayed because PetaLinux tools still use the old
options. You can ignore them.

Booting PetaLinux Image on Hardware with


an SD Card
This section describes how to boot a PetaLinux image on hardware with an SD Card.

IMPORTANT! This section is only for devices that allow booting from SD cards. This includes AMD
Versal™ adaptive SoCs, AMD Zynq™ UltraScale+™ MPSoCs, and Zynq 7000 devices.

Prerequisites
This section assumes that the following prerequisites are satisfied:

• You have installed PetaLinux Tools on the Linux workstation. If you have not installed, see the
Installation Steps.
• You have installed PetaLinux BSP on the Linux workstation. If you have not installed, see the
Creating a Project Using PetaLinux BSP.
• A serial communication program such as minicom/kermit/gtkterm has been installed; the baud
rate of the serial communication program has been set to 115200 bps.

Booting a PetaLinux Image on Hardware with SD


Card
You can boot a PetaLinux image on hardware using an SD card by copying the required images
manually or by flashing a WIC image into the mounted SD card.

Flashing and Booting the PetaLinux Images Manually

1. Partition the SD card by following Appendix I: Partitioning and Formatting an SD Card.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 50
Chapter 5: Packaging and Booting

2. Copy the following files from <plnx-proj-root>/images/linux or <plnx-proj-


root>/pre-built/linux/images/ into the boot directory of the first partition, which is
in FAT32 format in the SD card:
• BOOT.BIN
• image.ub
• boot.scr
3. Mount the ext4 partition and extract the rootfs.tar.gz folder into the ext4 partition of
the SD card with sudo permissions.
-> mount /dev/mmcblk1p1 /mnt
-> cd /mnt
-> tar -xzvf /PATH/TO/rootfs.tar.gz

4. Connect the serial port on the board to your workstation.


5. Open a console on the workstation and start the preferred serial communication program
(For example: kermit, minicom, gtkterm) with the serial line configured for 115200/8/N/1.
6. Power off the board.
7. Set the boot mode of the board to SD boot. Refer to the board documentation for details.
8. Plug the SD card into the board.
9. Power on the board.
10. A boot message displays on the serial console.

Flashing and Booting the PetaLinux Image Using WIC Image

1. To generate the WIC image in PetaLinux project see petalinux-package wic Command
Examples.
2. Go to the <plnx-proj-root>/images/linux or <plnx-proj-root>/pre-built/
linux/images/ directory. For example, cd images/linux/.
3. If the WIC image is compressed with XZ format, extract the petalinux-sdimage.wic.xz
file using xz command. For example, xz -d petalinux-sdimage.wic.xz.
Note: If xz package is not installed in your build machine, use the prebuilt xz binary from
$PETALINUX/components/yocto/buildtools/sysroots/x86_64-petalinux-
linux/usr/bin/xz.

4. Flash the extracted petalinux-sdimage.wic image into the SD card.


• Flash the WIC image in Linux: To flash the WIC image to SD card in Linux machines,
connect the SD card to the host system and use the dd command:
dd if=petalinux-sdimage.wic of=/dev/sd<X> conv=fsync
Note: You need sudo access to do this.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 51
Chapter 5: Packaging and Booting

• Flash the WIC image in Windows: To flash the WIC image to the SD card in Windows, you
can use any of the following:
• BalenaEtcher tool
• Win32DiskImager
5. Insert the SD card into the board and boot the system.
6. Connect the serial port on the board to your workstation.
7. Open a console on the workstation and start the preferred serial communication program
(For example: kermit, minicom, gtkterm) with the serial line configured for 115200/8/N/1.
8. Power off the board.
9. Set the boot mode of the board to SD boot. Refer to the board documentation for details.
10. Plug the SD card into the board.
11. Power on the board.
12. A boot message displays on the serial console.

TIP: To stop u-boot auto boot, hit any key when you see a message on the console: Hit any key to
stop autoboot.

Troubleshooting
This section describes some common issues you can experience while booting a PetaLinux image
on hardware with SD card.

Table 12: PetaLinux Image on Hardware Troubleshooting

Problem / Error Message Description and Solution


Wrong Image Format for boot Problem Description:
command. This error message indicates that the U-Boot boot loader is unable to find kernel
ERROR: Can’t get kernel image! image. This is likely because bootcmd environment variable is not set properly.
Solution:
To see the default boot device, print bootcmd environment variable using the
following command in U-Boot console.
U-Boot-PetaLinux> print bootcmd
If it is not run using sdboot flow, there are a few options as follows:
• Without rebuild PetaLinux, set bootcmd to boot from your desired media,
use setenv command. For SD card boot, set the environment variable as
follows.
U-Boot-PetaLinux> setenv bootcmd ’run sdboot’ ; saveenv
• Run petalinux-config to set to load kernel image from SD card. Rebuild
PetaLinux and regenerate BOOT.BIN with the rebuilt U-Boot, and use the
new BOOT.BIN to boot the board. See Generate Boot Image for Zynq
UltraScale+ MPSoC on how to generate BOOT.BIN.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 52
Chapter 5: Packaging and Booting

Table 12: PetaLinux Image on Hardware Troubleshooting (cont'd)

Problem / Error Message Description and Solution


Error string observed while booting Error message indicates that the file system devices has read and write
[ systemd[1]: File System Check on Root permission. No functional impact, you can ignore this.
Device was skipped because of a failed
condition check
(ConditionPathIsReadWrite=!/).

TIP: To learn more about U-Boot options, use the command: U-Boot-PetaLinux> printenv.

Booting PetaLinux Image on Hardware with


JTAG
This section describes how to boot a PetaLinux image on hardware with JTAG.

The JTAG boot communicates with XSDB which in turn communicates with the hw_server. The
TCP port used is 3121; ensure that the firewall is disabled for this port.

Prerequisites
This section assumes that the following prerequisites are satisfied:

• You have a PetaLinux system image by either installing a PetaLinux BSP (see Creating a Project
Using PetaLinux BSP) or by building your own PetaLinux project (see Building a System
Image).
• If you wish to make use of prebuilt capability for JTAG boot. You need to have packaged
prebuilt images (see Packaging Prebuilt Images).
• A serial communication program such as minicom/kermit/gtkterm has been installed; with the
serial line configured with default settings for 115200/8/N/1.
• Appropriate JTAG cable drivers to be installed on the target.

Booting a PetaLinux Image on Hardware with JTAG


1. Power off the board.
2. Connect the JTAG port on the board with the JTAG cable to your workstation.
3. Connect the serial port on the board to your workstation.
4. If your system has Ethernet, also connect the Ethernet port on the board to your local
network.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 53
Chapter 5: Packaging and Booting

5. Ensure that the mode switches are set to JTAG mode. Refer to the board documentation for
details.
6. Power on the board.
7. Open a console on your workstation and start with preferred serial communication program
(For example, kermit, minicom), with the serial line configured for 115200/8/N/1.
8. Run the petalinux-boot command as follows on your workstation:
petalinux-boot jtag --prebuilt 3 --hw_server-url <hostname:3121>
Note: If you wish not to use prebuilt capability for JTAG boot, refer to Additional Options for Booting
with JTAG.

The jtag option tells petalinux-boot to boot on hardware via JTAG, and the --
prebuilt 3 option boots the Linux kernel. Wait for the appearance of the shell prompt on
the command console to indicate completion of the command.
Note: To know more about different boot levels for prebuilt option, see Booting PetaLinux Prebuilt
Images.

By default, network settings for PetaLinux reference designs are configured using DHCP. The
output you see can be slightly different from the previous example, depending on the
PetaLinux reference design being tested.
9. Determine the IP address of the PetaLinux system by running ifconfig on the system console.

Additional Options for Booting with JTAG


• To download a bitstream to target board:
petalinux-boot jtag --fpga --bitstream <BITSTREAM> --hw_server-url
<hostname:3121>

• To download and run newly built <plnx-proj-root>/images/linux/u-boot.elf to


target board:
petalinux-boot jtag --u-boot --hw_server-url <hostname:3121>

• To download and run newly built kernel to target board:


petalinux-boot jtag --kernel --hw_server-url <hostname:3121>

○ For MicroBlaze™ processors, this boots system.bit, u-boot.elf, linux.bin.ub,


system.dtb, and rootfs.cpio.gz.u-boot on target board.
Note: If using a MicroBlaze processor, you need to add --fpga to the petalinux-boot command
as shown in the following example:

petalinux-boot jtag --fpga --kernel --hw_server-url <hostname:3121>

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 54
Chapter 5: Packaging and Booting

○ For AMD Zynq™ UltraScale+™ MPSoC, this boots pmufw.elf, zynqmp_fsbl.elf,


u-boot.elf, Image, system.dtb, and ramdisk.cpio.gz.u-boot on target
board.
○ For Zynq 7000 devices, this boots zynq_fsbl.elf, u-boot.elf, uImage,
system.dtb, and rootfs.cpio.gz.u-boot on target board.
○ For AMD Versal™ adaptive SoC, this boots BOOT.BIN, Image, ramdisk.cpio.gz.u-
boot, and boot.scr on target board.
• To download and run an image with a bitstream with --fpga --bitstream
<BITSTREAM> option:
petalinux-boot jtag --u-boot --fpga --bitstream <BITSTREAM>

The previous command downloads the bitstream and download the U-Boot image.
• To see the verbose output of JTAG boot with -v option:
petalinux-boot jtag --u-boot -v

• To download and run a customized U-Boot image with the --u-boot/--uboot option:
petalinux-boot jtag --u-boot/--uboot <specify custom u-boot.elf path>

• To download and run a customized kernel image with --kernel:


• For Zynq UltraScale+ MPSoC and Versal adaptive SoC, use Image:
petalinux-boot jtag --kernel <specify custom Image path>

• For Zynq 7000 devices, use Image:


petalinux-boot jtag --kernel <specify custom uImage path>

• For MicroBlaze processors, use linux.bin.ub:


petalinux-boot jtag --kernel <specify custom linux.bin.ub path>

• To download a customized DTB image with --kernel:


petalinux-boot jtag --kernel <specify custom kernel path> --dtb <specify
custom dtb path>

• To download a customized DTB image with --uboot/--u-boot:


petalinux-boot jtag --u-boot/--uboot <specify custom u-boot path> --dtb
<specify custom dtb path>

• To download a customized pmufw image with kernel:


petalinux-boot jtag --kernel <specify custom kernel path>

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 55
Chapter 5: Packaging and Booting

Logging Tcl/XSDB for JTAG Boot


Use the following command to take log of XSDB commands used during JTAG boot. It dumps Tcl
script (which invokes the XSDB commands) data to test.txt.

cd <plnx-proj-root>
petalinux-boot jtag --prebuilt 3 --tcl test.txt

Troubleshooting
This section describes some common issues you can experience while booting a PetaLinux image
on hardware with JTAG.

Table 13: PetaLinux Image on Hardware with JTAG Troubleshooting

Problem / Error Message Description and Solution


Cannot see any console output when Problem Description:
trying to boot U-Boot or kernel on This problem is usually caused by one or more of the following:
hardware but boots correctly on QEMU.
• The serial communication terminal application is set with the wrong baud
rate.
• Mismatch between hardware and software platforms.
Solution:
• Ensure your terminal application baud rate is correct and matches your
hardware configuration.
• Ensure the PetaLinux project is built with the right hardware platform.
○ Import hardware configuration properly (see the Importing Hardware
Configuration).
○ Check the "Subsystem AUTO Hardware Settings →" submenu to
ensure that it matches the hardware platform.
○ Check the "Serial settings →" submenu under "Subsystem AUTO
Hardware Settings →" to ensure stdout, stdin are set to the correct
UART IP core.
○ Rebuild system images (see Building a System Image).

Error string observed while booting Error message indicates that the file system devices has read and write
[ systemd[1]: File System Check on Root permission. No functional impact, you can ignore this.
Device was skipped because of a failed
condition check
(ConditionPathIsReadWrite=!/).

Booting PetaLinux Image on Hardware with


TFTP
This section describes how to boot a PetaLinux image using Trivial File Transfer Protocol (TFTP).

TFTP boot saves a lot of time because it is much faster than booting through JTAG and you do
not have to flash the image for every change in kernel source.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 56
Chapter 5: Packaging and Booting

Prerequisites
This section assumes that the following prerequisites are satisfied:

• Host environment with TFTP server is setup and PetaLinux Image is built for TFTP boot. For
more information, see Configuring TFTP/PXE Boot.
• You have packaged prebuilt images. For more information, see Packaging Prebuilt Images.
• A serial communication program such as minicom/kermit/gtkterm has been installed; the baud
rate of the serial communication program has been set to 115200 bps.
• Ethernet connection is setup properly between Host and Linux Target.
• Appropriate JTAG cable drivers are installed.

Booting a PetaLinux Image on Hardware with TFTP


1. Power off the board.
2. Connect the JTAG port on the board to the workstation using a JTAG cable.
3. Connect the serial port on the board to your workstation.
4. Connect the Ethernet port on the board to the local network via a network switch.
5. For AMD Zynq™ 7000 devices and Zynq UltraScale+ MPSoC and AMD Versal™ device
boards, ensure that the mode switches are set to JTAG mode. Refer to the board
documentation for details.
6. Power on the board.
7. Open a console on your workstation and start with the preferred serial communication
program (for example, kermit, minicom) with the baud rate set to 115200 on that console.
8. Run the petalinux-boot command as follows on your workstation
petalinux-boot jtag --prebuilt 2 --hw_server-url <hostname:3121>

9. When autoboot starts, hit any key to stop it. An example of a workstation console output for
successful U-Boot download is:
Hit any key to stop autoboot: 4

10. Check whether the TFTP server IP address is set to the IP Address of the host where the
image resides. This can be done using the following command:
ZynqMP> print serverip

11. Run DHCP to enumerate dynamic IP:


ZynqMP> dhcp

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 57
Chapter 5: Packaging and Booting

12. If you want static IP, set the server IP address to the host IP address using the following
command:
ZynqMP> setenv serverip <HOST IP ADDRESS>

13. If you want static IP, set the board IP address using the following command:
ZynqMP> setenv ipaddr <BOARD IP ADDRESS>

14. Get the pxe boot file using the following command:
ZynqMP> pxe get

15. Boot the kernel using the following command:


ZynqMP> pxe boot

Troubleshooting
Table 14: PetaLinux Image on Hardware with TFTP

Problem / Error Message Description and Solution


Error: "serverip" not defined. Problem Description:
This error message indicates that U-Boot environment
variable serverip is not set. You have to set it to the IP
Address of the host where the image resides.
Solution:
Use the following command to set the serverip:

ZynqMP> setenv serverip <HOST IP


ADDRESS>;saveenv

Error string observed while booting Error message indicates that the file system devices has
[ systemd[1]: File System Check on Root Device was skipped read and write permission. No functional impact, you can
because of a failed condition check ignore this.
(ConditionPathIsReadWrite=!/).

Booting PetaLinux Image on Hardware with


QSPI or OSPI
This section describes how to boot a PetaLinux image on hardware with QSPI/OSPI.

Prerequisites
This section assumes that the following prerequisites are satisfied:

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 58
Chapter 5: Packaging and Booting

• You have installed PetaLinux Tools on the Linux workstation. If you have not installed, see
Installation Steps.
• You have installed PetaLinux BSP on the Linux workstation. If you have not installed, see
Creating a Project Using PetaLinux BSP.
• You have successfully created BOOT.BIN with the newly built PetaLinux project. If you have
not created, see Packaging Boot Image.
• A serial communication program such as minicom, kermit, or gtkterm has been installed. The
baud rate of the serial communication program has been set to 115200 bps.

Booting a PetaLinux Image on Hardware with QSPI


or OSPI
You can boot a PetaLinux image on hardware using QSPI/OSPI by flashing/copying the Fit image
(image.ub) or Individual images(Kernel image + Rootfs) to Flash memory.

Steps to Flash and Boot the PetaLinux Images using Fit image

1. Set Primary Flash as boot device and set the Boot script configuration to load the images into
QSPI/OSPI flash. For more information, see Configuring Primary Flash Partition and to check
or update the offsets for kernel, boot.scr, and root file system, seeConfiguring U-Boot Boot
Script (boot.scr). If they do not match, the process can fail at the U-Boot prompt.
2. Build the system image. For more information, see Building a System Image.
3. Boot a PetaLinux Image on hardware with JTAG up to U-Boot, see Booting PetaLinux Image
on Hardware with JTAG.
4. Make sure you have configured TFTP server in host.
5. Set the server IP address to the host IP address using the following command at U-Boot
prompt.
ZynqMP> setenv serverip <HOST IP ADDRESS>

a. Detect Flash Memory.


ZynqMP> sf probe 0 0 0

b. Erase Flash Memory.


ZynqMP> sf erase 0 <Flash size in hex>

c. Read images onto Memory and write into Flash.


• Read BOOT.BIN.
ZynqMP> tftpboot 0x80000 BOOT.BIN

• Write BOOT.BIN.
ZynqMP> sf write 0x80000 0x0 $filesize

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 59
Chapter 5: Packaging and Booting

Example: sf write 0x80000 0x0 0x121e7d0


• Read image.ub.
ZynqMP> tftpboot 0x80000 image.ub

• Write image.ub.
ZynqMP>sf write 0x80000 <Fit Image Flash Offset Address> $filesize

Example: sf write 0x80000 0xF40000 0xF00000


• Read boot.scr
ZynqMP> tftpboot 0x80000 boot.scr

• Write boot.scr
ZynqMP> sf write 0x80000 <boot.scr Flash Offset Address> $filesize

Example: sf write 0x80000 0x03e80000 0x80000


6. Enable QSPI flash boot mode on board.
7. Reset the board (booting starts from flash).

Steps to Flash and Boot the PetaLinux Images using Individual images

1. Set Primary Flash as boot device and Adjust/set the Boot script configuration to load the
images into QSPI/OSPI flash. For more information, see Configuring Primary Flash Partition
and Configuring U-Boot Boot Script (boot.scr).
2. Build the system image. For more information, see Building a System Image.
3. Boot a PetaLinux Image on hardware with JTAG up to U-Boot, see Booting PetaLinux Image
on Hardware with JTAG.
4. Make sure you have configured TFTP server in host.
Note: To check or update the offsets for kernel, boot.scr, and root file system see Configuring U-Boot
Boot Script (boot.scr). If they do not match, the process can fail at the U-Boot prompt.

5. Set the server IP address to the host IP address using the following command at U-Boot
prompt.
ZynqMP> setenv serverip <HOST IP ADDRESS>

a. Detect Flash Memory.


ZynqMP> sf probe 0 0 0

b. Erase Flash Memory.


ZynqMP> sf erase 0 <Flash size in hex>

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 60
Chapter 5: Packaging and Booting

c. Read images onto Memory and write into Flash.


• Read BOOT.BIN.
ZynqMP> tftpboot 0x80000 BOOT.BIN

• Write BOOT.BIN.
ZynqMP> sf write 0x80000 0x0 $filesize

Example: sf write 0x80000 0x0 0x121e7d0


• Read Image.
ZynqMP> tftpboot 0x80000 Image

• Write Image.
ZynqMP> sf write 0x80000 <Kernel Image Flash Offset Address>
$filesize

Example: sf write 0x80000 0xF00000 0x1474200


• Read rootfs.cpio.gz.u-boot.
ZynqMP> tftpboot 0x80000 rootfs.cpio.gz.u-boot

• Write rootfs.cpio.gz.u-boot.
ZynqMP>sf write 0x80000 <Rootfs Flash Offset Address> $filesize

Example: sf write 0x80000 0x4000000 0x4e1933


• Read boot.scr
ZynqMP> tftpboot 0x80000 boot.scr

• Write boot.scr
ZynqMP> sf write 0x80000 <boot.scr Flash Offset Address> $filesize

Example: sf write 0x80000 0x03e80000 0x80000


6. Enable QSPI flash boot mode on board.
7. Reset the board (booting starts from flash).

Troubleshooting
This section describes some common issues you can experience while booting a PetaLinux image
on hardware with QSPI/OSPI Flash.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 61
Chapter 5: Packaging and Booting

Table 15: PetaLinux Image on Hardware Troubleshooting

Problem / Error Message Description and Solution


Wrong Image Format for boot Problem Description:
command. This error message indicates that the U-Boot boot loader is unable to find kernel
ERROR: Can't get kernel image! image. This is likely because the Kernel offset in the boot.scr and the Kernel
image offset in the Flash do not match.
Solution:
To see the default boot offsets of SPI, click Configuring U-Boot Boot Script
(boot.scr)
Wrong Image Format for bootm Problem Description:
command ERROR: can't get kernel This error message appears when you load Image and ramdisk.cpio.gz.uboot for
image! Booting using Fit image failed QSPI/OSPI/NAND boot mode. You can ignore this error message.
Error string observed while booting Error message indicates that the file system devices has read and write
[ systemd[1]: File System Check on Root permission. No functional impact, you can ignore this.
Device was skipped because of a failed
condition check
(ConditionPathIsReadWrite=!/).

TIP: To know more about U-Boot options, use the U-Boot-PetaLinux> printenv command.

Boot from HBM/Higher DDR/LP DDR


1. Source the latest PetaLinux tool.
2. Create plnx project with Versal template.
3. Configure the project using the HBM/higher ddr/lp ddr enabled design xsa file.
petalinux-config --get-hw-description <xsa file>

Note: The current VHK158 Prod BSP has HBM enabled design.

4. Go to Subsystem Auto Hardware Settings → Memory Settings → select the memory region
of DDR/HBM

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 62
Chapter 5: Packaging and Booting

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 63
Chapter 5: Packaging and Booting

5.

6. Save and Exit


7. petalinux-build
8. Boot the images.
The above-built images, by default, boot out of HBM/Higher DDR/LP DDR based on your
selection for all boot modes except for jtag and pxe boot.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 64
Chapter 6: Upgrading the Workspace

Chapter 6

Upgrading the Workspace


To upgrade the workspace, use the petalinux-upgrade command. You can upgrade the tool
in the following three cases. For petalinux-upgrade options, see petalinux-upgrade Options.

Upgrading Between Minor Releases (2024.1


Tool with 2024.x Tool)
PetaLinux tool has system software components (embedded software, TF-A, Linux, U-Boot,
OpenAMP, and Yocto framework) and host tool components (AMD Vivado™ Design Suite and
AMD Vitis™ software development platform). To upgrade to the latest system software
components only, you need to install the corresponding host tools.

The petalinux-upgrade command resolves this issue by upgrading the system software
components without changing the host tool components. The system software components are
upgraded in two steps: by upgrading the installed PetaLinux tool, and upgrading existing
PetaLinux projects. This allows you to upgrade without having to install the latest version of the
Vivado hardware project or Vitis software platform.

Upgrade PetaLinux Tool


Upgrade from Local File
Download the target system software components content from the server URL.

petalinux-upgrade command would expect the downloaded path as input.

1. Install the tool if you do not have it installed.


Note: Ensure the install area is writable.

2. Change into the directory of your installed PetaLinux tool using cd <plnx-tool>.
3. Type: source settings.sh.
4. Enter command: petalinux-upgrade -f <downloaded sdkupdate path>.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 65
Chapter 6: Upgrading the Workspace

Example:

petalinux-upgrade -f “/scratch/ws/upgrade-workspace/sdkupdate”

Upgrade from Remote Server


Follow these steps to upgrade the installed tool target system software components from the
remote server.

1. Install the tool if you do not have it installed.


Note: The tool should have R/W permissions.

2. Go to installed tool.
3. Type: source settings.sh.
4. Enter command: petalinux-upgrade -u <url>.

Example:

petalinux-upgrade -u https://petalinux.xilinx.com/sswreleases/rel-v2024/
sdkupdate

IMPORTANT! Only minor version upgrades are supported.

Upgrading only Preferred Platforms in Tool

• To upgrade all platforms:

petalinux-upgrade -u/-f <path/url>

To upgrade the eSDKs for all (Zynq devices, Zynq UltraScale+ MPSoC, Versal, MicroBlaze).

• To upgrade only Zynq 7000 platform:

petalinux-upgrade -u/-f <path/url> --platform arm

• To upgrade eSDKs for Zynq, Zynq UltraScale+ MPSoC, and Versal platforms:

petalinux-upgrade -u/-f <path/url> --platform arm aarch64

• To upgrade eSDKs for MicroBlaze:

petalinux-upgrade -u/-f <path/url> --platform microblaze

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 66
Chapter 6: Upgrading the Workspace

Upgrade PetaLinux Project


Upgrade an Existing Project with the Upgraded Tool
Use the following steps to upgrade existing project with upgraded tool.

1. Run petalinux-build -x mrproper in the existing project before upgrading the tool.
2. Upgrade the tool. To upgrade from local file, see Upgrade from Local File. To upgrade from
remote server, see Upgrade from Remote Server.
3. Go to the PetaLinux project you want to upgrade.
4. Run either petalinux-build or petalinux-config to upgrade the project with all new
system components.
5. When asked to upgrade the eSDK, select y to extract the new eSDK as follows:
WARNING: Your Yocto SDK was changed in tool.
Please input "y" to proceed the installing SDK into project, "n" to
exit:y

Now your project is built with the upgraded tool.


6. If you had used only the petalinux-config command in step 4, run the petalinux-
build command to build the project.

Upgrading the Installed Tool with More


Platforms
Once you have installed PetaLinux tool with only the arm platform as specified in Installing the
PetaLinux Tool, to install the aarch64 platform, follow these steps.

For the following use case, if you want to upgrade with 2024.1 platforms, use SDK Update.

1. Change directory to the installed tool location.


2. Go to the installed tool.
3. Source settings.sh file.
4. Run: petalinux-upgrade -u http://petalinux.xilinx.com/sswreleases/
rel-v2024/sdkupdate/ -p aarch64

The new platform is part of your <plnx-tool>/components/yocto/source/aarch64.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 67
Chapter 6: Upgrading the Workspace

Use Cases

• To get the Zynq platform only:


petalinux-upgrade -u/-f <path/url> --platform arm

• To get Zynq, Zynq UltraScale+ MPSoC, and Versal platforms:


petalinux-upgrade -u/-f <path/url> --platform arm aarch64

• To get the MicroBlaze platforms:


petalinux-upgrade -u/-f <path/url> --platform microblaze

Upgrading the Installed Tool with your


Customized Platform
From 2020.1 release onwards, platform/esdk is part of your project <plnx-proj-root>/
components/yocto. You can make changes in the platform/esdk and you can build those
changes using the petalinux-build –esdk option. The newly built eSDK is in <plnx-
proj-root>/images/linux/esdk.sh. Rename the newly built esdk.sh as one of
aarch64, arm or microblaze based on your project.

1. Go to the installed tool.


2. Source settings.sh.
3. Run petalinux-upgrade -f <plnx-proj-root>/images/linux/ -p
<platform>.
The tool is upgraded with your new platform changes.

Note: These procedures work only between minor releases.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 68
Chapter 7: Customizing the Project

Chapter 7

Customizing the Project

Configuring Firmware Version


This section explains how to do firmware version configuration using petalinux-config
command.

Prerequisites
This section assumes that you have PetaLinux Tools software platform ready for building a Linux
system customized to your hardware platform. For more information, see the Importing
Hardware Configuration.

Firmware Version Configuration


1. Change into the root directory of your PetaLinux project.
cd <plnx-proj-root>

2. Launch the top level system configuration menu.


petalinux-config

3. Select Firmware Version Configuration.


4. Select Host Name, Product Name, Firmware Version as per the requirement to edit them.
5. Exit the menu and select <Yes> when asked: Do you wish to save your new configuration?
6. Once the target is booted, verify the host name in cat /etc/hostname, product name in
cat /etc/petalinux/product, and the firmware version in cat /etc/petalinux/
version.

Note: Do not use '_' in hostname, product name and Firmware version

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 69
Chapter 7: Customizing the Project

Configuring Root File System Type


This section details configuration of RootFS type using petalinux-config command.

Prerequisites
This section assumes that you have PetaLinux Tools software platform ready for building a Linux
system customized to your hardware platform. For more information, see the Importing
Hardware Configuration.

Steps for Root File System Type Configuration


1. Change into the root directory of your PetaLinux project.
cd <plnx-proj-root>

2. Launch the top-level system configuration menu.


petalinux-config

3. Select Image Packaging Configuration → Root File System Type.


4. Select INITRAMFS or INITRD or JFFS2 or UBI/UBIFS or NFS or EXT4 (SD/eMMC/SATA/
USB) as per the requirement.
Note: EXT4 boot functionality expects the root file system to be mounted on ext4 partition and the
BOOT.BIN , system.dtb, and kernel images in FAT32 partition.

Note: Set Image Package Configuration ->Root File System Type as "INITRAMFS/INITRD
configuration" with petalinux-initramfs-image then the full rootfs should be mounted in ext4
partition to use the switch_root.

5. Save Configuration settings.


Note: Switch_root in petalinux-config: The switch_root is a utility used to switch from one root
file system to another file system as the root of the mount tree. It is primarily used for initramfs/initrd
cases.

6. In PetaLinux Zynq UltraScale+ MPSoC and AMD Versal™ BSPs, the default menuconfig
option for petalinux-config → Image Package Configuration → INITRAMFS/INITRD image
name is set to petalinux-initramfs-image which is treated as switch_root enabled. The
respective config image is packaged in the image.ub file and is also copied into the images/
linux folder with ramdisk prefixed to the file name (for example, ramdisk.cpio.gz.u-boot), if the
image specified in the config option name contains the initramfs. The default generated
ramdisk.cpio.gz.u-boot is a tiny-based search of the root file system for the EXT partition in
SD/eMMC that is used as a real time rootfs file system irrespective of boot mode. If the init
script in the tiny rootfs system does not find any rootfs in real time, it lands in to the tiny-
based rootfs with the '/#' prompt. See Appendix A: Migration, for more information.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 70
Chapter 7: Customizing the Project

Configuring U-Boot Boot Script (boot.scr)


1. Change into the root directory of your PetaLinux project.
cd <plnx-proj-root>

2. Launch the top level system configuration menu.


petalinux-config

3. Select u-boot Configuration → u-boot script configuration.


4. In the U-Boot script configuration submenu, you have the following options:

• To append memory/DDR base address to provided offsets, select [*] Append base address
to image offsets. PetaLinux reads the DDR base address from the hardware file and
appends it to the offsets provided. This is enabled by default.
• To add any U-Boot environment variables which have to be executed before the boot
command, select () Pre bootenv.
• To check/modify the JTAG/DDR offsets, use JTAG/DDR image offsets –->. These are
used in the JTAG boot mode and also to load the images from flash/storage to the DDR
memory.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 71
Chapter 7: Customizing the Project

• Example: The following screen shot is for AMD Versal™ load address.

• Note: By default, the following load addresses are used by PetaLinux for the boot.scr on the
JTAG boot:

Table 16: Default Load Address on JTAG Boot

Device Load Address of boot.scr


Zynq UltraScale+ MPSoC and Versal adaptive SoC DDR base address + 0x20000000
Zynq 7000 devices DDR base address + 0x3000000
MicroBlaze processors (DDR base address + DDR size) - 0xe00000

• To check/modify the QSPI/OSPI offsets/sizes, use QSPI/OSPI image offsets --->


configuration menu. Make sure the specified offsets/sizes do not overlap with boot.scr
or image to image.
Note: By default, the following offset are used by PetaLinux for the boot.scr on the QSPI/OSPI
boot:

Table 17: Default offset on QSPI/OSPI Boot

Device offset of boot.scr


Zynq UltraScale+ MPSoC 0x3E80000
Versal adaptive SoC 0x7F80000
Zynq 7000 devices 0xFC0000
MicroBlaze processors 0xFC0000

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 72
Chapter 7: Customizing the Project

Note: You should check and update offset which is specified in petalinux-config → u-boot
Configuration → u-boot script configuration QSPI/OSPI fit image offset should be match with the
kernel offset in petalinux-config → Subsystem AUTO Hardware Settings → Flash Settings. If they
do not match, the process can fail at U-Boot prompt.

• To check/modify the NAND offsets/sizes, use the NAND image offsets –-> configuration
menu. Make sure the specified offsets/sizes do not overlap with the boot.scr or image
to image.
Note: By default, the following offsets are used by PetaLinux for the boot.scr on the NAND boot:

Table 18: Default Offset on NAND Boot

Device Offset of boot.scr


Zynq UltraScale+ MPSoC 0x3E80000
Versal adaptive SoC 0x7F80000
Zynq 7000 devices 0xFC0000
MicroBlaze processors 0xFC0000

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 73
Chapter 7: Customizing the Project

Troubleshooting
This section describes some common issues you can experience while working with boot device
configuration.

Table 19: Boot Images Storage Troubleshooting

Problem / Error Message Description and Solution


ERROR: Failed to config linux/kernel! Problem Description:
This error message indicates that it is unable to configure
the linux-kernel component with menuconfig.
Solution:
Check whether all required libraries/packages are installed
properly. For more information, see the Installation
Requirements.

Configuring Primary Flash Partition


This sections provides details on how to configure flash partition with PetaLinux menuconfig.

1. Change into the root directory of your PetaLinux project.


cd <plnx-proj-root>

2. Launch the top-level system configuration menu.


petalinux-config

3. Select Subsystem AUTO Hardware Settings → Flash Settings.


4. Select a flash device as the Primary Flash.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 74
Chapter 7: Customizing the Project

5. Set the name and the size of each partition.

Configuring INITRD Boot


Initial RAM disk (INITRD) provides the capability to load a RAM disk by the boot loader during
the PetaLinux startup process. The Linux kernel mounts it as RootFS and starts the initialization
process. This section describes the procedure to configure the INITRD boot.

Prerequisites
This section assumes that you have created a new PetaLinux project (see Creating an Empty
Project from a Template) and imported the hardware platform (see Importing Hardware
Configuration).

Configuring INITRD Boot


1. Set the RootFS type to INITRD. For more information, see Configuring Root File System Type.
2. Set RAMDISK loadaddr. Ensure loadaddr does not overlap with kernel or DTB address and
that it is a valid DDR address.
3. Set INITRAMFS/INITRD Image name. The default image name is set to petalinux-
intramfs-image to enable the switch_root. The build system generates two types of
root file systems: ramdisk images and rootfs images. The ramdisk image is as specified in
INITRAMFS/INITRD Image name. It is packed into Fit image (image.ub).
Note: Setting petalinux-initramfs-image enables the switch_root and searches for the rootfs in
ext2/3/4 of SD partitions.

4. Build the system image. For more information, see Building a System Image.
5. Use one of the following methods to boot the system image:
a. Boot a PetaLinux Image on Hardware with SD Card, see Booting PetaLinux Image on
Hardware with an SD Card.
b. Boot a PetaLinux Image on Hardware with JTAG, see Booting PetaLinux Image on
Hardware with JTAG.
c. Boot a PetaLinux Image on Hardware with TFTP, see Booting PetaLinux Image on
Hardware with TFTP

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 75
Chapter 7: Customizing the Project

Configuring INITRAMFS Boot


Initial RAM file system (INITRAMFS) is the successor of INITRD. It is a cpio archive of the initial
file system that gets loaded into memory during the PetaLinux startup process. The Linux kernel
mounts it as RootFS and starts the initialization process.

This section describes the procedure to configure INITRAMFS boot.

Prerequisites
This section assumes that you have created a new PetaLinux project (see Creating an Empty
Project from a Template) and imported the hardware platform (see Importing Hardware
Configuration).

Configuring INITRAMFS Boot


1. Set the RootFS type to INITRAMFS. For more information, see Configuring Root File System
Type.
2. Set INITRAMFS/INITRD Image name. The default image name is set to petalinux-
intramfs-image to enable the switch_root. The build system generates two types of
root file systems: ramdisk images and rootfs images. The ramdisk image is generated as
specified in the INITRAMFS/INITRD Image name. It is packed into Fit image (image.ub) and
Kernel image.
Note: Setting petalinux-initramfs-image enables the switch_root and searches for the rootfs in
ext2/3/4 of SD partitions. If switch_root is disabled load the final rootfs from RAM.

3. Build the system image. For more information, see Building a System Image.
4. Use one of the following methods to boot the system image.
a. Boot a PetaLinux Image on QEMU, see Booting PetaLinux Image on QEMU.
b. Boot a PetaLinux Image on Hardware with SD Card, see Booting PetaLinux Image on
Hardware with an SD Card.
c. Boot a PetaLinux Image on Hardware with JTAG, see Booting PetaLinux Image on
Hardware with JTAG.

IMPORTANT! The default mode in the PetaLinux BSP is the INITRD mode.

In INITRAMFS mode, RootFS is included in the kernel image.

• Image → Image (kernel) + ramdisk.cpio/rootfs.cpio (for Zynq UltraScale+ MPSoC and


Versal adaptive SoC)
• uImage → uImage (kernel) + ramdisk.cpio/rootfs.cpio (for Zynq 7000 devices)

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 76
Chapter 7: Customizing the Project

• linux.bin.ub → simpleImage.mb (kernel) + ramdisk.cpio/rootfs.cpio (for


MicroBlaze processors)

As you select the RootFS components, its size increases proportionally.

Configuring TFTP/PXE Boot


This section describes how to configure the host and the PetaLinux image for the TFTP/PXE
boot.

TFTP/PXE boot saves a lot of time because it is much faster than booting through JTAG and you
do not have to flash the image for every change in kernel source.

Prerequisites
This section assumes that the following prerequisites are satisfied:

• You have created a new PetaLinux project (see Creating an Empty Project from a Template)
and imported the hardware platform (see Importing Hardware Configuration).
• You have TFTP server running on your host.

PetaLinux Configuration and Build System Image


Follow these steps to configure PetaLinux for TFTP/PXE boot and build the system image:

1. Change to root directory of your PetaLinux project.


cd <plnx-proj-root>

2. Launch the top-level system configuration menu.


petalinux-config

3. Select Image Packaging Configuration.


4. Select Copy final images to tftpboot and set tftpboot directory. By default, the TFTP
directory ID is /tftpboot. Ensure this matches the TFTP server setup of your host.
5. Save configuration settings and build a system image as explained in Building a System Image.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 77
Chapter 7: Customizing the Project

Configuring NFS Boot


One of the most important components of a Linux system is the root file system. A well-
developed root file system can provide you with useful tools to work on PetaLinux projects.
Because a root file system can become big in size, it is hard to store it in flash memory.

The most convenient thing is to mount the entire root file system from the network allowing the
host system and the target to share the same files. The root file system can be modified quickly
and also on the fly (meaning that the file system can be modified while the system is running).
The most common way to setup a system like the one described is through NFS.

In case of NFS, no manual refresh is needed for new files.

Prerequisites
This section assumes that the following prerequisites are satisfied:

• You have created a new PetaLinux project (see Creating an Empty Project from a Template)
and imported the hardware platform (see Importing Hardware Configuration).
• You have Linux file and directory permissions.
• You have an NFS server setup on your host. Assuming it is set up as /home/NFSshare in this
example.

PetaLinux Configuration and Build System Image


Steps to configure the PetaLinux for NFS boot and build the system image are as follows:

1. Change to root directory of your PetaLinux project.


cd <plnx-proj-root>

2. Launch the top level system configuration menu.


petalinux-config

3. Select Image Packaging Configuration → Root File System Type.


4. Select NFS as the RootFS type.
5. Select Location of NFS root directory and set it to /home/NFSshare.
6. Exit menuconfig and save configuration settings. The boot arguments in the auto generated
DTSI is automatically updated after the build. You can check <plnx-proj-root>/
components/plnx_workspace/device-tree/device-tree/system-conf.dts.
7. Launch Kernel configuration menu.
petalinux-config -c kernel

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 78
Chapter 7: Customizing the Project

8. Select Networking support → IP: kernel level configuration.


• IP:DHCP support
• IP:BOOTP support
• IP:RARP support
9. Select File systems → Network file systems → Root file systems on NFS.
10. Build the system image.
Note: For more information, see Building a System Image.

11. You can see the updated boot arguments only after building.

Booting with NFS


In case of NFS Boot, RootFS is mounted through the NFS but bootloader (FSBL, bitstream, U-
Boot), and kernel can be downloaded using various methods are mentioned as follows:

1. JTAG: In this case, bootloader and kernel is downloaded on to the target through JTAG. For
more information, see Booting PetaLinux Image on Hardware with JTAG.

TIP: If you want to make use of prebuilt capability to boot with JTAG, package images into prebuilt
directory. For more information, see Packaging Prebuilt Images.

1. tftpboot: In this case, bootloader is downloaded through JTAG and kernel is downloaded on
to the target through tftpboot. For more information, see Booting PetaLinux Image on
Hardware with TFTP.
2. SD card: In this case, bootloader (BOOT.BIN), bootscript (boot.scr) and kernel image
(image.ub) is copied to the SD card downloaded from the SD card. For more information,
see Booting PetaLinux Image on Hardware with an SD Card.

Configuring JFFS2 Boot


Journaling flash file system version 2 or JFFS2 is a log-structured file system for use with flash
memory devices. This section describes the procedure to configure JFFS2 boot.

Prerequisites
This section assumes that you have created a new PetaLinux project (see Creating an Empty
Project from a Template) and imported the hardware platform (see Importing Hardware
Configuration).

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 79
Chapter 7: Customizing the Project

Configuring JFFS2 Boot


1. Set the root file system type to JFFS2. For more information, see Configuring Root File
System Type.
2. Select petalinux-config →Image Packaging Configuration → jffs2 erase block size (KB) (jffs2
erase block size: 128 KB)
Note: 8 KB erase block size does not work with 6.1 kernel because they disabled the dependent kernel
configs to support UBIFS boot support.

CAUTION! The erase block size MUST match the erase size of your flash device

3. Set Primary Flash as boot device and update the boot script configuration if required. For
more information, see Configuring U-Boot Boot Script (boot.scr) and Configuring Primary
Flash Partition.
4. Build the system image. For more information, see Building a System Image.
5. Boot a PetaLinux Image on hardware with JTAG, see Booting PetaLinux Image on Hardware
with an SD Card.
6. Make sure you have configured TFTP server in host.
7. Set the server IP address to the host IP address using the following command at U-Boot
prompt.
ZynqMP> setenv serverip <HOST IP ADDRESS>;

a. Detect Flash Memory.


ZynqMP> sf probe 0 0 0

b. Erase Flash Memory.


ZynqMP> sf erase 0 0x8000000

c. Read images onto Memory and write into Flash.


• Read BOOT.BIN.
ZynqMP> tftpboot 0x80000 BOOT.BIN

• Write BOOT.BIN.
ZynqMP> sf write 0x80000 0x0 $filesize

Example: sf write 0x80000 0x0 0x10EF48


• Read image.ub.
ZynqMP> tftpboot 0x80000 image.ub

• Write image.ub.
ZynqMP>sf write 0x80000 <Fit Image Flash Offset Address> $filesize

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 80
Chapter 7: Customizing the Project

Example: sf write 0x80000 0xF40000 0x6cb0e4


• Read rootfs.jffs2.
ZynqMP> tftpboot 0x80000 rootfs.jffs2

• Write rootfs.jffs2.
ZynqMP> sf write 0x80000 <Rootfs Flash Offset Address> $filesize

Example: sf write 0x80000 0x04000000 $filesize


• Read boot.scr
ZynqMP> tftpboot 0x80000 boot.scr

• Write boot.scr
ZynqMP> sf write 0x80000 <boot.scr Flash Offset Address> $filesize

Example: sf write 0x80000 0x03e80000 $filesize


Note: Check the offsets for kernel and root file system at petalinux-config → u-boot Configuration → u-
boot script configuration. The process can fail at the U-Boot prompt if they do not match.

8. Enable QSPI flash boot mode on board.


9. Reset the board (booting starts from flash).

Table 20: Error Message while loading Image and ramdisk.cpio.gz.u-boot

Error Message Description


This error message appears when you load Image and ramdisk.cpio.gz.u-
Wrong Image Format for bootm boot for QSPI/OSPI/NAND boot mode. You can ignore this error message.
command
ERROR: can't get kernel image!
Booting using Fit image failed

Configuring UBIFS Boot


Unsorted Block Images File System (UBIFS) is a flash file system that is different from traditional
Linux file systems (for example, Ext2, XFS, and JFS). It works with MTD devices and not with
block devices. The other Linux file system of this class is JFFS2.

Prerequisites
This section assumes that you have created a new PetaLinux project (see Creating an Empty
Project from a Template) and imported the hardware platform (see Importing Hardware
Configuration).

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 81
Chapter 7: Customizing the Project

Configuring UBIFS Boot


Follow these steps to configure PetaLinux for UBIFS:

1. Set the root file system to UBIFS. For more information, see Configuring Root File System
Type.

a. Select petalinux-config → Image Packaging Configuration → Root filesystem type (UBI/


UBIFS).
b. Specify the arguments used in mkfs.ubifs to create the UBIFS partition-m 2 -e
130944 -c 400 For QSPI 128k erase block size.
c. Specify the arguments used in ubinize to create the UBIFS partition. -m 2048 -p
128KiB -s 512 For QSPI 128k erase block size.
d. Specify the ubifs part name to add in bootargs, for example, ubifs.
Note: Ensure that you create the QSPI partition with the specified name.

e. Specify the root file system format to build rootfs.ubi during the build.
For example,
tar.gz cpio cpio.gz.u-boot cpio.gz ext4 jffs2 ubi

2. Set Primary Flash as boot device and configure boot script. For more information, see
Configuring U-Boot Boot Script (boot.scr) and Configuring Primary Flash Partition.
3. Build the system image. For more information, see Building a System Image.
4. Boot a PetaLinux Image on Hardware with SD Card. For more information, see Booting
PetaLinux Image on Hardware with an SD Card.
5. Ensure that you have configured the TFTP server in the host.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 82
Chapter 7: Customizing the Project

6. Check the offsets for kernel and root file system at petalinux-config → u-boot Configuration
→ u-boot script configuration. If they do not match, the process can fail at the U-Boot
prompt.
7. Set the server IP address to the host IP address using the following command at U-Boot
prompt.
ZynqMP> setenv serverip <HOST IP ADDRESS>;

a. Detect Flash Memory.


ZynqMP> sf probe 0 0 0

b. Erase Flash Memory.


ZynqMP> sf erase 0 0x8000000

c. Read images onto Memory and write into Flash.


• Read BOOT.BIN.
ZynqMP> tftpboot 0x80000 BOOT.BIN

• Write BOOT.BIN.
ZynqMP> sf write 0x80000 0x0 $filesize

Example: sf write 0x80000 0x0 0x10EF48


• Read image.ub.
ZynqMP> tftpboot 0x80000 image.ub

• Write image.ub.
ZynqMP>sf write 0x80000 <Fit Image Flash Offset Address> $filesize

Example: sf write 0x80000 0xF40000 0x6cb0e4


• Read rootfs.ubi.
ZynqMP> tftpboot 0x80000 rootfs.ubi

• Write rootfs.ubi.
ZynqMP> sf write 0x80000 <Rootfs Flash Offset Address> $filesize

Example: sf write 0x80000 0x04000000 0x7d4000


• Read boot.scr
ZynqMP> tftpboot 0x80000 boot.scr

• Write boot.scr
ZynqMP> sf write 0x80000 <boot.scr Flash Offset Address> $filesize

Example: sf write 0x80000 0x03e80000 0x80000

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 83
Chapter 7: Customizing the Project

8. Enable QSPI flash boot mode on board.


9. Reset the board (booting starts from flash).

Calculating the Arguments for mkfs.ubifs and


ubinize
After calculating the arguments for mkfs.ubifs and ubinize, which are used in the creation
of the UBI file system, the final values need to be added to the petalinux-config options.

Calculating mkfs.ubifs Arguments

Table 21: mkfs.ubifs Args

Argument Description
The minimum I/O unit. Values are static based on the Flash type.
-m / --min-io-size • QSPI single and dual stacked value is 1
• QSPI dual parallel value is 2
• OSPI value is 1
The logical erase block size of the UBI volume. leb-size/-e = PEB size - EC -
-e / --leb-size VID = 128 K - 64 B - 64 B = 130944 B

Specifies maximum file-system size in logical erase blocks


-c / --max-leb-cnt • PEB(physical erase block) size = 128 KB . Spi datasheet or
sf probe 0 0 0
command from U-Boot terminal provide this.
• EC header for spi flash = 64 B. The link shows the default values for QSPI.
max-leb-cnt/-c = QSPI ubifs partition size÷(division) leb-size = 50 MB ÷
130944 B = 400 B

The final expanded values for mkfs.ubifs arguments are

-m 2 -e 130944 -c 400

mkfs.ubifs Arguments

Table 22: mkfs.ubifs Args

Argument Description
The minimum I/O unit. The following values are static based on the Flash
-m / --min-io-size type.
• QSPI single and dual stacked value is 1
• QSPI dual parallel value is 2
• OSPI value is 1

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 84
Chapter 7: Customizing the Project

Table 22: mkfs.ubifs Args (cont'd)

Argument Description
Tells ubinize that the physical erase block size of the flash chip for which the
-p / --peb-size UBI image is created is 128 KiB. -peb-size / -p = 128 KB . The SPI datasheet or
command from U-Boot terminal provide this value.

sf probe 0 0 0

Tells ubinize that the flash supports sub-pages. This should not be more
-s / --sub-page-size than the min-io-size. --sub-page-size / -s = 1 based on the min-io-size.

The final expanded values for ubinize arguments are

-m 2 -p 128KiB -s 1

Note: The specified mkfs.ubifs arguments and ubinize arguments are based on QSPI 128 KB erase
size

Configuring SD Card ext File System Boot


Prerequisites
This section assumes that the following prerequisites are satisfied:

• You have created a new PetaLinux project (see Creating an Empty Project from a Template)
and imported the hardware platform (see Importing Hardware Configuration).
• It is recommended to use a card with class 6 or higher to achieve optimal file transfer
performance.

Preparing the SD Card


Steps to prepare the SD card for the PetaLinux SD card ext file system boot as are follows:

For more information on how to format and partition the SD card, see Appendix I: Partitioning
and Formatting an SD Card.

The SD card is formatted with two partitions using a partition editor such as gparted. The first
partition should be at least 500 MB in size and formatted as a bootable FAT32 file partition.
Ensure that there is 4 MB of free space preceding the partition. The first partition contains the
boot loader, device tree, and kernel images. The second partition should be formatted as an ext4
files system and can take up the remaining space on the SD card. This partition stores the system
root file system.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 85
Chapter 7: Customizing the Project

1. Label the first partition as BOOT.


2. Label the second partition as RootFS.
3. Copy the files as follows:
• FAT partition:BOOT.BIN, boot.scr,Image, and ramdisk.cpio.gz.u-boot (if
switch_root is enabled)
• EXT partition: Extract rootfs.tar.gz/rootfs.cpio.gz

For optimal performance ensure that the SD card partitions are 4 MB aligned.

PetaLinux Configuration and Build System Image


Steps to configure PetaLinux for SD card ext file system boot and build the system image are as
follows:

1. Change to root directory of your PetaLinux project.


cd <plnx-proj-root>

2. Launch top level system configuration menu.


petalinux-config

3. Select Image Packaging Configuration → Root file system type.


4. Select EXT4 (SD/eMMC/SATA/USB) as the root file system type.
Note: Choose this setting to configure your PetaLinux build for EXT root. By default, it adds the SD/
eMMC device name in bootargs. For other devices (SATA/USB), you must change the ext4 device
name, as shown in the following examples:

• eMMC or SD root = /dev/mmcblkYpX


• SATA or USB root= /dev/sdX
5. Exit menuconfig and save configuration settings.
Note: The boot arguments is automatically updated in the <plnx-proj-root>/components/
plnx_workspace/device-tree/device-tree/system-conf.dtsi. These changes are
reflected only after the build.

6. Build PetaLinux images. For more information, see Building a System Image.
7. Generate boot image. For more information, see Generate Boot Image for Zynq UltraScale+
MPSoC.
8. The generated rootfs.tar.gz file is present in images/linux directory.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 86
Chapter 7: Customizing the Project

Copying Image Files


This section explains how to copy image files to SD card partitions. Assuming the two partitions
get mounted at /media/BOOT and /media/rootfs.

1. Change to the root directory of your PetaLinux project.


cd <plnx-proj-root>

2. Copy BOOT.BIN and image.ub to BOOT partition of SD card. The image.ub file has
device tree and kernel image files.
cp images/linux/BOOT.BIN /media/BOOT/
cp images/linux/image.ub /media/BOOT/
cp images/linux/boot.scr /media/BOOT/

3. Extract rootfs.tar.gz file to the root file system partition of the SD card and extract the
file system.
sudo tar xvfp rootfs.tar.gz -C /media/rootfs

In order to boot this SD card ext image, see Booting PetaLinux Image on Hardware with an SD
Card. To Create an SD image using PetaLinux use the petalinux-package --wic command.

Troubleshooting
Table 23: Configuring SD Card ext Filesystem Boot

Problem / Error Message Description and Solution


EXT4-fs (mmcblk0p2): mounted filesystem with Problem Description:
ordered data mode. Opts: (null) Kernel panic - This message indicates that the Linux kernel is unable to
not syncing: No working init found. mount EXT4 File System and unable to find working init.
Solution:
Extract RootFS in RootFS partition of SD card. For more
information, see the Copying Image Files.

Managing Image Size


In an embedded environment, it is important to reduce the size of the kernel image stored in
flash and the static size of kernel image in RAM. This section describes impact of config item
on kernel size and RAM usage.

By default, the FIT image is composed of kernel image, DTB, and Tiny RootFS image.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 87
Chapter 7: Customizing the Project

Prerequisites
This section assumes that you have PetaLinux Tools software platform ready for building a Linux
system customized to your hardware platform. For more information, see the Importing
Hardware Configuration.

Steps for Managing Image Size


The FIT Image size can be reduced using the following methods:

1. Launch the root file system configuration menu using the following command:
cd <plnx-proj-root>
petalinux-config -c rootfs

2. Select File System Packages.


Under this submenu, you can find the list of options corresponding to the root file system
packages. If your requirement does not need some of these packages, you can shrink the size
of the root file system image by disabling them.
3. Launch the kernel configuration menu using the following command:
cd <plnx-proj-root>
petalinux-config -c kernel

4. Select General Setup.


Under this submenu, you can find options to set the config items. Any item that is not
mandatory to have in the system can be disabled to reduce the kernel image size. For
example, CONFIG_SHMEM, CONFIG_AIO, CONFIG_SWAP, CONFIG_SYSVIPC. For more
details, see the Linux kernel documentation.
Note: Disabling of some config items can lead to unsuccessful boot. It is expected that you have the
knowledge of config items before disabling them.

Including extra configuration items and file system packages lead to increase in the kernel
image size and the root file system size respectively.
If the kernel or the root file system size increases and is greater than 128 MB, make the
following changes in bsp.cfg:
• Any U-Boot configuration and environment variables that are added to bsp.cfg are
included in the U-Boot build.
• Mention the Bootm length in <plnx-proj-root>/project-spec/meta-user/
recipes-bsp/u-boot/files/bsp.cfg.
#define CONFIG_SYS_BOOTM_LEN <value greater than image size>

• Undef CONFIG_SYS_BOOTMAPSZ in <plnx-proj-root>/project-spec/meta-


user/recipes-bsp/u-boot/files/bsp.cfg.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 88
Chapter 7: Customizing the Project

Note: For Microblaze changes made in bsp.cfg does not reflect please change the configurations
directly from petalinux-config -c u-boot-xlnx.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 89
Chapter 8: Customizing the Root File System

Chapter 8

Customizing the Root File System

Including Prebuilt Libraries


This section explains how to include pre-compiled libraries to PetaLinux root file system.

If a library is developed outside PetaLinux, you can add the library in the PetaLinux root file
system. In this case, an application template is created to allow copying of the existing content to
target file system.

If the application, library, or module name has ‘_’, uppercase letters, or starts with an uppercase
letter, see Recipe Name has ' _ ' or Uppercase Letters or Starts with an Uppercase Letter.

Prerequisites
This section assumes that you have PetaLinux Tools software platform ready for building a Linux
system customized to your hardware platform. For more information, see Importing Hardware
Configuration.

For detailed steps to include Prebuilt Libraries refer to PetaLinux Yocto Tips.

Including Prebuilt Applications


If an application is developed outside PetaLinux (for example, through the AMD Vitis™ software
development platform), you can add the application binary in the PetaLinux root file system. In
this case, an application template is created to allow copying of the existing content to target file
system.

If the application, library, or module name has ‘_’, uppercase letters, or starts with an uppercase
letter, see Recipe Name has ' _ ' or Uppercase Letters or Starts with an Uppercase Letter.

This section explains how to include pre-compiled applications to PetaLinux root file system.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 90
Chapter 8: Customizing the Root File System

Prerequisites
This section assumes that you have PetaLinux tools software platform ready for building a Linux
system customized for your hardware platform. For more information, see Importing Hardware
Configuration.

Including Prebuilt Applications


If your prebuilt application name is myapp, including this into PetaLinux root file system is
explained in following steps.

1. Ensure that the pre-compiled code has been compiled for your PetaLinux target architecture,
for example, MicroBlaze™ processors, Arm® cores etc.
2. Create an application with the following command.
petalinux-create apps --template install --name myapp --enable

3. Change to the newly created application directory.


cd <plnx-proj-root>/project-spec/meta-user/recipes-apps/myapp/files/

4. Remove existing myapp app and copy the prebuilt myapp into myapp/files directory.
rm myapp
$ cp <path-to-prebuilt-app> ./

IMPORTANT! You need to ensure that the binary data being installed into the target file system by an
install template application is compatible with the underlying hardware implementation of your
system.

Creating and Adding Custom Libraries


This section explains how to add custom libraries to PetaLinux root file system.

If the application, library, or module name has ‘_’, uppercase letters, or starts with an uppercase
letter, see Recipe Name has ' _ ' or Uppercase Letters or Starts with an Uppercase Letter.

Prerequisites
This section assumes that you have PetaLinux Tools software platform ready for building a Linux
system customized to your hardware platform. For more information, see Importing Hardware
Configuration.

For detailed Steps to Add Custom Libraries refer to PetaLinux Yocto Tips.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 91
Chapter 8: Customizing the Root File System

Creating Apps in PetaLinux Project


Prerequisites
This section assumes that you have PetaLinux Tools software platform ready for building a Linux
system customized to your hardware platform. For more information, see Importing Hardware
Configuration.

If the application, library, or module name has ‘_’, uppercase letters, or starts with an uppercase
letter, see Recipe Name has ' _ ' or Uppercase Letters or Starts with an Uppercase Letter.

For detailed Steps to Testing User Libraries PetaLinux Yocto Tips.

Creating and Adding Custom Applications


This section explains how to add custom applications to PetaLinux root file system.

If the application, library, or module name has ‘_’, uppercase letters, or starts with an uppercase
letter, see Recipe Name has ' _ ' or Uppercase Letters or Starts with an Uppercase Letter.

Prerequisites
This section assumes that you have PetaLinux tools software platform ready for building a Linux
system customized to your hardware platform. For more information, see Importing Hardware
Configuration.

Adding Custom Applications


The basic steps are as follows:

1. Create a user application by running petalinux-create apps from inside a PetaLinux


project on your workstation:
cd <plnx-proj-root>
$ petalinux-create apps --template <TYPE> --name <user-application-name>
--enable

For example, to create a user application called myapp in C (the default):


petalinux-create apps --name myapp --enable

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 92
Chapter 8: Customizing the Root File System

or:
petalinux-create apps --template c --name myapp --enable

To create a C++ application template, pass the --template c++ option, as follows:
petalinux-create apps --template c++ --name myapp --enable

To create an autoconf application template, pass the --template autoconf option, as


follows:
petalinux-create apps --template autoconf --name myapp --enable

The new application sources can be found in the <plnx-proj-root>/project-spec/


meta-user/recipes-apps/myapp directory.
2. Change to the newly created application directory.
cd <plnx-proj-root>/project-spec/meta-user/recipes-apps/myapp

You should see the following PetaLinux template-generated files:

Table 24: Adding Custom Applications Files

Template Description
<plnx-proj-root>/project- spec/meta-user/ Configuration file template - This file controls the
conf/user-rootfsconfig integration of your application into the PetaLinux RootFS
menu configuration. It also allows you select or de-select
the app and its dev, dbg packages into the target root file
system
Makefile Compilation file template - This is a basic Makefile
containing targets to build and install your application
into the root file system. This file needs to be modified
when you add additional source code files to your project.
README A file to introduce how to build the user application.
myapp.c for C; Simple application program in either C or C++, depending
myapp.cpp for C++ upon your choice.

Note: If you want to use the build artifacts for debugging with third party utilities, add the following
line in <plnx-proj-root>/project-spec/meta-user/conf/petalinuxbsp.conf:

RM_WORK_EXCLUDE += "myapp"

Note: You can find all build artifacts under ${TMPDIR}/work/<arch>/myapp/1.0./r0/

where arch can be:

• aarch64(zynqmp and versal) - cortexa72-cortexa53-xilinx-linux


• arm(zynq) - cortexa9t2hf-neon-xilinx-linux-gnueabi/
• microblaze - microblazeel-v11.0-bs-cmp-re-mh-div-xilinx-linux/

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 93
Chapter 8: Customizing the Root File System

Note: Applications created using the petalinux-create -t apps command have debug symbols
by default in the following path if you comment out rm_work: <plnx-proj-root>/build/conf/
local.conf.<plnx-proj-root>/build/tmp/work/aarch64-xilinx-linux/<app-
name>/1.0-r0/packages-split/<app-name>-dbg/usr/bin/.debug/<app-name>.

TIP: Mapping of Make file clean with do_clean in recipe is not recommended. This is because Yocto
maintains its own do_clean.

3. myapp.c/myapp.cpp file can be edited or replaced with the real source code for your
application. If you want to modify your custom user application later, this file should be
edited.

CAUTION! You can delete the app directory if it is no longer required. You must also remove the line:
CONFIG_myapp from <plnx-proj-root>/project-spec/meta-user/conf/user-
rootfsconfig. Deleting the directory while keeping the mentioned line throws an error.

Creating and Adding Custom Kernel Modules


This section explains how to add custom kernel modules to PetaLinux root file system.

If the application, library, or module name has ‘_’, uppercase letters, or starts with an uppercase
letter, see Recipe Name has ' _ ' or Uppercase Letters or Starts with an Uppercase Letter.

Prerequisites
This section assumes that you have PetaLinux Tools software platform ready for building a Linux
system customized to your hardware platform. For more information, see Importing Hardware
Configuration for more information.

Adding Custom Modules


This section explains how to add custom kernel modules:

1. Create a user module by running petalinux-create modules from inside a PetaLinux


project on your workstation:
cd <plnx-proj-root>
petalinux-create modules --name <user-module-name> --enable

For example, to create a user module called mymodule in C (the default):


petalinux-create modules --name mymodule --enable

You can use -h or --help to see the usage of the petalinux-create modules. The
new module recipe you created can be found in the <plnx-proj-root>/project-spec/
meta-user/recipes-modules/mymodule directory.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 94
Chapter 8: Customizing the Root File System

Note: If the module name has '_' or uppercase letters or starts with an uppercase letter, see Recipe
Name has ' _ ' or Uppercase Letters or Starts with an Uppercase Letter.

2. Change to the newly created module directory.


cd <plnx-proj-root>/project-spec/meta-user/recipes-modules/mymodule
You should see the following PetaLinux template-generated files:

Table 25: Adding Custom Module Files

Template Description
Makefile Compilation file template - This is a basic Makefile
containing targets to build and install your module into
the root file system. This file needs to be modified when
you add additional source code files to your project. Click
here to customize the make file.
README A file to introduce how to build the user module.
mymodule.c Simple kernel module in C.
<plnx-proj-root>/project- spec/meta-user/ Configuration file template - This file controls the
conf/user-rootfsconfig integration of your application/modules/libs into
the PetaLinux RooFS menu configuration system. It also
allows you to select or de-select the app and its dev, dbg
packages into the target root file system.

3. mymodule.c file can be edited or replaced with the real source code for your module.
Note: If you want to use the build artifacts for debugging with the third party utilities, add the
following line in project-spec/meta-user/conf/petalinuxbsp.conf:

RM_WORK_EXCLUDE += "mymodule"

Note: You can find all build artifacts under ${TMPDIR}/work/aarch64-xilinx-linux/mymodule/


1.0-r0/.

Note: The modules created with petalinux-create -t modules have debug symbols by default.

CAUTION! You can delete the module directory if it is no longer required. Apart from deleting the module
directory, you have to remove the line: CONFIG_mymodule from <plnx-proj-root>/project-
spec/meta-user/conf/user-rootfsconfig . Deleting the directory while keeping the
mentioned line in user-rootfsconfig throws an error.

Building User Applications


This section explains how to build and install pre-compiled/custom user applications to PetaLinux
root file system.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 95
Chapter 8: Customizing the Root File System

Prerequisites
This section assumes that you have included or added custom applications to PetaLinux root file
system (see Creating and Adding Custom Applications).

Building User Applications


Running petalinux-build in the project directory <plnx-proj-root> rebuilds the system
image including the selected user application myapp. (The output directory for this build process
is <TMPDIR>/work/<arch>/myapp/1.0-r0/) where arch can be:

• aarch64(zynqmp and versal) - cortexa72-cortexa53-xilinx-linux


• arm(zynq) - cortexa9t2hf-neon-xilinx-linux-gnueabi/
• microblaze - microblazeel-v11.0-bs-cmp-re-mh-div-xilinx-linux/

petalinux-build

To build myapp into an existing system image:

cd <plnx-proj-root>
petalinux-build -c rootfs
petalinux-build -x package

Other petalinux-build options are explained with --help. Some of the build options are:

• To clean the selected user application:


petalinux-build -c myapp -x do_clean

• To rebuild the selected user application:


petalinux-build -c myapp

This compiles the application. The compiled executable files are in the <TMPDIR>/work/
<arch>/myapp/1.0-r0/ directory where arch can be:
○ aarch64(zynqmp and versal) - cortexa72-cortexa53-xilinx-linux

○ arm(zynq) - cortexa9t2hf-neon-xilinx-linux-gnueabi/

○ microblaze - microblazeel-v11.0-bs-cmp-re-mh-div-xilinx-linux/

If you want to use the build artifacts for debugging with the third party utilities, add the line:
RM_WORK_EXCLUDE += "myapp" in <plnx-proj-root>/project-spec/meta-
user/conf/petalinuxbsp.conf. Refer Chapter 9: Debugging for more information.
Without this line, the BitBake removes all the build artifacts after building successfully.
• To see all list of tasks for myapp:
petalinux-build -c myapp -x listtasks

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 96
Chapter 8: Customizing the Root File System

• To install the selected user application:


petalinux-build -c myapp -x do_install

This installs the application into the target the root file system host copy: <TMPDIR>/work/
<MACHINE_NAME>-xilinx-linux/petalinux-image-minimal/1.0-r0/rootfs/.
TMPDIR can be found in petalinux-config → Yocto-settings → TMPDIR. If the project is on
local storage, TMPDIR is <plnx-proj-root>/build/tmp/.
If you want to use the build artifacts for debugging with third party utilities, add the following
line in project-spec/meta-user/conf/petalinuxbsp.conf:
RM_WORK_EXCLUDE += "myapp"

Testing User Applications


Prerequisites
This section assumes you have built and installed pre-compiled/custom user applications. For
more information, see Building User Applications.

Testing User Application


1. Boot the newly created system image on target or QEMU.
2. Confirm that your user application is present on the PetaLinux system by running the
following command on the target system login console:
# ls /usr/bin

Unless you have changed the location of the user application through its Makefile, the user
application is placed into the /usr/bin directory.
3. Run your user application on the target system console. For example, to run the user
application myapp:
# myapp

4. Confirm that the result of the application is as expected.

If the new application is missing from the target file system, ensure that you have completed the
petalinux-build -x package step as described in the previous section. This ensures that
your application binary is copied into the root file system staging area, and that the target system
image is updated with this new file system.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 97
Chapter 8: Customizing the Root File System

Building User Modules


This section explains how to build and install custom user kernel modules to PetaLinux root file
system.

Prerequisites
This section assumes that you have included or added custom modules to PetaLinux root file
system (see Creating and Adding Custom Kernel Modules).

Building User Modules


Running petalinux-build in the project directory "<plnx-proj-root>" rebuilds the
system image including the selected user module mymodule. (The output directory for this build
process is <TMPDIR>/work/<MANCHINE_NAME>-xilinx-linux/mymodule/1.0-r0/)

petalinux-build

To build mymodule into an existing system image:

cd <plnx-proj-root>
petalinux-build -c rootfs
petalinux-build -x package

Other petalinux-build options are explained with --help. Some of the build options are:

• To clean the selected user module:


petalinux-build -c mymodule -x do_cleansstate

• To rebuild the selected user module:


petalinux-build -c mymodule

This compiles the module. The compiled executable files are placed in <TMPDIR>/work/
<MANCHINE_NAME>-xilinx-linux/mymodule/1.0-r0/ directory.
• To see all list of tasks for this module:
petalinux-build -c mymodule -x listtasks

• To install the selected user module:


petalinux-build -c mymodule -x do_install

This installs the module into the target the root file system host copy: <TMPDIR>/work/
<MACHINE_NAME>-xilinx-linux/petalinux-image-minimal/1.0-r0/rootfs/.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 98
Chapter 8: Customizing the Root File System

TMPDIR can be found in petalinux-config → Yocto-settings → TMPDIR. If the project is on


local storage, TMPDIR is <${PROOT}>/build/tmp/.
If you want to use the build artifacts for debugging with third party utilities, add the following
line in project-spec/meta-user/conf/petalinuxbsp.conf:
RM_WORK_EXCLUDE += "mymodule"

PetaLinux Auto Login


This section explains how to login directly from boot without having to enter login credentials.

Prerequisites
This section assumes that you have PetaLinux tools software platform ready for building a Linux
system customized to your hardware platform. For more information, see Importing Hardware
Configuration.

Steps to Enable Serial Auto Login


To enable autologin to root on serial console devices, this option works in conjuction with empty-
root-password. When you select this option, it automatically selects the empty-root-password.

Follow these steps to enable the Serial Auto Login feature:

1. Change to the root directory of your PetaLinux project.


cd <plnx-proj-root>

2. Run petalinux-config -c rootfs.


3. Select Image Features → serial-autologin-root.
4. Save the configuration and exit.
5. Run petalinux-build.

Application Auto Run at Startup


This section explains how to add applications that run automatically at system startup.

If the application, library, or module name has ‘_’, uppercase letters, or starts with an uppercase
letter, see Recipe Name has ' _ ' or Uppercase Letters or Starts with an Uppercase Letter.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 99
Chapter 8: Customizing the Root File System

Prerequisites
This section assumes that you have already added and built the PetaLinux application. For more
information, see Creating and Adding Custom Applications and Building User Applications.

For the steps on how to auto run application at start up, see PetaLinux Yocto Tips.

Adding Layers
You can add layers to the PetaLinux project. The upstream layers for the Langdale version of
Yocto can be found at Layers.

The following steps demonstrate how to add the meta-my layer into the PetaLinux project.

1. Copy or create a layer in <proj_root>/project-spec/meta-mylayer.


2. Run petalinux-config → Yocto Settings → User Layers.
3. Enter the following:
${PROOT}/project-spec/meta-mylayer

4. Save and exit.


5. Verify by viewing the file in <proj_root>/build/conf/bblayers.conf.

Note: The 2024.1 release of the PetaLinux tool is on the Langdale baseline. Choose the layers/recipes from
the Langdale branch only. Some of the layers/recipes might not be compatible with the current
architecture. You are responsible for all additional layers/recipes.

Note: You can also add a layer that is outside your project; such layers can be shared across projects.
Ensure that the added layer has <layer>/conf/layer.conf; otherwise, it causes build errors.

IMPORTANT! If you want to change the layer priority, you can update ${PROOT}/project-spec/
meta-mylayer/conf/layer.conf to set BBFILE_PRIORITY_meta-mylayer = 7 (0 to 99,
higher values have higher priority).

Note: By default, the meta-user layer in the PetaLinux project has a PRIORITY of 7. A PRIORITY level that
is equivalent or higher than meta-user can be used to override or use the meta-user changes before the
custom layer changes. For more information, see Support.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 100
Chapter 8: Customizing the Root File System

Adding an Existing Recipe into the Root File


System
Most of the root file system menu config is static. These are the utilities that are supported by
AMD. You can add your own layers in a project or add existing additional recipes from the
existing layers in PetaLinux. Layers in PetaLinux can be found in <plnx-proj-root>/
components/yocto/layers.

By default, iperf3 is not in the root file system menuconfig. The following example
demonstrates adding the iperf3 into the root file system menuconfig.

1. The location of the recipe is <plnx-proj-root>/components/yocto/layers/meta-


openembedded/meta-oe/recipes-benchmark/iperf3/iperf3_3.2.bb.
2. Add the following line in <plnx-proj-root>/project-spec/meta-user/conf/
user-rootfsconfig.
CONFIG_iperf3

3. Run petalinux-config -c rootfs.


4. Select user packages → iperf3. Enable it, save, and exit.
5. Run petalinux-build.
Note: It is your responsibility to add the recipes in the layers available in PetaLinux tools, apart from
PetaLinux default RootFS menuconfig.

Note: The previous procedure is applicable only to the recipes from the existing layers.

IMPORTANT! All recipes which are in petalinux-image-full have sstate locked. It does not
allows any build with modifications and uses the binary from sstate . To unlock, ensure to add
SIGGEN_UNLOCKED_RECIPES += "my-recipe" in project-spec/meta-user/conf/
petalinuxbsp.conf.

For example, you have changes to be made in mtd-utils package, so you have created a .bbappend
for the same without SIGGEN_UNLOCKED_RECIPES += "mtd-utils" in project-spec/meta-
user/conf/petalinuxbsp.conf. During project build, you should see the following warning.
Your changes for the package are not included in the build.

"The mtd-utils:do_fetch sig is computed to be


92c59aa3a7c524ea790282e817080d0a, but the sig is locked to
9a10549c7af85144d164d9728e8fe23f in SIGGEN_LOCKEDSIGS_t"

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 101
Chapter 8: Customizing the Root File System

Adding a Package Group


One of the best approaches for customizing images is to create a custom package group to be
used for building the images. Some of the package group recipes are shipped with the PetaLinux
tools.

For example:

<plnx-proj-root>/components/yocto/layers/meta-petalinux/recipes-core/
packagegroups/packagegroup-petalinux-self-hosted.bb

The name of the package group should be unique and should not conflict with the existing recipe
names.

You can create custom package group, for example, an ALSA package group would look like:

DESCRIPTION = "PetaLinux ALSA supported Packages"

inherit packagegroup

ALSA_PACKAGES = " \
alsa-lib \
alsa-plugins \
alsa-tools \
alsa-utils \
alsa-utils-scripts \
pulseaudio \
"
RDEPENDS:${PN}:append = " \
${ALSA_PACKAGES} \
"

This can be added to <plnx-proj-root>/meta-user/recipes-core/packagegroups/


packagegroup-petalinux-alsa.bb.

To add this package group in RootFS menuconfig, add CONFIG_packagegroup-petalinux-


alsa in <plnx-proj-root>/project-spec/meta-user/conf/user-rootfsconfig to
reflect in menuconfig.

Launch petalinux-config -c rootfs, select user packages → packagegroup-petalinux-


alsa, save, and exit. Run petalinux-build.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 102
Chapter 8: Customizing the Root File System

Appending Root File System Packages


In earlier releases, to add new packages to the root file system, you had to edit the <plnx-
proj-root>/project-spec/meta-user/recipes-core/images/petalinux-image-
full.bbappend file. For example:

IMAGE_INSTALL:append = "opencv"

From 2020.1 release onwards, you have to use the <plnx-proj-root>/project-spec/


meta-user/conf/user_rootfsconfig file to append new root file system packages to
PetaLinux images. For example:

CONFIG_opencv

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 103
Chapter 9: Debugging

Chapter 9

Debugging

Debugging the Linux Kernel in QEMU


This section describes how to debug the Linux Kernel inside QEMU using the GNU debugger
(GDB). This function is only tested with AMD Zynq™ 7000 devices. For more information, see
Vitis Unified Software Platform Documentation: Embedded Software Development (UG1400).

Prerequisites
This section assumes that you have built PetaLinux system image. For more information, see
Building a System Image.

Steps to Debug the Linux Kernel in QEMU


1. Launch QEMU with the currently built Linux by running the following command:
petalinux-boot qemu --kernel

2. Watch the QEMU console. You should see the details of the QEMU command. Get the GDB
TCP port from -gdb tcp:<TCP_PORT> (Assume TCP_PORT as 9000).
3. Open another command console (ensuring the PetaLinux settings script has been sourced),
and change to the Linux directory:
cd "<plnx-proj-root>/images/linux"

4. Start GDB on the vmlinux kernel image in command mode:


petalinux-util gdb vmlinux

You should see the GDB prompt. For example:


petalinux-util gdb vmlinux
[NOTE] Argument: "gdb" has been deprecated. It is recommended to start
using new python command line Argument.
[NOTE] Use: petalinux-util gdb [OPTIONS]
[INFO] aarch64-linux-gnu-gdb vmlinux -iex "set auto-load safe-path /wrk/
everest_fcv_nobkup/_vhk158_prod/xilinx-vhk158-2024.1:/tmp"
GNU gdb (GDB) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 104
Chapter 9: Debugging

gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-petalinux-linux --
target=aarch64-xilinx-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".


Type "apropos word" to search for commands related to "word"...
vmlinux: No such file or directory.
(gdb)

5. Attach to the QEMU target in GDB by running the following GDB command:
(gdb) target remote :9000

6. To let QEMU continue execution:


(gdb) continue

7. You can use Ctrl+C to interrupt the kernel and get back the GDB prompt.
8. You can set break points and run other GDB commands to debug the kernel.

CAUTION! If another process is using port 9000, petalinux-boot attempts to use a different port.
See the output of petalinux-boot to determine what port was used. In the following example, port
9001 is used: INFO: qemu-system-arm ... -gdb tcp::9001 ...

TIP: It can be helpful to enable kernel debugging in the kernel configuration menu (petalinux-config -c
kernel → Kernel Hacking → Kernel Debugging), so that kernel debug symbols are present in the image.

Troubleshooting
This section describes some common issues you can experience while debugging the Linux
kernel in QEMU.

Table 26: Debugging the Linux Kernel in QEMU Troubleshooting

Problem / Error Message Description and Solution


(gdb) target remote W.X.Y.Z:9000:9000: Problem Description:
Connection refused. GDB failed to attach the QEMU target. This is most likely because
the port 9000 is not the one QEMU is using
Solution:
Check your QEMU console to ensure QEMU is running.
Watch the Linux host command line console. It should show the full
QEMU commands and you should be able to see which port is
being used by QEMU.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 105
Chapter 9: Debugging

Debugging Applications with TCF Agent


This section describes debugging user applications with the Eclipse Target Communication
Framework (TCF) Agent. The procedure for debugging applications with TCF agent remains the
same for AMD Versal™ platform, AMD Zynq™ UltraScale+™ MPSoC, and Zynq 7000 devices.
This section describes the basic debugging procedure for Zynq platform user application myapp.

Prerequisites
This section assumes that the following prerequisites are satisfied:

• Working knowledge of the AMD Vitis™ software platform. For more information, see Vitis
Unified Software Platform Documentation: Embedded Software Development (UG1400).
• The PetaLinux Working Environment is properly set. For more information, see PetaLinux
Working Environment Setup.
• You have created a user application and built the system image including the selected user
application. For more information, see Building User Applications.

Preparing the Build System for Debugging


1. Change to the project directory:
cd <plnx-proj-root>

2. Run petalinux-config -c rootfs on the command console:


petalinux-config -c rootfs

3. Scroll down the Linux/RootFS configuration menu to file system packages.


admin --->
audio --->
base --->
baseutils --->
benchmark --->
bootloader --->
console --->
devel --->
fonts --->
kernel --->
libs --->
misc --->
multimedia --->
net --->
network --->
optional --->
power management --->
utils --->
x11 --->

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 106
Chapter 9: Debugging

4. Select misc submenu:


admin --->
audio --->
base --->
baseutils --->
benchmark --->
bootloader --->
console --->
devel --->
fonts --->
kernel --->
libs --->
misc --->
multimedia --->
net --->
network --->
optional --->
power management --->
utils --->
x11 --->

5. Packages are in alphabetical order. Navigate to the letter ‘t’, as follows:


serf --->
sysfsutils --->
sysvinit-inittab --->
tbb --->
tcf-agent --->
texi2html --->
tiff --->
trace-cmd --->
util-macros --->
v4l-utils --->

6. Ensure that tcf-agent is enabled and gdbserver is disabled.


[*] tcf-agent
[ ] tcf-agent-dev
[ ] tcf-agent-dbg

7. Select console/network submenu, click dropbear submenu. Ensure "dropbear-openssh-sftp-


server" is enabled.
[*] dropbear

8. Select console/network → openssh. Ensure that "openssh-sftp-server" is disabled.


9. Exit the menu.
10. Rebuild the target system image, including hello_linux.elf. For more information, see Building
a System Image.

Performing a Debug Session


Creating a Linux Application and Debugging in the Vitis Software Platform

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 107
Chapter 9: Debugging

1. Launch the Vitis software platform.

2. Create a Linux application by following these steps:


a. Select File –> Go to New Application Project.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 108
Chapter 9: Debugging

b. Create a platform from the provided .xsa file.

c. Choose a name for your application and select the target processor.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 109
Chapter 9: Debugging

d. Specify domain details, setting the Operating System to Linux.

e. Select an application template (for example, Hello World).

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 110
Chapter 9: Debugging

3. Choose the application you wish to debug.

4. Select Run –> Debug Configuration.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 111
Chapter 9: Debugging

5. Click Launch on Hardware (Single Application Debug) to create a new configuration.

6. In the Debug Configuration window, follow these steps:


a. In the Main Tab, do the following:

• From the Debug Type drop-down list, select Linux Application Debug.
• From the Connection drop-down list, choose Linux agent.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 112
Chapter 9: Debugging

b. In the Application Tab, provide the necessary information:

i. In the Remote File Path field, specify the path in Linux where you want to download
the application.
c. If your application expects any command-line arguments, specify them in the Arguments
tab.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 113
Chapter 9: Debugging

d. If your application relies on specific environment variables, define them in the


Environment tab.

e. Set up the target connection by entering the Linux hostname or IP address in the
Hostname field.

Note: By default, the tcf-agent runs on port 1534 on the Linux machine. If you use a different port,
update the Port field with the correct port number.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 114
Chapter 9: Debugging

7. Click the Debug button. This will open a separate console for processing standard I/O
operations.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 115
Chapter 9: Debugging

8. Set breakpoints by double-clicking on the desired lines of code.

9. To continue execution, click Resume.

10. For stepping through the code, follow these options:


• Step Over: Click this to execute the current line and move to the next line in the same
function.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 116
Chapter 9: Debugging

• Step-In: Click this to enter into a called function.

• Step-Rerun: Click this to re-execute the current line.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 117
Chapter 9: Debugging

11. To continue running the application after stepping through the code, click Resume again.

Ensure that you follow these steps carefully to successfully create a Linux application and debug
it using the Vitis software platform.

Debugging Zynq UltraScale+ MPSoC and


Versal Adaptive SoC Applications with GDB
PetaLinux supports debugging AMD Zynq™ UltraScale+™ MPSoC and AMD Versal™ user
applications with GDB. This section describes the basic debugging procedure. For more
information, refer to Vitis Unified Software Platform Documentation: Embedded Software
Development (UG1400).

Prerequisites
This section assumes that the following prerequisites are satisfied:

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 118
Chapter 9: Debugging

• The PetaLinux Working Environment is properly set. For more information, see PetaLinux
Working Environment Setup.
• You have created a user application and built the system image including the selected user
application. For more information, see Building User Applications.

Preparing the Build System for Debugging


1. Change to the project directory:
cd <plnx-proj-root>

2. Add the following lines in <plnx-proj-root>/project-spec/meta-user/conf/


user-rootfsconfig:
CONFIG_myapp-dev
CONFIG_myapp-dbg

3. Add the following lines in <plnx-proj-root>/project-spec/meta-user/recipe-


apps/myapp/myapp.bb.

DEBUG_FLAGS = "-g3 -O0"

# Specifies to build packages with debugging information


DEBUG_BUILD = "1"

# Do not remove debug symbols


INHIBIT_PACKAGE_STRIP = "1"

# OPTIONAL: Do not split debug symbols in a separate file


INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

4. Run petalinux-config -c rootfs on the command console:


petalinux-config -c rootfs

5. Scroll down the user packages Configuration menu to Debugging:


Filesystem Packages --->
PetaLinux Package Groups --->
apps --->
user packages --->
PetaLinux RootFS Settings --->

6. Select user packages.


[X] myapp-dbg
[ ] myapp-dev

7. Select myapp-dbg. Exit the myapp submenu.


8. Exit the user packages submenu, and select Filesystem Packages → misc → gdb.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 119
Chapter 9: Debugging

9. Select gdb, and ensure that the GDB server is enabled:


[ ] gdb
[ ] gdb-dev
[X] gdbserver
[ ] gdb-dbg

10. Exit the menu and select <Yes> to save the configuration.
11. Select Filesystem Packages → misc → tcf-agent.
12. Deselect tcf-agent as it uses the same 1534 port. Exit the menu and save the configuration.
13. Rebuild the target system image. Add the following line in <plnx-proj-root>/project-
spec/meta-user/conf/petalinuxbsp.conf.
RM_WORK_EXCLUDE += "myapp"

For more information, see Building a System Image.

Performing a Debug Session


To perform a debug session, follow these steps:

1. Boot your board (or QEMU) with the previously created new image.
2. For the QEMU boot to redirect the host port, issue the following qemu-args.
petalinux-boot qemu --kernel --qemu-args "-net nic -net nic -net nic -
net nic,netdev=gem3 -netdev user,id=gem3,hostfwd=tcp::1534-:1534"

Note: Based on the gem number, provide the -net nic options. You can find the gem number in the
<plnx-proj-root>/components/plnx_workspace/device-tree/device-tree/
pcw.dtsi file.

3. Run gdbserver with the user application on the target system console (set to listening on
port 1534):
root@plnx_aarch64:~# gdbserver :1534 /usr/bin/myapp
Process /bin/myapp created; pid = 73
Listening on port 1534

1534 is the gdbserver port - it can be any unused port number


4. On the workstation, navigate to the compiled user application’s directory:
cd <<TMPDIR>/work/cortexa72-cortexa53-xilinx-linux/myapp/1.0-r0/
image/usr/bin/

5. Run GDB client.


petalinux-util gdb myapp

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 120
Chapter 9: Debugging

The GDB console starts:


...
GNU gdb (crosstool-NG 1.18.0) 7.6.0.20130721-cvs
...
(gdb)

6. In the GDB console, connect to the target machine using the command:
• Use the IP address of the target system, for example: 192.168.0.10. If you are not sure
about the IP address, run ifconfig on the target console to check.
• Use the port 1534. If you select a different GDB server port number in the earlier step,
use that value instead.

IMPORTANT! If debugging on QEMU, refer to the QEMU Virtual Networking Modes for information
regarding IP and port redirection when testing in non-root (default) or root mode. For example, if
testing in non-root mode, you should use local host as the target IP in the subsequent steps.

(gdb) target remote 192.168.0.10:1534

The GDB console attaches to the remote target. The GDB server on the target console
displays the following confirmation, where the host IP is displayed:
Remote Debugging from host 192.168.0.9

7. Before starting the execution of the program, create some breakpoints. Using the GDB
console you can create breakpoints throughout your code using function names and line
numbers. For example, create a breakpoint for the main function:
(gdb) break main
Breakpoint 1 at 0x10000444: file myapp.c, line 10.

8. Run the program by executing the continue command in the GDB console. GDB begins the
execution of the program.
(gdb) continue
Continuing.
Breakpoint 1, main (argc=1, argv=0xbffffe64) at myapp.c:10
10 printf("Hello, PetaLinux World!\n");

9. To print a list of the code at current program location, use the list command.
(gdb) list
5 */
6 #include <stdio.h>
7
8 int main(int argc, char *argv[])
9 {
10 printf("Hello, PetaLinux World!\n");
11 printf("cmdline args:\n");
12 while(argc--)
13 printf("%s\n",*argv++);
14

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 121
Chapter 9: Debugging

10. Try the step, next, and continue commands. Breakpoints can be set and removed using
the break command. More information on the commands can be obtained using the GDB
console help command.
11. The GDB server application on the target system exits when the program has finished
running. Here is an example of messages shown on the console:
Hello, PetaLinux World!
cmdline args:
/usr/bin/myapp
Child exited with status 0
GDBserver exiting
root@plnx_aarch64:~#

TIP: A .gdbinit file is automatically created to setup paths to libraries. You can add your own GDB
initialization commands at the end of this file.

Going Further with GDB


Visit www.gnu.org for more information. For information on general usage of GDB, refer to the
GDB project documentation.

Troubleshooting
This section describes some common issues you can experience while debugging applications
with GDB.

Table 27: Debugging Zynq UltraScale+ MPSoC Applications with GDB Troubleshooting

Problem / Error Message Description and Solution


GDB error message: <IP Address>:<port>: Problem Description:
Connection refused. GDB cannot connect to the This error message indicates that the GDB client failed to
target board using <IP>: <port> connect to the GDB server.
Solution:
Check whether the gdbserver is running on the target
system.
Check whether there is another GDB client already
connected to the GDB server. This can be done by looking at
the target console. If you can see Remote Debugging from
host <IP>, it means there is another GDB client connecting
to the server.
Check whether the IP address and the port are correctly set.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 122
Chapter 9: Debugging

Debugging Individual PetaLinux Components


PMU Firmware
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841724/PMU
+Firmware#PMUFirmware-DebuggingPMUFWusingSDK

FSBL
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842019/FSBL#FSBL-
WhatarevariouslevelsofdebugprintsinFSBL

U-Boot
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842557/Debug+U-boot

Linux

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/123011167/Linux+Debug+infrastructure
+KProbe+UProbe+LTTng

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/123011146/Linux+Debug+infrastructure
+Kernel+debugging+using+KGDB

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 123
Chapter 10: Advanced Configurations

Chapter 10

Advanced Configurations

Menuconfig Usage
To select a menu/submenu which was deselected before, press the down arrow key to scroll
down the menu or the up arrow key to scroll up the menu. Once the cursor is on the menu, press
y. To deselect a menu/submenu, follow the same process and press n at the end.

PetaLinux Menuconfig System


The PetaLinux menuconfig system configuration for AMD Zynq™ UltraScale+™ MPSoC is shown
in the following figure:

Figure 4: PetaLinux Menuconfig System

Linux Components Selection


For Zynq UltraScale+ MPSoC, the Linux system components available in the submenu are as
follows:

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 124
Chapter 10: Advanced Configurations

Figure 5: Linux Components Selection

• Image Selector (Zynq UltraScale+ MPSoC only)


• First stage boot loader
• PMU firmware, for AMD Zynq™ UltraScale+™ only
• PLM and PSM firmware for AMD Versal™ platform only
• U-Boot
• Kernel
• TF-A, for Zynq UltraScale+ MPSoC and Versal platforms only

For TF-A, U-Boot, and kernel there are three available options:

• Default: The default component is shipped with the PetaLinux tool.

• External source: When you have a component downloaded at any specified location, you can
feed your component instead of the default one through this configuration option.

Note: The external source folder is required to be unique to a project and its user, but the content can
be modified. If the external source is a git repository, its checked out state should be appropriate for
building this project.

• Remote: If you want to build a component which was on a custom git repository, this
configuration option has to be used.

Auto Config Settings


When a component is selected to enable automatic configuration (autoconfig) in the system-level
menuconfig, its configuration files are automatically updated when the petalinux-config is
run.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 125
Chapter 10: Advanced Configurations

Figure 6: Auto Config Settings

Note: The kernel autoconfig and U-Boot auto config options are only available for MicroBlaze processors.
They are unavailable for other architectures.

Note: All the changes in "DTG Settings" will not be applied if the "Auto Config Settings -> Device tree
autoconfig" option is disabled.

Table 28: Components and their Configuration Files

Component in the Menu Files Impacted when the Autoconfig is enabled


Device tree The following files are in <plnx-proj-root>/components/plnx_workspace/
device-tree/device-tree/

• skeleton.dtsi (Zynq 7000 devices only)

• zynq-7000.dtsi (Zynq 7000 devices only)

• zynqmp-clk-ccf.dtsi (Zynq UltraScale+ MPSoC only)

• pcw.dtsi (Zynq 7000 devices, Zynq UltraScale+ MPSoC, and Versal devices)

• pl.dtsi

• system-conf.dtsi

• system-top.dts

• <board>.dtsi

• versal.dtsi (for Versal devices only)

• versal-clk.dtsi (for Versal devices which have clock framework)

kernel (only for MicroBlaze The following files are in <plnx-proj-root>/project-spec/configs/linux-xlnx/


processors) plnx_kernel.cfg

Note: plnx_kernel.cfg is generated only when petalinux-config → Auto Config


Settings → kernel autoconfig is enabled.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 126
Chapter 10: Advanced Configurations

Table 28: Components and their Configuration Files (cont'd)

Component in the Menu Files Impacted when the Autoconfig is enabled


U-Boot (only for MicroBlaze The following files are in <plnx-proj-root>/project-spec/configs/u-boot-
processors) xlnx/config.cfg

• config.mk (MicroBlaze only)

Note: config.cfg are generated only when petalinux-config → Auto Config Settings
→ u-boot autoconfig is enabled.

Building Device Tree Overlays for PS


Sometimes you can have the base target with carrier cards. You can initialize the carrier card
peripherals as overlays. You can use the following menu config to build the device tree overlays
for those carrier cards. You can provide dts/dtsi files with relative/absolute path with space
separation. It builds the dtbo files and packs them as part of the root filesystem in /tmp/
<build>.

Figure 7: PS Overlay dtbos

Subsystem AUTO Hardware Settings


The Subsystem AUTO Hardware settings menu allows you to customize how the Linux system
interacts with the underlying hardware platform.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 127
Chapter 10: Advanced Configurations

Figure 8: Subsystem AUTO Hardware Settings

System Processor

The System processor menu specifies the CPU processor on which the system runs.

Memory Settings

The memory settings menu allows you to:

• Select which memory IP is the primary system memory


• Set the system memory base address
• Set the size of the system memory
• Set the U-Boot text base address offset to a memory high address

The configuration in this menu impacts the memory settings in the device tree and U-Boot
automatic configuration (autoconfig) files.

If manual is selected as the primary memory, you are responsible for ensuring proper memory
settings for the system.

Serial Settings

The Serial Settings submenu allows you to select which serial device is the system’s primary
STDIN/STDOUT interface. If manual is selected as the primary serial, you are responsible for
ensuring proper serial interface settings for the system.

Configure PetaLinux project with CoreSight dcc/Arm dcc:

To enable CoreSight dcc options go to petalinux-config → Auto hardware settings → serial


settings → select the coresight(dcc)

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 128
Chapter 10: Advanced Configurations

To configure kernel use Petalinux-config -c kernel → ARM JTAG DCC Console

petalinux-build
petalinux-package boot --uboot
petalinux-boot jtag --kernel --rootfs images/linux/rootfs.cpio.gz.u-boot --
hw_server-url < board name>

Note: CoreSight/dcc ip is supported only on Arm based processors like FSBL, TF-A , U-BOOT, and LINUX.

Ethernet Settings

The Ethernet Settings submenu allows you to:

• Select which Ethernet is the systems’ primary Ethernet


• Select to randomize MAC address

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 129
Chapter 10: Advanced Configurations

• Set the MAC address of the selected primary Ethernet. By default, the address is set to
ff:ff:ff:ff:ff:ff invalid mac.

If a MAC address is programmed into the EEPROM and you want to use EEPROM mac, due to
the previous invalid MAC address, it reads from the EEPROM if there is no ENV MAC from U-
Boot. If no MAC address is configured in the EEPROM, the U-Bootgenerates a random MAC
address if mac address is not defined from the U-Boot environment.

The order in which the U-Boot picks the MAC address is as follows. Refer to the U-Boot
documentation for commands to program EEPROM and to configure for the same.

• The MAC address from the U-Boot environment has the highest priority.
• The MAC address from the device tree has the next highest priority. Anything configured in
the petalinux-config → Subsystem → Auto Hardware Settings → Ethernet Settings → MAC
address goes to the device tree.
• If there is no MAC address in the device tree or invalid mac address(ff:ff:ff:ff:ff:ff), it checks in
EEPROM.
• If there is no MAC address in the EEPROM, it generates a random MAC address.
• Set whether to use DHCP or static IP on the primary Ethernet.

If manual is selected as the primary Ethernet, you are responsible for ensuring proper Ethernet
settings for the system.

Netmask address changes for sysvinit and systemd

• Set the static IP from petalinux-config → Subsystem Auto Hardware Settings → Ethernet
Settings. By default , obtain IP address is enabled. Disable it to set the static IP address. By
default Static IP netmask address in 255.255.255.0, Edit/Specify netmask address accordingly.
• In case of sysvinit /etc/network/interfaces file is invoked, it generates with netmask address in
dot-decimal notation for example, 255.255.255.0, dot-decimal notation format is supported.
address 192.168.0.10
netmask 255.255.255.0

• In case of systemd wired.network file is invoked, it is generated with netmask address in CIDR
notation for example, 24 CIDR notation format is supported.
Address=192.168.0.10/24

Ethernet submask changes when static IP generation is enabled

Set the static IP from $ petalinux-config → Subsystem Auto Hardware Settings → Ethernet
Settings.

Specify the netmask address accordingly.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 130
Chapter 10: Advanced Configurations

Figure 9: Obtain IP Address

In the case of sysvinit, /etc/network/interfaces file is invoked, and 255.255.255.0 netmask


address is supported.

Figure 10: Static IP netmask

In the case of systemd, specify the address (255.255.255.0)and calculate the bits. Pass netmask
as bits (24) to the wired network.

System Architecture Menu

Menu configuration option to the know system architecture petalinux-config -> System
Architecture based on the design is created. The system architecture menu is for user
information.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 131
Chapter 10: Advanced Configurations

Figure 11: System Architecture Menu

Figure 12: System Architecture

Flash Settings

The Flash Settings submenu allows you to:

• Select a primary flash for the system


• Set the flash partition table

If manual is selected as the primary flash, you are responsible for the flash settings for the
system.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 132
Chapter 10: Advanced Configurations

Table 29: Flash Partition Table

Default
Bootable Image/U-Boot
Partition Description
Environment Partition
Name
Boot Image boot BOOT.BIN for Zynq 7000 devices, Zynq UltraScale+ MPSoC, and
Versal adaptive SoC.
Relocatable U-Boot BIN file (u-boot-s.bin) for MicroBlaze
processors.
U-Boot Environment Partition bootenv U-Boot environment variable partition. When primary sd is
selected, U-Boot environment is stored in the first partition. When
primary flash is selected, U-Boot environment is stored in the
partition mentioned in flash partition name option.
Kernel Image kernel Kernel image image.ub (FIT format)

DTB Image dtb If Advanced bootable images storage Settings is disabled and a
DTB partition is found in the flash partition table settings,
PetaLinux configures U-Boot to load the DTB from the partition
table. Else, it assumes a DTB is contained in the kernel image.

SD/SDIO Settings

The SD/SDIO Settings submenu is for Zynq 7000 devices and Zynq UltraScale+ MPSoC only. It
allows you to select which SD controller is the system’s primary SD card interface.

If manual is selected as the primary flash, you are responsible for the flash settings for the
system.

Timer Settings

The Timer Settings submenu is for MicroBlaze processors and Zynq UltraScale+ MPSoC. It allows
you to select which timer is the primary timer.

IMPORTANT! A primary timer is required for a MicroBlaze system.

Reset GPIO Settings

The Reset GPIO Settings submenu is for MicroBlaze processors only. It allows you to select
which GPIO is the system reset GPIO.

TIP: MicroBlaze systems use GPIO as a reset input. If a reset GPIO is selected, you can reboot the system
from Linux.

RTC Settings

Select an RTC instance that is used as a primary timer for the Linux kernel. If your preferred RTC
is not on the list, select manual to enable the proper kernel driver for your RTC.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 133
Chapter 10: Advanced Configurations

DTG Settings
Figure 13: DTG Settings

Machine Name

For custom boards, do not change the configuration. For AMD evaluation boards, see Table
8: BSP and Machine Names.

Extra dts/dtsi file

Provide the extra device tree files path is separated with space. This config should be set with
dts/dtsi absolute/full path. Provided dts/dtsi is build as part of the device-tree and deployed into
<PROOT>/images/linux/dtbos.

Note: All dtsi files which are included in the dts file should be added to this config. For example, the
zynqmp-test.dts file includes the custom.dtsi and main.dtsi files and you must add all three of
them separated by spaces to this config.

{PROOT}/project-spec/dts_dir/zynqmp-test.dts
{PROOT}/project-spec/dts_dir/custom.dtsi
{PROOT}/project-spec/dts_dir/main.dtsi

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 134
Chapter 10: Advanced Configurations

Kernel Bootargs

The Kernel Bootargs submenu allows you to let PetaLinux automatically generate the kernel boot
command-line settings in DTS, or pass PetaLinux user defined kernel boot command-line settings.
The following are the default bootargs.

Microblaze -- console=ttyS0,115200 earlyprintk

zynq -- console=ttyPS0,115200 earlyprintk


zynqmp -- console=ttyPS0,115200 earlycon clk_ignore_unused
root=/dev/ram0 rw
versal -- console=ttyAMA0earlycon=pl011,mmio32,0xFF000000,115200n8
clk_ignore_unused

Note: If you want to see kernel panic prints on the console for Zynq UltraScale+ MPSoCs and Versal
devices, add earlycon console=<device>,<baud rate> clk_ignore_unused
root=/dev/ram rw. For example, earlycon console=/dev/ttyPS0,115200
clk_ignore_unused root=/dev/ram rw add it to system_user.dtsi.

For more information, see kernel documentation.

Device Tree Overlay Configuration for Zynq 7000 Devices, and


Zynq UltraScale+ MPSoCs

If you want to load PL after Linux boot, select this option to separate PL from base DTB and build
the pl.dtsi to generate pl.dtbo. After creating a PetaLinux project follow the steps to add
overlay support:

1. Go to cd <proj root directory>.


2. In the petalinux-config command, select DTG Settings → Device tree overlay.
3. Run petalinux-build to generate the pl.dtbo in images/linux directory.
FPGA manager overrides all options of the device tree overlay. Device Tree Overlay comes
into play only when the FPGA manager is not selected.

Converting Bitstream from .bit to .bin

1. Create a bif file with the following content:


all:
{
[destination_device = pl] <bitstream in .bit> ( Ex: system.bit )
}

2. Run following command:


bootgen -image bitstream.bif -arch zynqmp -process_bitstream bin

Note: The bit/bin file name should be same as the firmware name specified in pl.dtsi
(design_1_wrapper.bit.bin).

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 135
Chapter 10: Advanced Configurations

3. Once the target is up, load the dtbo and bit.bin file.
fpgautil -b design_1_wrapper.bit.bin -o pl.dtbo

Removing PL from the Device Tree

Select this configuration option to skip PL nodes if the user does not depend on the PL IPs. Also,
if any PL IP in DTG generates an error, you can simply enable this flag to ensure that the DTG
does not generate any PL nodes.

1. Go to cd <proj root directory>.


2. In the petalinux-config command, select DTG Settings → Remove PL from device tree.
3. Run petalinux-build.

Note: FPGA manager overrides all the Remove PL options. Remove PL option comes into play only when
the FPGA manager is not selected.

Note: If you select both the device tree overlay and remove the PL from the device tree, the base DTB adds
an entry for overlay support but there is no pl.dtbo generated.

Enable openamp dtsi

Earlier, openamp.dtsi file was in <proj>/project-spec/meta-user/device-tree/


files/openamp.dtsi and it was included in system-user.dtsi as a part of the
system.dtb.

Figure 14: Enable openamp dtsi

The dtsi files are moved to Yocto layers petalinux-config → DTG Settings → Enable Openamp
Dtsi configuration, it can be added to system.dtb or built as an overlay by applying openamp dtsi
nodes as an overlay.

Build openamp dtb in PetaLinux

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 136
Chapter 10: Advanced Configurations

There are two ways to build openamp dtb:

• Building openamp dtb within system.dtb: Enable the petalinux-config → DTG Settings ->
Enable openamp dtsi configuration and add the openamp packages from petalinux-
config -c rootfs with in system.dtb

Select the following packages and save:

• openamp-fw-echo-testd
• openamp-fw-mat-muld
• openamp-fw-rpc-demo
• packagegroup-petalinux-openamp

Note: The previous configuration is enabled for all in Zynq, Zynq UltraScale+ MPSoC, and Versal
prebuilt images.

• Applying openamp dtsi nodes as an overlay:

Disable the petalinux-config -> DTG Settings -> Enable Openamp dtsi configuration and
enable the openamp package group through petalinux-config -c rootfs. It builds the
openamp.dtbo as part of rootfs and it is available in /boot/devicetree.

Bootscript(boot.scr) auto-loads the openamp.dtbo if it is available in /boot/devicetree.

Enable xen hardware dtsi

Select Enable xen hardware dtsi configuration in petalinux-config → DTG Settings to


build the xen hardware dtsi changes as part of system.dtb.

Figure 15: Enable xen hardware dtsi

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 137
Chapter 10: Advanced Configurations

Enable the Enable xen hardware dtsi configuration to make xen changes part of
system.dtb.

Earlier, the xen hardware dtsi files were in <plnx-proj>/project-spec/meta-user/


recipes-bsp/device-tree/files/xen.dtsi. You have to include these files in system-
user.dtsi and build it as a part of system.dtb.

The xen.dtsi file is moved into the meta-petalinux layer, and by enabling the Enable xen
hardware dtsi configuration in petalinux-config, the xen changes are included as part of
system.dtb.

Enable xen qemu dtsi

Figure 16: Enable xen qemu dtsi

Enable xen qemu dtsi configuration option in petalinux-config builds the xen qemu dtsi
changes as part of system.dtb.

Enable the Enable xen qemu dtsi configuration to include the xen qemu changes as a part
of system.dtb.

Earlier, the xen qemu dtsi files were in <plnx-proj>/project-spec/meta-user/


recipes-bsp/device-tree/files/xen-hw.dtsi. You have to include these in system-
user.dtsi and build as a part of system.dtb.

The xen-qemu.dtsi file is moved into meta-petalinux layer and by enabling the Enable xen
qemu dtsi configuration, it is included as a part of system.dtb.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 138
Chapter 10: Advanced Configurations

Devicetree overlay

Figure 17: Devicetree overlay

If you want to build pl nodes dtbo files separately, enable the Devicetree overlay
configuration to build separate pl.dtbo as an overlay or any other dtsi selected, such as openamp.

Extra bootargs

Figure 18: Extra bootargs

Run petalinux-config → DTG settings → Add extra bootargs

1. Enter the bootargs which you want to add. For example, ext4=/dev/mmcblk0p3:/
rootfs
2. Save and exit
3. Execute the command petalinux-build
4. Verify by viewing this file in <plnx-proj-root>/components/plnx_workspace/
device-tree/device-tree/system-conf.dtsi

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 139
Chapter 10: Advanced Configurations

Device-tree Workspace

Figure 19: Device-tree workspace

Select the device tree workspace using the Device-tree workspace configuration and dtg
generates the dtsi files in the configured path.

Enable DTG logs

Figure 20: Enable DTG logs

If you want to enable the debug logs in the device tree generator, enable the Enable dt
verbose configuration.

Note: By default, Enable dt verbose is disabled in the tool.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 140
Chapter 10: Advanced Configurations

Disable alias generated by DTG

Figure 21: Disable aliases generated by DTG

By default, DTG generates aliases in system-top.dts file. You can enable or disable these by
using Disable alias generated by DTG configuration. By enabling the Disable alias
generated by DTG configuration, the final generated system.dtb contains the aliases from
DT board file if you specified any.

Enable aliases generated by DTG only

In default, the system.dtb contains the aliases from the DTG board file and the system-
top.dts file. Enabling Enable aliases generated by DTG only configuration, the
system.dtb has the aliases generated by the DTG(system-top.dts) only.

Note: This config does not have any impact if Disable alias generated by DTG is enabled.

Table 30: Disable alias generated by DTG vs Enable aliases generated by DTG only

Disable alias generated Enable aliases generated by DTG


Final system.dtb
by DTG only
Disable Disable Contains aliases from both DTG board and
system-top.dts
Enable Disable Contains DTG board aliases
Disable Enable Contains system-top.dts aliases
Enable Enable Contains DTG board aliases.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 141
Chapter 10: Advanced Configurations

Enable eeprom alias

Figure 22: Enable eeprom alias

By Default, the tool enables the eeprom to address the user-selected eprom for Zynq UltraScale+
MPSoC only.

For other platforms, you can enable using the Enable eeprom alias configuration option.

Enable rtc alias

Figure 23: Enable rtc alias

By Default, rtc is enabled to address the user-selected rtc for Zynq UltraScale+ MPSoC only.

For other platforms, you can enable using the Enable rtc alias configuration.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 142
Chapter 10: Advanced Configurations

Add extra bootargs menu

Figure 24: Add extra bootargs menu

If you want to append any extra boot param other than the default example like setting cma, use
the Add extra bootargs menu configuration. this gets appended to the existing boot args.

PMU Firmware Configuration for Zynq UltraScale+


MPSoC
You can provide compiler flags for the PMU firmware application. For example: -
DENABLE_IPI_CRC to enable CRC check on IPI messages.

Figure 25: PMU Firmware Configuration

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 143
Chapter 10: Advanced Configurations

Added Extra Compiler Flags

You are provided with extra pmufw compiler flag configuration in petalinux-config.

Figure 26: Extra Compiler Flag inPMU Firmware Configuration

PMUFW BSP extra compiler flags option can specify multiple BSP flags separated with space.
For example: DXSK_ACCESS_USER_EFUSE for enabling USER EFUSE access.

FSBL Configuration for Zynq UltraScale+ MPSoC


• FSBL BSP extra compiler flags: You can put multiple settings there, separated with space. For
example: -DENABLE_IPI_CRC for enabling CRC check on IPI messages.

• FSBL compilation Settings: You can put multiple settings there, separated with space. For
example: -DFSBL_PROT_BYPASS.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 144
Chapter 10: Advanced Configurations

Figure 27: FSBL Configuration

Trusted Firmware-A Configuration for Zynq


UltraScale+ MPSoC and Versal Adaptive SoC
The Trusted Firmware-A (TF-A) Compilation configuration submenu allows you to set:

• Extra TF-A compilation settings


• Change the base address of bl31 binary
• Change the size of bl31 binary
• Enable debug in TF-A

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 145
Chapter 10: Advanced Configurations

Figure 28: Trusted Firmware-A Configuration

If you provide an offset for BL33_BASE address for Trusted-firmware arm through the following
config petalinux-config → Trusted Firmware ARM (TF-A) Configuration → PRELOADED BL33
BASE.

Note: The same configuration changes should be taken care for U-Boot text base address petalinux-config
→ Subsystem Auto Hardware Settings → Memory Settings→ select Primary Memory → u-boot text base
address.

FPGA Manager Configuration and Usage for Zynq


7000 Devices and Zynq UltraScale+ MPSoC
The FPGA manager provides an interface to Linux for configuring the programmable logic (PL). It
packs the dtbos and bitstreams/pdi files into the /lib/firmware/xilinx directory in the root
file system.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 146
Chapter 10: Advanced Configurations

After creating a PetaLinux project, follow these steps to build the FPGA manager support:

1. Go to cd <plnx-proj-root>.
2. In the petalinux-config command, select FPGA Manager → [*] Fpga Manager.
Note: The PetaLinux FPGA manager configuration performs the following:

1. Generates the pl.dtsi nodes as a dt overlay (dtbo).

2. Packs the dtbos and bitstreams in the .bin format or pdi into the /lib/firmware/xilinx/
base directory in the root file system.

3. You can use the petalinux-create command to add the PL xsa files into the PetaLinux
project. The following command creates the fpgamanager_dtg app with the xsa file to
generate the dtsi and bit files.

petalinux-create apps --template fpgamanager_dtg -n can-interface --


srcuri <path-to-xsa>/system.xsa --enable
INFO: Create apps: can-interface
INFO: Copying source urls into the project directory
INFO: New apps successfully created in <plnx-proj-root>/project-spec/
meta-user/recipes-apps/can-interface
INFO: Enabling created component...
INFO: Sourcing build environment
INFO: Silentconfig rootfs
INFO: can-interface has been enabled

Note: For each XSA, create a separate app using the previous command. FPGA manager should be
enabled in petalinux-config for both fpgamanager and fpgamanager_dtg template apps.

4. Run petalinux-build.

Example loading full bitstream on target:

root@xilinx-zcu102:~# fpgautil -o /lib/firmware/xilinx/base/pl.dtbo -b


/lib/firmware/xilinx/base/design_1_wrapper.bit.bin

Time taken to load DTBO is 239.000000 milli seconds. DTBO loaded through
ZynqMP FPGA manager successfully.

Loading a full bitstream through sysfs – loading bitstream only:

root@xilinx-zcu102-2024_1:~# fpgautil -b /mnt/design_1_wrapper.bit.bin

Time taken to load BIN is 213.000000 milli seconds. BIN FILE loaded through
zynqMP FPGA manager successfully.

See help section for more option: root@xilinx-zcu102-2024_1:~# fpgautil -h. For
more information, see https://www.wiki.xilinx.com/Solution+ZynqMP+PL+Programming.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 147
Chapter 10: Advanced Configurations

Figure 29: FPGA Manager

U-Boot Configuration
Figure 30: U-Boot Configuration

By default, PetaLinux uses the board configuration "AUTO". If you want configurations from
design, select PetaLinux u-boot config.

Building a Separate U-Boot DTB


As shown in the following figure, if you enable the u-boot dtb configuration, you can build
separate U-Boot DTB with the provided design and you can find the binary in <plnx-proj-
root>/images/linux with the name u-boot.dtb. You can change the name with the
uboot dtb package name option. If you have a dts file to build a separate U-Boot DTB, you
can use the uboot dts file path to provide the dts/dtsi files with space separation.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 148
Chapter 10: Advanced Configurations

Figure 31: Separate U-Boot DTB

Image Packaging Configuration


The Image Packaging Configuration submenu allows you to set the following image packaging
configurations:

• Adding required root file system types.


• File name of the generated bootable kernel image.
• Linux kernel image hash function.
• DTB padding size.
• Whether to copy the bootable images to host TFTP server directory.

TIP: The petalinux-build tool always generates a FIT image as the kernel image.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 149
Chapter 10: Advanced Configurations

Figure 32: Image Packaging Configuration

Note: You can add extra spaces in the root file system by adding value to this variable <project>/
project-spec/meta-user/conf/petalinuxbsp.conf IMAGE_ROOTFS_EXTRA_SPACE.

Meta-user Layer Changes

The u-boot-zynq-scr.bbappend and bootcmd files are removed from the meta-user layer
and moved to Yocto eSDKs at <plnx-proj-root>/components/yocto/layers/meta-
xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-zynq-scr. You can find
these files on running the petalinux-config/petalinux-build command.

serial-autologin-root

serial-autologin-root option in PetaLinux tool is disabled by default. You can enable this with
petalinux-config -c rootfs -→ Image Features -→ [ ] serial-
autologin-root.

Linux Components Selection

Added Image selector menu configuration option. It is disabled by default.

Option to Change RAM-based Filesystem

There is a menu configuration option to build the initial RAM-based root file system as
highlighted in the following figure.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 150
Chapter 10: Advanced Configurations

Figure 33: RAM-based Root File System

You can provide the name of the Yocto image recipe that is used to build an initial RAM
filesystem in the menu configuration option, INITRAMFS/INITRD Image name. By default, it is
set to petalinux-image-minimal for Zynq 7000 devices and MicroBlaze processors and to
petalinux-initramfs-image for Zynq UltraScale+ MPSoCs and Versal adaptive SoCs. The
petalinux-initramfs-image is a small file system which is deployed into images/linux
as ramdisk.cpio.gz.u-boot. It is also packed into Fit image as image.ub. This allows the
specified image to be bundled inside the kernel image. An INITRAMFS/INITRD image provides a
temporary root file system used for early system initialization, for example, when loading
modules that are needed to locate and mount the "real" root filesystem.

After configuration, you can find the following bootargs changes in <plnx-proj-root>/
configs/config:

init_fatal_sh=1:
Launch the initramfs prompt if the specified device not available.

You can see the two root file systems in <plnx-proj-root>/images/linux:

ramdisk.cpio, ramdisk.cpio.gz.u-boot etc..


rootfs.cpio, rootfs.cpio.gz.u-boot etc..

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 151
Chapter 10: Advanced Configurations

Using the petalinux-initramfs-image as the INITRD/INITRAMFS image, boot up the


system with tiny rootfs, search for the ext2, ext3, and ext4 SD partitions, and check for the /
dev,/etc and /sbin/init file/ folder in it to validate whether the rootfs is valid and can be
used as a real file system using the command switch_root. If you want to specify the SD
device which has the ext rootfs, add ext4=/dev/mmcblk0p2:/rootfs in system bootargs as
follows:

petalinux-config ---> DTG Settings ---> Kernel Bootargs ---> [ ] generate


boot args automatically

petalinux-config ---> DTG Settings ---> Kernel Bootargs ---> (earlycon


console=ttyPS0,115200 clk_ignore_unused init_fatal_sh=1 ext4=/dev/
mmcblk0p2:/rootfs) user set kernel bootargs

Disabling switch_root

If you do not want to use the switch_root command which is the default command to mount
and use the ext rootfs in Zynq UltraScale+ MPSoC and Versal devices, you can disable it in build
time using the following command:

petalinux-config ---> Image Packaging Configuration --->

Update the name petalinux-initramfs-image to petalinux-image-minimal in


INITRAMFS/INITRD image name and run the petalinux-build command.

Note: If you have previously built using the petalinux-initramfs-image command, you continue to
see the ramdisk.* images in the images/linux folder. To avoid confusion, check the time stamp.

Note: If you enable Xen when switch_root is enabled, you see build failures because Xen only supports
the ramfs boot. Enabling switch_root enables the ext4-based boot. To resolve the issue, change the
previous configuration to petalinux-image-minimal from petalinux-initramfs-image.

Firmware Version Configuration


The Firmware Version Configuration submenu allows you to set the firmware version
information:

Table 31: Firmware Version Options

Firmware Version Option File in the Target RootFS


Host name /etc/hostname

Product name /etc/petalinux/product

Firmware Version /etc/petalinux/version

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 152
Chapter 10: Advanced Configurations

Figure 34: Firmware Version Configuration

TIP: The host name does not get updated. Refer to answer 69122 for more details.

Yocto Settings
Yocto settings allows you to configure various Yocto features available in a project.

Figure 35: Yocto Settings

Table 32: Yocto Settings

Parameter Description
TMPDIR Location This directory is used by BitBake to store logs and build artifacts

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 153
Chapter 10: Advanced Configurations

Table 32: Yocto Settings (cont'd)

Parameter Description
Yocto Machine Name Specifies the Yocto machine name for the project. By default PetaLinux uses
generic machine names for each platform. For details, see Machine Support
Yocto Include Machine Name You can specify your own Yocto conf file to include into AUTO generated
YOCTO_MACHINE_NAME conf file. By default, it includes generic machine
conf files.
Yocto Additional Overrides You can specify your own Yocto machine overrides to include into AUTO
generate YOCTO_MACHINE_NAME conf file. This helps to customize the
recipes or apps specific to machine overrides.
PetaLinux Deploy Directory Configure the path to deploy the generated images. Default is <plnx-proj-
root>/images/linux
Parallel thread execution To limit the number of threads of BitBake instances
Add pre-mirror url Adds mirror sites for downloading source code of components
Local sstate feeds settings To use local sstate cache at a specific location
Enable Network sstate feeds Enabled NW sstate feeds
User layers Adds user layers into projects
BB_NO_NETWORK When enabled, internet access is disabled on the build machine

Wolfssl config

Wolf ssl is a lightweight version of SSL.

Note: You should disable openssl to work with wolfssl.

Select the menu configuration in petalinux-config -c rootfs

petalinux-config -c rootfs → File System Packages → libs → network → wolfssl

Figure 36: Wolfssl

You can enable armv8 crypto assembly instructions also using the menu configuration.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 154
Chapter 10: Advanced Configurations

Figure 37: Crypto

Note: The Wolfssl configuration is supported only for the aarch64 family. Enabling this rebuilds all the
components.

Open Source Bootgen for On-target Use for


Zynq Devices, Versal Adaptive SoC, and Zynq
UltraScale+ MPSoC
If you want to build an open source Bootgen as part of the root file system, follow these steps.

1. Go to the PetaLinux project: cd <plnx-proj-root>


2. Run petalinux-config -c rootfs and select Filesystem Packages → Bootgen
3. Run petalinux-build
Once the target is up, you can find the Bootgen binary in /usr/bin

Configuring Out-of-tree Build


PetaLinux has the ability to automatically download up-to-date kernel/U-Boot source code from
a git repository. This section describes how this features works and how it can be used in system-
level menu config. It describes two ways of doing the out-of-tree builds.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 155
Chapter 10: Advanced Configurations

Prerequisites
This section assumes that the following prerequisites are satisfied:

• You have PetaLinux Tools software platform ready for building a Linux system customized to
your hardware platform. For more information, see Importing Hardware Configuration.
• Internet connection with git access is available.

Configuring Out-of-tree Build


Use the following steps to configure UBOOT/Kernel out-of-tree build.

1. Change into the root directory of your PetaLinux project.


cd <plnx-proj-root>

2. Launch the top level system configuration menu.


petalinux-config

3. Select Linux Components Selection submenu.


• For kernel, select linux-kernel () → remote.
( ) linux-xlnx
(X) remote
( ) ext-local-src
• For U-Boot, select u-boot () → remote.
( ) u-boot-xlnx
(X) remote
( ) ext-local-src
4. For kernel, select Remote linux-kernel settings → Remote linux-kernel git URL, and enter git
URL for Linux kernel.
For example, to use https://github.com/Xilinx/linux-xlnx, enter:
git://github.com/Xilinx/linux-xlnx.git;protocol=https

For U-Boot, select Remote U-Boot settings → Remote u-boot git URL and enter git URL for
U-Boot. For example:
git://github.com/Xilinx/u-boot-xlnx.git;protocol=https

Once a remote git link is provided, you must provide any of the following values for "git TAG/
Commit ID" selection, otherwise an error message is expected.
Set any of the following values to this setting, otherwise an error message appears.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 156
Chapter 10: Advanced Configurations

• To point to HEAD of repository of the currently checked out branch:


${AUTOREV}

• To point to any tag:


tag/mytag

• To point to any commit id:


commit id sha key

Once you select git Tag/Commit ID, you can see a prompt to enter a string value as shown
in the following figure. Enter any of the previous set values.

5. To specify BRANCH to kernel/u-boot/arm-trusted-firmware/plm/psm-


firmware, select Remote settings (Optional).
For example, to specify the master branch, type master as shown in the following figure:

6. To specify LICENSE checksum to kernel/u-boot/arm-trusted-firmware/plm/psm-


firmware, select Remote settings (Optional).
For example, to specify file://
license.rst;md5=e927e02bca647e14efd87e9e914b2443, enter the string value as
shown in the following figure:

7. Exit the menu, and save your settings.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 157
Chapter 10: Advanced Configurations

Using External Kernel and U-Boot with PetaLinux


PetaLinux includes kernel source and U-Boot source. However, you can build your own kernel
and U-Boot with PetaLinux.

PetaLinux supports local sources for kernel, U-Boot, TF-A, PLM, and PSM-FIRMWARE.

For external sources create a directory <plnx-proj-root>/components/ext_sources/.

1. Copy the kernel source directory:


<plnx-proj-root>/components/ext_sources/<MY-KERNEL>

2. Copy the U-Boot source directory:


<plnx-proj-root>/components/ext_sources/<MY-U-BOOT>

3. Run petalinux-config, and go into Linux Components Selection submenu


• For kernel, select linux-kernel () ---> and select ext-local-src.
( ) linux-xlnx
( ) remote
(X) ext-local-src
• For U-Boot, select u-boot () ---> and select ext-local-src.
( ) u-boot-xlnx
( ) remote
(X) ext-local-src
4. Add external source path.
• For trusted-firmware-arm, select trusted-firmware-arm() -> ext-local-src ()trusted-
firmware-arm()remote(x)ext-local-src
• For PLM, select plm()-> ext-local-src()plm()remote(*)ext-local-src
• For PSM-FIRMWARE, select psm-firmware()-> ext-local-src()psm-firmware()remote(*)ext-
local-src
• For kernel, select External linux-kernel local source settings --->. Enter the path:
${PROOT}/components/ext_sources/<MY-KERNEL>
• For U-Boot, select External u-boot local source settings --->. Enter the path:
${PROOT}/components/ext_sources/<MY-U-BOOT>
${PROOT} is a PetaLinux variable pointing to <plnx-proj-root>/ directory. You can
also specify an absolute path of the source. The sources can be placed outside the project
as well.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 158
Chapter 10: Advanced Configurations

Note: If after setting ext-local-src, you try to change it to linux-xlnx/u-boot-xlnx in


petalinux-config, it gives the following warning.

WARNING: Workspace already setup to use from <ext-local-src path>,


Use 'petalinux-devtool reset linux-xlnx' To remove this (or) Use this
for your development.

Note: When creating a BSP with external sources in project, it is your responsibility to copy the sources
into the project and do the packing. For more information, see BSP Packaging.

IMPORTANT! It is not mandatory to have external sources under components/ . You can specify any
location outside the project as well. However, while packaging the BSP, you are responsible for copying the
external sources into components/ and setting relative path.

Note: If the external source is a git repository, its checked out state must be appropriate for the project
that is being built.

Troubleshooting
This section describes some common issues you can experience while configuring out-of-tree
build.

Table 33: Configuring Out-of-Tree Build Troubleshooting

Problem / Error Message Description


fatal: The remote end hung up unexpectedly Problem Description:
ERROR: Failed to get linux-kernel This error message indicates that system is unable to
download the source code (Kernel/UBOOT) using remote
git URL and hence can not proceed with petalinux-build.
Solution:
Check whether entered remote git URL is proper or not.
If the previous solution does not solve the problem, cleanup
the build with the following command:
petalinux-build -x mrproper
Above command removes following directories.
<plnx-proj-root>/images/
<plnx-proj-root>/build/
Re-build the system image. For more information, see the
Building a System Image.

Configuring Project Components


If you want to perform advanced PetaLinux project configuration such as enabling Linux kernel
options or modifying flash partitions, use the petalinux-config tool with the appropriate -c
COMPONENT option.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 159
Chapter 10: Advanced Configurations

IMPORTANT! Only AMD drivers or optimizations in the Linux kernel configuration are supported by AMD
technical support. For more information on AMD drivers for Linux, see https://xilinx-wiki.atlassian.net/
wiki/spaces/A/pages/18841873/Linux+Drivers.

The following examples demonstrate how to use petalinux-config to review or modify your
PetaLinux project configuration:

1. Change into the root directory of your PetaLinux project


cd <plnx-proj-root>

2. Launch the top level system configuration menu and configure it to meet your requirements:
petalinux-config

3. Launch the Linux kernel configuration menu and configure it to meet your requirements:
petalinux-config -c kernel

4. Launch the root file system configuration menu and configure it to meet your requirements:
petalinux-config -c rootfs

5. Use --silentconfig for the components when you do not have Kconfig/Menuconfig
support or to skip the launching of configuration menu
petalinux-config -c <COMPONENT> --silentconfig

Warning Message for petalinux-config or petalinux-build Commands

The following warning message appears when you run the petalinux-config or
petalinux-build for components (for example, petalinux-build -c u-boot) and this
can be ignored.

WARNING: SRC_URI is conditionally overridden in this recipe, thus several


devtool-override-* branches have been created, one for each override that
makes changes to SRC_URI. It is recommended that you make changes to the
devtool branch first, then checkout and rebase each devtool-override-*
branch and update any unique patches there (duplicates on those branches
will be ignored by devtool finish/update-recipe).

TIP: Set U-Boot target in petalinux-config menuconfig as required, for your custom board. Set $
petalinux-config → U-Boot Configuration → u-boot config target as required. Default values for AMD
evaluation boards are as follows:

• For Zynq 7000 devices, xilinx_zynq_virt_defconfig


• For Zynq UltraScale+ MPSoC, xilinx_zynqmp_virt_defconfig
• For MicroBlaze processors, microblaze-generic_defconfig
• For Versal devices, xilinx_versal_virt_defconfig

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 160
Chapter 10: Advanced Configurations

Note: Make sure board and user specific dtsi entries are added to project-spec/meta-user/
recipes-bsp/device-tree/files/system-user.dtsi.

Using template flow, for zcu102 and zcu106 boards, add the following line to <plnx-proj-
root>/project-spec/meta-user/recipes-bsp/embeddedsw/fsbl-firmware_
%.bbappend for FSBL initializations.

YAML_COMPILER_FLAGS:append = " -DXPS_BOARD_ZCU102" #for zcu102


YAML_COMPILER_FLAGS:append = " -DXPS_BOARD_ZCU106" # for zcu106

Device Tree Configuration


This section describes which files are safe to modify for the device tree configuration and how to
add new information into the device tree.

Prerequisites
This section assumes that you have PetaLinux tools software platform ready for building a Linux
system customized to your hardware platform. For more information, see Importing Hardware
Configuration. Knowledge of DTS syntax is required to customize the default DTS.

Configuring Device Tree


User-modifiable PetaLinux device tree configuration is associated with following config files, that
are located at <plnx-proj-root>/project-spec/meta-user/recipes-bsp/device-
tree/files/:

• system-user.dtsi

The generated files are in the <plnx-proj-root>/components/plnx_workspace/


device-tree/device-tree/ directory.

CAUTION! These DTSI files are auto-generated. Do not edit these files

For more details on device tree files, see Appendix C: PetaLinux Project Structure.

To add information like the Ethernet PHY, include the information in the system-conf.dtsi
file. In this case, device tree should include the information relevant for your specific platform as
information (here, Ethernet PHY information) is board-level and board-specific.

The system-user.dtsi is automatically created when you configure your PetaLinux project.
Once created, the tools do not update it automatically.

Note: The need for this manual interaction is because some information is "board level," and the tools do
not have a way of predicting what should be here. Refer to the Linux kernel Device Tree bindings
documents (Documentation/devicetree/bindings from the root of the kernel source) for the
details of the bindings of each device.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 161
Chapter 10: Advanced Configurations

An example of a well-formed device tree node for the system-user.dtsi is as follows:

/dts-v1/;
/include/ "system-conf.dtsi"
/ {
};
&gem0 {
phy-handle = <&phy0>;
ps7_ethernet_0_mdio: mdio {
phy0: phy@7 {
compatible = "marvell,88e1116r";
device_type = "ethernet-phy";
reg = <7>;
};
};
};

IMPORTANT! Ensure that the device tree node name, MDIO address, and compatible strings correspond
to the naming conventions used in your specific system.

The following example demonstrates adding the sample-user-1.dtsi file:

1. Add /include/ "system-user-1.dtsi" in project-spec/meta-user/recipes-


bsp/device-tree/files/system-user.dtsi. The file should look like the following:
/include/ "system-conf.dtsi"
/include/ "system-user-1.dtsi"
/ {
};

2. Add file://system-user-1.dtsi to project-spec/meta-user/recipes-bsp/


device-tree/device-tree.bbappend. The file should look like this:
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"

SRC_URI += "file://system-user.dtsi"
SRC_URI += "file://system-user-1.dtsi"

RECOMMENDED: It is not recommended to change anything in <plnx-proj-root>/


components/plnx_workspace/device-tree/device-tree/.

RECOMMENDED: It is recommended to use system user DTSIs for adding, modifying, and deleting
nodes or values. System user DTSIs are added at the end, which makes the values in it a higher priority.

You can overwrite any existing value in other DTSIs by defining in system user DTSIs.

U-Boot Configuration
This section describes which files are safe to modify for the U-Boot configuration and discusses
about the U-Boot CONFIG_ options/settings.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 162
Chapter 10: Advanced Configurations

Prerequisites
This section assumes that you have PetaLinux tools software platform ready for building a Linux
system customized to your hardware platform. Refer to section Importing Hardware
Configuration for more information.

Configuring U-Boot
Universal boot loader (U-Boot) configuration is usually done using C pre-processor. It defines:

• Configuration _OPTIONS_: You can select the configuration options. They have names
beginning with CONFIG_.

• Configuration _SETTINGS_: These depend on the hardware and other factors. They have
names beginning with CONFIG_SYS_.

TIP: Detailed explanation on CONFIG_ options/settings documentation and README on U-Boot can be
found at Denx U-Boot Guide.

PetaLinux U-Boot configuration is associated with config.cfg configuration file located at


<plnx-proj-root>/project-spec/configs/u-boot-xlnx/ .

Note: config.cfg is generated only when petalinux-config → Auto Config Settings → u-boot autoconfig
is enabled.

PetaLinux does not automate U-Boot configuration with respect to CONFIG_ options/settings.
You can add these CONFIG_ options/settings into platform-top.h file.

IMPORTANT! If petalinux-config → Auto Config Settings → u-boot autoconfig is disabled, the


platform-top.h changes are not reflected directly. To resolve this, see Steps for Managing Image Size.

Steps to add CONFIG_ option (For example, CONFIG_CMD_MEMTEST) to platform-top.h:

• Change into the root directory of your PetaLinux project.


cd <plnx-proj-root>

• Open the file platform-top.h


vi project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h

• If you want to add CONFIG_CMD_MEMTEST option, add the following line to the file. Save
the changes.
#define CONFIG_CMD_MEMTEST

TIP: Defining CONFIG_CMD_MEMTEST enables the Monitor Command "mtest", which is used for
simple RAM test.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 163
Chapter 10: Advanced Configurations

• Build the U-Boot image.


petalinux-build -c u-boot

• Generate BOOT.BIN using the following command.


petalinux-package boot --fsbl <FSBL image> --fpga <FPGA bitstream> --u-
boot

• Boot the image either on hardware or QEMU and stop at U-Boot stage.
• Enter the mtest command in the U-Boot console as follows:
ZynqMP mtest

• Output on the U-Boot console should be similar to the following:


Testing 00000000 ... 00001000:
Pattern 00000000 Writing... Reading...Iteration:
20369

IMPORTANT! If CONFIG_CMD_MEMTEST is not defined, output on U-Boot console is as follows:

U-Boot-PetaLinux> mtest Unknown command ’mtest’ - try ’help’

For more information on U-Boot, see https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/


18842223/U-boot.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 164
Chapter 11: Yocto Features

Chapter 11

Yocto Features

SDK Generation (Target Sysroot Generation)


The OpenEmbedded build system uses BitBake to generate the Software Development Kit (SDK)
(SDK) installer script based standard SDKs. PetaLinux builds and installs SDK. The installed SDK
can be used as sysroot for the application development.

Building SDK
The following command builds SDK and copies it at <proj_root>/images/linux/sdk.sh.

petalinux-build --sdk

The following is the equivalent BitBake command.

bitbake petalinux-image-minimal -c do_populate_sdk

Installing SDK
The generated SDK has to be installed/extracted to a directory. The following command extracts
the SDK to a specified directory. The default SDK is <proj_proot>/images/linux/sdk.sh
and default installation directory is <proj_proot>/images/linux/sdk/.

petalinux-package sysroot -s|--sdk <custom sdk path> -d|--dir <custom


directory path>

Examples
Few examples for building the SDK:

1. Adding a cross compiling qt toolchain


To build SDK with qt toolchain:
a. Create the <plnx-proj-root>/project-spec/meta-user/recipes-core/
images/petalinux-image-minimal.bbappend file.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 165
Chapter 11: Yocto Features

b. Add inherit populate_sdk_qt5 in the newly created file.


c. Run petalinux-config -c rootfs and select packagegroup-petalinux-qt.
d. Run petalinux-build -s.
e. Run petalinux-package sysroot.
To verify:
a. Open a new terminal.
b. Go to <plnx-proj-root>/image/linux/sdk.
c. Run source environment-setup-aarch64-xilinx-linux.
d. Run which qmake. This confirms that the qmake is coming from the SDK.
2. Building OpenCV applications
a. Create a PetaLinux project.
b. Add packagegroup-petalinux-opencv in the RootFS menu config.
c. Build SDK.
petalinux-build --sdk

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


sdk.sh.
d. Install SDK.
petalinux-package sysroot

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


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

Building an eSDK
The following command builds the eSDK and copies it at <proj_root>/images/linux/
esdk.sh.

petalinux-build --esdk

Packaging Sources and Licenses


• To pack all the components of petalinux-build, issue the following commands.
petalinux-build --archiver

• To pack only the sysroot components, use the following command.


petalinux-build --sdk --archiver

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 166
Chapter 11: Yocto Features

Note: You can find the archiver tar in <plnx-proj-root>/images/linux.

Accessing BitBake/Devtool in a Project


BitBake is available only in the bash shell.

Steps to Access the BitBake Utility


To access the BitBake utility:

1. Source the PetaLinux tools script:


source /opt/pkg/petalinux/settings.sh

2. Run petalinux-create command to create project


petalinux-create project -s <PATH_TO_PETALINUX_PROJECT_BSP>

3. Run petalinux-config or petalinux-config --silentconfig at least once after


creating the project to setup the required environment.
4. Run unset LD_LIBRARY_PATH by using below command
unset LD_LIBRARY_PATH

5. Source the Yocto e-SDK:


source <plnx-proj-root>/components/yocto/environment-setup-cortexa72-
cortexa53-xilinx-linux

6. Source the environment setup script to be redirected to the build directory:


source <plnx-proj-root>/components/yocto/layers/poky/oe-init-build-env

Stay in the build directory to run BitBake


7. Export PROOT:
Note: PROOT PATH should not end with "/" .

export PROOT="<path of your petalinux project directory>"

8. Parse the PetaLinux variable to recipes:


export BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS
PETALINUX PROOT"

9. To test if the BitBake is available, run:


bitbake strace

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 167
Chapter 11: Yocto Features

The generated images are placed in the deploy directory. You have to copy the generated
images into <plnx-proj-root>/images/linux directory to work with the other
commands

Steps to Access the Devtool Utility


To access the Devtool utility:

1. Follow steps 3-7 as described in Steps to Access the BitBake Utility


2. Create a workspace for devtool:
devtool create-workspace ../components/plnx_workspace/

3. Add the recipe to workspace directory:


devtool add --version 1.0 gpio-demo ../project-spec/meta-user/recipes-
apps/gpio-demo

4. Build the recipe:


devtool build gpio-demo

For more devtool commands, type devtool --help.

Shared State Cache


Yocto e-SDK contains minimal shared state (sstate) cache. AMD hosts the full petalinux-
image-minimal sstate cache at https://petalinux.xilinx.com/sswreleases/rel-v2024.

During petalinux-build, BitBake searches for the sstate cache in https://


petalinux.xilinx.com/sswreleases/rel-v2024. If it fails to find the sstate cache, BitBake builds it
from scratch. sstate is signature locked.

For a .bbappend file which you create for any root file system component, you must add
SIGGEN_UNLOCKED_RECIPES += "<recipe-name>" (for example, example,
SIGGEN_UNLOCKED_RECIPES += "u-boot-xlnx" in <plnx-proj-root>/project-
spec/meta_user/conf/petalinuxbsp.conf.

Sharing your State Cache


If you want to share/use your previously build sstate cache, you can follow either of the
following approaches.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 168
Chapter 11: Yocto Features

As an optimization, the Yocto Project optimizes downloads of the sstate cache items to only the
minimal items required for the current build. This must be factored in when sharing your sstate
cache with another user. The configuration of the second user can be different, causing a
different set of sstate cache items to be required. There are two approaches to optimizing your
downstream user and their usage of the sstate cache. The first approach is that the second user
should include both the sstate cache directory you provided and the original AMD sstate cache
directory in <plnx-proj-root>/build/conf/plnxtool.conf.

SSTATE_MIRRORS = " \
file://.* file://<your-sstate-cache>/PATH \n \
file://.* http://petalinux.xilinx.com/sswreleases/rel-v2022/aarch64/sstate-
cache/PATH;downloadfilename=PATH \n \"

The second approach is to fetch all of the sstate cache items that can be required for a particular
build. This is required if you want to share your build sstate with the downstream user. There is
an option called --setscene-only that fetches all of the sstate objects that might be needed
for a particular target recipe. For example, if you used petalinux-build (bitbake
petalinux-image-minimal), you should run the following command first to fetch all the
required sstate from AMD provided sstate.

petalinux-build -c "petalinux-image-minimal --setscene-only"(bitbake


petalinux-image-minimal --setsecene-only)

Downloading Mirrors
AMD hosts all source download tar files for each release at https://www.xilinx.com/support/
download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html. By default,
PetaLinux points to pre-mirrors using petalinux-config command.

If any component is rebuilt from scratch, BitBake, or devtool searches for its source in pre-mirrors
and downloads the mirror URL. Later, it searches in SRC_URI of recipes for downloading the
source of that component. If you configure any value through petalinux-config → yocto settings
→ premirrors, it first searches in the configured pre-mirrors, then petalinux.xilinx.com, and finally
in the SRC_URI in recipes.

You can add more mirrors by adding SOURCE_MIRROR_URL += file:///home/you/your-


download-dir/ in <plnx-proj-root>/project-spec/meta-user/conf/
petalinuxbsp.conf.

For more information on how to set SSTATE and DL_DIR, see How to Reduce Build Time using
SSTATE Cache.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 169
Chapter 11: Yocto Features

Machine Support
The Yocto machine specifies the target device for which the image is built. The variable
corresponds to a machine configuration file of the same name, which sets machine-specific
configurations. Currently, PetaLinux supports the user machine configuration file.

You can add your machine configuration file under <plnx-proj-root>/project-spec/


meta-user/conf/machine/ or add your machine configuration file in any additional layers
and add it to the project through petalinux-config.

→ () Yocto Include Machine name specifies the machine name included in the specified () Yocto
Machine Name. The default uses the generic config files based on the platform.

Follow these steps to specify the user machine configuration file name in the PetaLinux project:

1. Go to the PetaLinux project.


2. Select petalinux-config → Yocto Settings → () Yocto Machine Name.
3. Specify your machine configuration file name.
Based on the design, the machine configuration files are generated dynamically.
4. Optionally add/modify petalinux-config → Yocto Settings → () Yocto Include Machine name

Table 34: Default Machine Names in Template

Template Machine
zynq zynq-generic
zynqmp zynqmp-generic
microblaze microblazeel-generic
versal versal-generic

Table 35: Default Machine Names and Corresponding Include Machine in BSP

BSP name Machine Include Machine


xilinx-ac701-v$version-final.bsp xilinx-ac701 ac701-microblazeel
xilinx-kc705-v$version-08071442.bsp xilinx-kc705 kc705-microblazeel
xilinx-kcu105-v$version-final.bsp xilinx-kcu105 kcu105-microblazeel
xilinx-vcu118-v$version-final.bsp xilinx-vcu118 vcu118-microblazeel
xilinx-sp701-v$version-final.bsp xilinx-sp701 kcu105-tmr-microblazeel
xilinx-zc702-v$version-final.bsp xilinx-zc702 zc702-zynq7
xilinx-zc706-v$version-final.bsp xilinx-zc706 zc706-zynq7
xilinx-zcu102-v$version.bsp xilinx-zcu102 zcu102-zynqmp
xilinx-zcu104-v$version.bsp xilinx-zcu104 zcu104-zynqmp
xilinx-zcu106-v$version.bsp xilinx-zcu106 zcu106-zynqmp

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 170
Chapter 11: Yocto Features

Table 35: Default Machine Names and Corresponding Include Machine in BSP (cont'd)

BSP name Machine Include Machine


xilinx-zcu111-v$version.bsp xilinx-zcu111 zcu111-zynqmp
xilinx-zcu208-v$version.bsp xilinx-zcu208 zcu208-zynqmp
xilinx-zcu216-v$version.bsp xilinx-zcu216 zcu216-zynqmp
xilinx-zcu670-v$version.bsp xilinx-zcu670 zcu670-zynqmp
xilinx-k26-som-v$version.bsp xilinx-k26-som k26-sm
xilinx-vck190-SC-v$version-final.bsp xilinx-vck190-sc vck-sc-zynqmp
xilinx-vck190-v$version-final.bsp xilinx-vck190 vck190-versal
xilinx-vc-p-a2197-00-reva-x-prc-02-reva- xilinx-vc-p-a2197-00 vc-p-a2197-00-versal
v$vesion-final.bsp
xilinx-vck5000-v$version-final.bsp xilinx-vck5000 vck5000-versal
xilinx-vek280-v$version-final.bsp xilinx-vek280 vek280-versal
xilinx-vhk158-v$version-final.bsp xilinx-vhk158 vhk158-versal
xilinx-vmk180-v$version-final.bsp xilinx-vmk180 vmk180-versal
xilinx-vpk120-v$version-final.bsp xilinx-vpk120 vpk120-versal
xilinx-vpk180-v$version-final.bsp xilinx-vpk180 vpk180-versal

Note: In the previous table, $version indicates PETALINUX_VERSION

Note: For TEMPLATE, if you specify any of the mentioned Machine names, the corresponding included
machine name is auto-updated. You can update it based on your needs.

SoC Variant Support


AMD delivers multiple devices for each SoC product. AMD Zynq™ UltraScale+™ MPSoC is
shipped in three device variants. For more information see here. Zynq 7000 devices are shipped
in two variants. For more information, see here.

SOC_VARIANT extends overrides with ${SOC_FAMILY}${SOC_VARIANT}. It further extends


overrides with components on the SoC (for example, Mali™, VCU). This makes reusing the
component overrides depending on the SoC. This feature is mainly used to switch to hardware
acceleration automatically if the hardware design has the corresponding IP (VCU or USP). AMD
distributes SoCs with multiple variants as follows:

1. Zynq 7000 devices are distributed as Zynq7000zs and Zynq7000z. The available
SOC_VARIANTs are:
• "7zs" - Zynq 7000 Single A9 Core
"7z" - Zynq 7000 Dual A9 Core
• Default SOC_VARIANT for Zynq 7000 devices is "7z". For 7000zs devices, add the
SOC_VARIANT = "7zs" in petalinuxbsp.conf

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 171
Chapter 11: Yocto Features

There are no additional overrides for Zynq 7000 devices.


2. Zynq UltraScale+ MPSoC is shipped in four device variants. The available SOC_VARIANTs
are:
• "cg" - Zynq UltraScale+ MPSoC CG Devices
• "eg" - Zynq UltraScale+ MPSoC EG Devices
• "ev" - Zynq UltraScale+ MPSoC EV Devices
• "dr" - Zynq UltraScale+ MPSoC RFSoC devices
The default value is "eg." PetaLinux automatically assigns "ev" and "dr" based on the presence
of IP in the XSA.
Note: You have to explicitly set SOC_VARIANT = "cg" in petalinuxbsp.conf for "CG" devices.

3. Versal adaptive SoC is shipped only in one design variant currently. The available
SOC_VARIANTs are:
• "prime" - Versal Prime devices
• "ai-core" - Versal ai-core devices
• "ai-edge" - Versal ai-edge devices
• "premium" - Versal premium devices
• "hbm" - Versal H50 hbm enabled devices

Image Features
The contents of images generated by the OpenEmbedded build system can be controlled by the
IMAGE_FEATURES and EXTRA_IMAGE_FEATURES variables that you typically configure in your
image recipes. Through these variables, you can add several different predefined packages such
as development utilities or packages with debug information needed to investigate application
problems or profile applications.

To remove any default feature, add the following code in the petalinuxbsp.conf:

IMAGE_FEATURES:remove = "ssh-server-dropbear"

To add any new feature, add the following command in the petalinuxbsp.conf:

IMAGE_FEATURES:append = " myfeature"

Note: Add extra spaces between the double quote and package name.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 172
Chapter 11: Yocto Features

Filtering RootFS Packages Based on License


The INCOMPATBLE_LICENSE flag is used to control which packages are included in the final
root file system configuration based on the license.

If you want to exclude packages based on license, you can edit the <plnx-proj-root>/
project-spec/conf/petalinuxbsp.conf file. For example, set INCOMPATBLE_LICENSE
= "GPLv3", run the petalinux-build command.

Creating and Adding Patches For Software


Components within a PetaLinux Project
To create and add patches for software components within a PetaLinux project, follow these
steps:

1. Get the source code from git URL specified in meta-layers:


petalinux-devtool modify <recipe-name>

For example:
petalinux-devtool modify linux-xlnx

The previous command fetches the sources for the recipe and unpack them to a <plnx-
proj-root>/components/yocto/workspace/sources/<recipe-name> directory
and initialize it as a git repository if it is not already one.
2. Make the changes you want to make to the source.
3. Run a build to test your changes. You can run petalinux-build -c <recipename> or
even build an entire image using petalinux-build incorporating the changes assuming a
package produced by the recipe is part of an image. There is no need to force anything, the
build system detects changes to the source and recompile as necessary.
4. Optional: Test your changes on the target.
5. Place your changes in the form of a patch to the PetaLinux project. To commit your changes,
use the following commands.
git add <filename>
git commit -s

6. petalinux-devtool finish <recipe-name> <destination layer path>


creates a patch for the committed changes in recipe sources directory.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 173
Chapter 11: Yocto Features

For example:
petalinux-devtool finish linux-xlnx <plnx-proj-dir>/project-spec/meta-
user

petalinux-devtool update-recipe linux-xlnx -a <destination layer


path> creates a patch for the committed changes in recipe sources directory without
removing the bbappend and source directory from the workspace directory.
For example:
petalinux-devtool update-recipe linux-xlnx -a <plnx-proj-dir>/project-
spec/meta-user

7. Once you have finished working on the recipe, run petalinux-devtool reset
<recipe-name> to remove the source directory for the recipe from workspace.

Known Issues for the Devtool Flow


When using ext-local-src for linux-xlnx and executing petalinux-devtool finish
linux-xlnx <layer path> after making menuconfig changes, the file bsp.cfg is deleted
from the <plnx-proj-dir>/project/-spec/meta-user/recipes-kernel/linux/
linux-xlnx directory. However, the <plnx-proj-dir>/project/-spec/meta-user/
recipes-kernel/linux/linux-xlnx_%.bbappend file still references this file in the
'KERNEL_FEATURES' variable. This causes an error when executing petalinux-build/
petalinux-build -c kernel. To overcome this issue, create an empty bsp.cfg file in the
<plnx-proj-dir>/project/-spec/meta-user/recipes-kernel/linux/linux-
xlnx directory before building the project/kernel.

Adding Extra Users to the PetaLinux System


You can make the changes using the following steps:

1. Go to project: petalinux-config -c rootfs → PetaLinux Rootfs Settings → Add extra users.


2. Provide the users. To add extra users to the PetaLinux system, provide the user ID (userid)
and password (passwd) separated by : for multiple users, separate sets of user IDs and
passwords using ;.
Examples:
To add a passwd1 for user1:
user1:passwd1; or user1:passwd1

To add an empty passwd for the user1:


user1:

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 174
Chapter 11: Yocto Features

To add user1 and user2 with passwd1 and passwd2, respectively:


user1:passwd1;user2:passwd2;

To add an empty passwd for user1 and passwd2 for user2


user1:;user2:passwd2

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 175
Chapter 12: Technical FAQs

Chapter 12

Technical FAQs

Troubleshooting
This section details the common errors that appear, while working with the PetaLinux commands,
and lists their recovery steps in detail.

For Yocto related information, see PetaLinux Yocto Tips.

versal-net support:
WARNING: versal-net: Versal-net is not supported in 2023.2

Note: We are not supporting versal-net builds in PetaLinux tool for this release.

TMPDIR on NFS
The error displayed is:

“ERROR: OE-core's config sanity checker detected a potential


misconfiguration”. Either fix the cause of this error or disable the
checker at your own risk (see sanity.conf). For the list of potential
problems or advisories.

The TMPDIR: /home/user/xilinx-kc705-axi-full-<petalinux-version>/


build/tmp cannot be located on NFS.

When TMPDIR is on NFS, BitBake throws an error at the time of parsing. You can change it to
local storage while creating the PetaLinux project. To do so, follow these steps:

1. Either run petalinux-create project -s <PATH_TO_PETALINUX_PROJECT_BSP>


--tmpdir <TMPDIR PATH> or petalinux-config.
2. Provide any local storage by selecting Yocto-settings → TMPDIR.

CAUTION! Do not configure the same TMPDIR for two different PetaLinux projects. This can cause build
errors.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 176
Chapter 12: Technical FAQs

Recipe Name has ' _ ' or Uppercase Letters or Starts


with an Uppercase Letter
If the application name is plnx_myapp, BitBake throws an error. A version number has to be
entered after ' _ '. For example, myapp_1 is an accurate application and module name.

To recover, sstateclean the application and delete it. Also, delete the following line in <plnx-
proj-root>/project-spec/meta-user/conf/user-rootfsconfig.

CONFIG_plnx_myapp

If the application or library or module name has all uppercase letters or starting with an
uppercase letter MYAPP/Myapp, BitBake throws a do_package_qa error.

To recover, sstateclean the application and delete it. Also, delete the line in <plnx-proj-
root>/project-spec/meta-user/conf/user-rootfsconfig.

CAUTION! If the project path has special characters like +, *, ! etc., the petalinux-config command
fails to execute. For example: /opt/petalinux+/xilinx-zc702-2. To recover, do not use any special characters
in the path.

Recover from Corrupted Terminal


When PetaLinux is exited forcefully by pressing Ctrl+C twice, the following error appears:

NOTE: Sending SIGTERM to remaining 1 tasks


Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File
"<plnx-proj-root>/components/yocto/layers/core/bitbake/lib/bb/ui/k
notty.py", line 313, in finish
self.termios.tcsetattr(fd, self.termios.TCSADRAIN, self.stdinbackup)
termios.error: (5, 'Input/output error')

After this error, the console is broken and you cannot see the text that you typed. To restore the
console, enter stty sane and press Ctrl+J twice.

Python Language Settings


The following errors appear when the language settings are missing:

• Could not find the /log/cooker/plnx_microblaze in the /tmp directory


during petalinux-config

• Please use a locale setting which supports UTF-8 (such as


LANG=en_US.UTF-8).

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 177
Chapter 12: Technical FAQs

Python cannot change the file system locale after loading. Therefore, you need a UTF-8 when
Python starts, else it does not work.
ERROR: Failed to build project

To resolve the previous errors, set the following:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

Menuconfig Hang for Kernel and U-Boot


For petalinux-config -c, sometimes when the kernel and U-Boot BitBake try to open a
new terminal inside, they fail. The following are the possible error messages:

• ERROR: Unable to spawn new terminal


• ERROR: Continuing the execution without opening the terminal

The solutions can be:

• Use ssh -X <hostname>.


• Uncomment the OE_TERMINAL line in <plnx-proj-root>/project-spec/meta-
user/conf/petalinuxbsp.conf. You can set any terminal which suits you (possibles
values could be auto, screen, tmux, xterm, and konsole). You have to change the
OE_TERMINAL as it cannot get through default. For this, you must have the corresponding
utility installed in your machine.

Menuconfig Not Seen for Kernel and U-Boot


Set SHELL=/bin/bash before issuing petalinux-config -c kernel/ petalinux-
config -c u-boot.

Menuconfig Corruption for Kernel and U-Boot


When you issue petalinux-config -c kernel/u-boot, you might see a corrupted menu
config. This is due to the terminal you are using.

To resolve, export other terminals like screen, xterm, konsole, putty, or gnome, and retry. For
example:

export TERM=screen

Note: You do not see this issue on Ubuntu 18.x host machines.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 178
Chapter 12: Technical FAQs

External Source Configurations


The cfg or scc files are not applied with external source in the Yocto flow (upstream behavior).
PetaLinux needs to handle external source with configurations applied. Therefore, it is always
recommended to use cfgs instead of sccs.

Xen and openamp are handled through distro features. Adding distro features does not enable
their corresponding configurations in kernel as they are handled in scc file. The solution is to edit
<plnx-proj-root>/project-spec/meta-user/recipes-kernel/linux/linux-
xlnx_%.bbappend.

Add the following lines:

SRC_URI += "file://xilinx-kmeta/bsp/xilinx/xen.cfg"

To work with the scc files, replace their respective cfg files using external source methodology.

do_image_cpio: Function Failed


CPIO format does not support sizes greater than 2 GB. Therefore, you cannot use INITRAMFS
for larger sizes. The following steps describes the process for larger image sizes (greater than 2
GB).

1. Change the root file system type to EXT4 (SD/eMMC/SATA/USB).


petalinux-config

Select Image Packaging Configuration → Root filesystem type → EXT4 (SD/eMMC/SATA/


USB).
2. Add the following lines in the <plnx-proj-root>/project-spec/meta-user/conf/
petalinuxbsp.conf.
IMAGE_FSTYPES:remove = "cpio cpio.gz cpio.bz2 cpio.xz cpio.lzma cpio.lz4
cpio.gz.u-boot"
IMAGE_FSTYPES_DEBUGFS:remove = "cpio cpio.gz cpio.bz2 cpio.xz cpio.lzma
cpio.lz4
cpio.gz.u-boot"

3. Build the project.


petalinux-build

Note: Unlike earlier, currently PetaLinux does not generate the global DTS file. Use the following
command to generate the global DTS file:

dtc -I dtb -O dts -o system.dts system.dtb

CAUTION! Do not use the symlinked path to the project directories for any build operations, including
simply "cd"ing into the directory.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 179
Chapter 12: Technical FAQs

Package Management
PetaLinux supports package management system for Zynq 7000, Zynq UltraScale+ MPSoC, and
AMD Versal™ devices. Use the following steps to configure and use the package management
system:

Figure 38: Package Management

1. Enable DNF through petalinux-config -c rootfs. Enable the following configs to use
DNF.
• Image Features → [*] package management
• No need to set the base package feed url in Image features → package-management →
package-feed-uris.

• No need to set the package feed architecture in Image features → package management
→ package-feed-archs.
From 2021.1, specifying package-feed-uris and package-feed-archs is optional. PetaLinux
or Yocto set the uris and set the archs based on the project.
The possible archs are available in https://petalinux.xilinx.com/sswreleases/rel-v2021.2/
generic/rpm
2. Build the project.
#petalinux-build

3. Boot Linux in SD or in JTAG boot mode.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 180
Chapter 12: Technical FAQs

4. Check for .repo file on target in /etc/yum.repos.d/ as follows:

[oe-remote-repo-sswreleases-rel-v2022-generic-rpm-noarch]
name=OE Remote Repo: sswreleases rel-v<PETALINUX_VER> generic rpm noarch
baseurl=http://petalinux.xilinx.com/sswreleases/rel-v<PETALINUX_VER>/
generic/rpm/noarch
gpgcheck=0

[oe-remote-repo-sswreleases-rel-v<PETALINUX_VER>-generic-rpm-aarch64]
name=OE Remote Repo: sswreleases rel-v<PETALINUX_VER> generic rpm aarch64
baseurl=http://petalinux.xilinx.com/sswreleases/rel-v<PETALINUX_VER>/
generic/rpm/aarch64
gpgcheck=0

[oe-remote-repo-sswreleases-rel-v<PETALINUX_VER>-generic-rpm-zynqmp]
name=OE Remote Repo: sswreleases rel-v<PETALINUX_VER> generic rpm zynqmp
baseurl=http://petalinux.xilinx.com/sswreleases/rel-v<PETALINUX_VER>/
generic/rpm/zynqmp
gpgcheck=0

[oe-remote-repo-sswreleases-rel-v<PETALINUX_VER>-generic-rpm-zynqmpeg]
name=OE Remote Repo: sswreleases rel-v<PETALINUX_VER> generic rpm
zynqmpeg
baseurl=http://petalinux.xilinx.com/sswreleases/rel-v<PETALINUX_VER>/
generic/rpm/zynqmpeg
gpgcheck=0

[oe-remote-repo-sswreleases-rel-v<PETALINUX_VER>-generic-rpm-
zynqmp_generic]
name=OE Remote Repo: sswreleases rel-v<PETALINUX_VER> generic rpm
zynqmp_generic
baseurl=http://petalinux.xilinx.com/sswreleases/rel-v2022/generic/rpm/
zynqmp_generic
gpgcheck=0

5. List all available packages.


#dnf repoquery

6. Install a specific package.


#dnf install <pkg name>

Example: #dnf install packagegroup-petalinux-matchbox


Once the matchbox package is installed, reboot the target and you should get the desktop
environment.

Common Tar Usage


Get the BOOT.BIN from the Vitis software platform or the PetaLinux BSP prebuilt to boot Linux
with common tar images. You can see runtime errors when hardware is not supported for the
utilities/packages enabled in the common rootfs with respect to each platform. Example cases
are as follows:

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 181
Chapter 12: Technical FAQs

• An error occurs when the AI EngineAI Engine is accessed on the VMK180 board using the
common rootfs because the VMK180 board does not support AI Engine.
• An error occurs when the VCU is accessed on the ZCU102 board using the common rootfs
because the VCU is not supported on the ZCU102.
• Use the rootfs utilities/packages based on the hardware supported on the board.

Linux Boot Hang with Large INITRAMFS Image in


Zynq 7000 Devices and Zynq UltraScale+ MPSoC
When the petalinux-boot command is issued, the following warning message is displayed:

"Linux image size is large (${imgsize}). It can cause boot issues. Please
refer to Technical FAQs. Storage based Root Filesystem is recommended for
large images."

Note: If your INITRAMFS image size is 128 MB, use storage-based boot only. It is recommended to use
only the INITD file system.

Detailed Component-based Logs


The <plnx-proj-root>/build/build.log log provides information on all the tasks that
are running and the tasks that have failed.

For each component and for each task, there are detailed logs that you can find in the build or in
the TMPDIR(NFS builds) directory.

• If you build on local space, you can find the component task wise logs in the build directory.
For example: For the device-tree component, do_configure task, the log is located at <plnx-
proj-root>/build/tmp/work/versal_generic-xilinx-linux/device-tree/
xilinx-v<petalinux-version>+gitAUTOINC+f725aaecff-r0/temp/
log.do_configure.32730.
• If you build on the NFS, you can find the log in <TMPDIR>/work/versal_generic-
xilinx-linux/device-tree/xilinx-<PETALINUX_VERSION>+gitAUTOINC
+f725aaecff-r0/temp/log.do_configure.32730. You can check the TMPDIR
location in the <plnx-proj-root>/project-spec/configs/config file.

PetaLinux Environment Issues


Note: Remove environment variables in .bashrc file while sourcing the PetaLinux tool, otherwise you might
see the following issue:

$ source /opt/pkg/petalinux/settings.sh
PetaLinux environment set to /opt/pkg/autolist'
bash: /opt/pkg/autolist/tools/common/petalinux//utils/petalinux-env-check:
No such file or directory

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 182
Chapter 12: Technical FAQs

From the previous example 'autolist' variable in .bashrc file causing the issue, this issue is resolved
by removing 'set autolist' variable from .bashrc file.

If you are facing such kind of environment issue in sourcing the PetaLinux tool, clean
up .bashrc by removing the specific environment variables.

Adding User Layer Failed with BitBake Timeout

If PetaLinux project configure to fail user layer with the following BitBake error, your user layer
PATH is exceeding limitation.

[INFO] Adding user layers


NOTE: Starting bitbake server...
NOTE: No reply from server in 30s
NOTE: No reply from server in 30s
Timeout while waiting for a reply from the bitbake server (60s)

To overcome the timeout issue, use the path within 250 characters.

Password Recovery
Use the following steps to recover password:

1. Set "launch_ramdisk_init" U-Boot environment variable in uEnv.txt file


launch_ramdisk_init=1

2. Add the file into fat partition of sd/emmc/usb boot devices


Note: Instead of previous variable, you can also set this bootargs setenv bootargs 'ext4=/dev/
null:/rootfs init_fatal_sh=1 '; in uEnv.txt or from U-Boot prompt before kernel
handoff.

3. U-Boot reads the file and boot with tiny rootfs


4. On tiny rootfs, mount rootfs partition to directory
mount /dev/mmcblk0p2 /mnt/

5. Change the root directory for the current running process to the specified directory
chroot /mnt

6. Change the password


passwd petalinux

7. Sync and unmount partition


sync
exit
umount /dev/mmcblk0p2

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 183
Chapter 12: Technical FAQs

8. Reset the board and try to login using updated password

Open Source PetaLinux


The PetaLinux Command Line utilities are now available as open source https://github.com/
Xilinx/PetaLinux

For more details and how to use refer https://github.com/Xilinx/PetaLinux/blob/


xlnx_rel_v2024.1/README.md

The PetaLinux Tool Generation is now available as open source https://github.com/Xilinx/meta-


petalinux-tools/

For more details and how to use refer https://github.com/Xilinx/meta-petalinux-tools/blob/


xlnx_rel_v2024.1/README.md

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 184
Appendix A: Migration

Appendix A

Migration
This section describes the migration details of the current release versus the previous release.

PetaLinux Supported Dynamic Configuration


The fpgamanager template names got renamed, and the exact mapping is given in the following
table.

Outdated templates remain functional, yet it is strongly recommended to adopt new template
names.

Design Input PetaLinux old Petalinux


Sr No Yocto Class Name platform
Type Files Template Name template name
1 NA dts/dtsi/ dfx_user_dts dfx_user_dts fpgamanager zynq
dtbo, zynqmp
bit.bin or
pdi versal

2 Flat xsa or dtsi dfx_dtg_zynq_full dfx_dtg_zynq_full fpgamanager_dtg zynq


3 Flat xsa or dtsi dfx_dtg_zynqmp_full dfx_dtg_zynqmp_full fpgamanager_dtg zynqmp
4 DFX xsa or dtsi dfx_dtg_zynqmp_static dfx_dtg_zynqmp_static fpgamanager_dtg zynqmp
static
5 DFX RP xsa or dtsi dfx_dtg_zynqmp_partial dfx_dtg_zynqmp_partia fpgamanager_dtg_dfx zynqmp
l
6 Flat xsa or dtsi dfx_dtg_versal_full dfx_dtg_versal_full fpgamanager_dtg_csoc versal
2
7 DFX xsa or dtsi dfx_dtg_versal_static dfx_dtg_versal_static fpgamanager_dtg versal
static
8 DFX RP xsa or dtsi dfx_dtg_versal_partial dfx_dtg_versal_partial fpgamanager_dtg_dfx versal

Dynamic Configuration Support in PetaLinux


The Programmable Logic(PL) can be programmed using FSBL/PLM or from U-Boot or from Linux.

This section provides the details about programming/reprogramming the PL from Linux world
using Linux FPGA Manager framework..

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 185
Appendix A: Migration

FPGA Manager Full PL Programming


Zynq 7000
The Zynq flat design has programmable logic (PL), and you want to defer the PL loading till Linux
comes up, use the following steps to extract the PL bitstream and pack the dtbo and bitstream
files into the /lib/firmware/xilinx directory in the root file system.

Prerequisites

Zynq 7000 flat design(xsa) with PL IPs in bitstream

Build Steps

Follow the steps to build and pack the full bitstream and its corresponding dtbo:

1. Source the PetaLinux tool


source /opt/petalinux/petalinux-v<petalinux-version>-final/settings.sh

2. Create a Zynq template project or bsp project


petalinux-create project -n zynq --template zynq
petalinux-create project -s <bsp path> -n zynq

3. Go to the project
cd zynq

4. Configure the project with flat xsa if you create a project in template flow
petalinux-config --get-hw-description <flat.xsa>

5. In the petalinux-config command, select FPGA Manager → [*] Fpga Manager.


Note: The PetaLinux FPGA manager configuration performs the following:

• fpga-overlay Machine features


• Enables the required kernel configs to load the fpgamanager driver
6. Use the petalinux-create command to extract the full bitstream and its corresponding pl
dtbo into the PetaLinux rootfs.
petalinux-create apps --template dfx_dtg_zynq_full -n can-interface --
srcuri "<path-to-xsa>/system.xsa" --enable

Note: If you do not specify --enable the dtbo and its bitstream is generated in <project>/
build/tmp/deploy directory.

7. To build as part of rootfs you can use the following commands:


petalinux-build
petalinux-build -c rootfs

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 186
Appendix A: Migration

To build only the application:


petalinux-build -c

Boot Steps

Once the base target is up, run the following command:

fpgautil o /lib/firmware/can interface/pl.dtbo b /lib/firmware/xilinx/can


interface/design_1_wrapper.bit.bin

ZynqMP
The ZynqMP design has programmable logic (PL), and you want to defer the PL loading till Linux
comes up, use the following steps to extract the PL bitstream and pack the dtbo and bitstream
files into the /lib/firmware/xilinx directory in the root file system.

Prerequisites

ZynqMP flat design(xsa) with PL IPs in bitstream

Build Steps

After creating a PetaLinux project, follow the steps to build and pack the full bitstream and its
corresponding dtbo:

1. Source the PetaLinux tool


source /opt/petalinux/petalinux-v<petalinux-version>-final/settings.sh

2. Create a ZynqMP template project or bsp project


petalinux-create project -n zynqmp --template zynqmp
petalinux-create project -s <bsp path> -n zynqmp

3. Go to the project
cd zynqmp

4. Configure the project with flat xsa if you create project in template flow
petalinux-config --get-hw-description <flat.xsa>

5. In the petalinux-config command, select FPGA Manager → [*] Fpga Manager.


Note: The PetaLinux FPGA manager configuration performs the following:

• fpga-overlay Machine features


• Enables the required kernel configs to load the fpgamanager driver

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 187
Appendix A: Migration

6. Use the petalinux-create command to extract the full bitstream and its corresponding pl
dtbo into the PetaLinux rootfs.
petalinux-create apps --template dfx_dtg_zynqmp_full -n can-interface --
srcuri "<path-to-xsa>/system.xsa" --enable

Note: If you do not specify --enable the dtbo and its bitstream is generated in <project>/
build/tmp/deploy directory.

7. To build as part of rootfs you can use the following commands:


petalinux-build
petalinux-build -c rootfs

To build only the application:


petalinux-build -c can-interface

Boot Steps

Once the base target is up, run the following command:

fpgautil -o /lib/firmware/can interface/pl.dtbo -b /lib/firmware/xilinx/can


interface/design_1_wrapper.bit.bin

Versal (Segmented Configuration Flow)


Segmented Configuration flow is quickly booted on an operating system prior to PL loading; NoC
+ DDR is required in the first programming image. Defer PL loading indefinitely, with the ability
to load PL PDI from any primary or secondary boot interface

Prerequisites

Versal flat design(xsa) contains boot pdi which includes Versal cips + NOC + DDR, and pld pdi,
which has PL IPs

Build Steps

This section helps to build and boot segmented configuration design flow for Versal platforms.

1. Source the PetaLinux tool


source /opt/petalinux/petalinux-v<petalinux-version>-final/settings.sh

2. Create a Versal template project or BSP project


petalinux-create project -n versal-seg-flow --template versal
petalinux-create project -s <bsp path> -n versal-seg-flow

3. Go to the project
cd versal-seg-flow

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 188
Appendix A: Migration

4. Configure the project with flat xsa if you create project in template flow
petalinux-config --get-hw-description <flat.xsa>

5. Enable FPGA manager, select FPGA Manager → [*] Fpga Manager.


Note: The PetaLinux FPGA manager configuration performs the following:

• fpga-overlay Machine features


• Enables the required kernel configs to load the fpgamanager driver
6. Create the pl application to pack the pl pdi and the pl ips dtbo into rootfs command:
petalinux-create apps --template dfx_dtg_versal_full -n pl-app --
enable --srcuri "<path>/rprm.xsa>"

The previous command generates and packages the rm dtbo, pl pdi files into the
rootfs(/lib/firmware/xilinx/<pl-app>)
7. To build the application, use the following command. The following command generates the
rootfs containing the rprm, dtbo, and respective pdi files:
petalinux-build
petalinux-build -c rootfs

To build only the application:


petalinux-build -c <pl-app>

8. To boot target with PS generate the boot.bin using the following command:
petalinux-package boot --u-boot (It will pick *_soc.pdi) and packs as
part of the boot.bin

Boot Steps

Once the base target is up, run the following command:

fpgautil -o /lib/firmware/can interface/pl.dtbo -b /lib/firmware/xilinx/pl-


app/hw_description_pld.pdi

Dynamic Functional Exchange (DFX) Flow


Versal
The FPGA manager provides an interface to Linux for reconfiguring the programmable region. It
packs the dtbos and bitstreams/pdi files into the /lib/firmware/xilinx directory in the
root file system.

This section helps to build and boot PL applications with DFX design for the Versal platform.

Note: If DFX applications (rm.xsa) have any memory-mapped PL IPs, only then use fpgamanager_dtg_dfx
template. If not, you can use --template dfx_user_dts install to pack only pdi as part of rootfs.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 189
Appendix A: Migration

Prerequisites

• Versal static design(static xsa) contains static pdi which includes Versal cips + NOC + DDR +
PL(static PL + empty RP regions)
• Versal reconfigurable module design(rm.xsa) which includes pdi with ips that we want to
program
• You can have more than one rm xsa file

Build Steps

1. Source the PetaLinux tool.


source /opt/petalinux/petalinux-v<petalinuxversion>/settings.sh

2. Create a Versal template project or BSP project


petalinux-create project -n versal-dfx --template versal
petalinux-create project -s <bsp path> -n versal-dfx

3. Go to the project
cd versal-dfx

4. Configure the project with static.xsa/base.xsa if you have created the project using
the template flow
petalinux-config --get-hw-description <base.xsa/static.xsa>

5. Enable FPGA manager using the following command:


petalinux-config -> FPGA MANAGER

Note: The PetaLinux FPGA manager configuration performs the following:

• fpga-overlay Machine features


• Enables the required kernel configs to load the fpgamanager driver
6. Create the static application using the following command from static xsa
petalinux-create apps --template dfx_dtg_versal_static -n <static-app> --
enable --srcuri "<static xsa>"

The previous command creates and packages the static dtbo and pdi files into the rootfs
(/lib/firmware/xilinx/) using dfx_dtg_versal_static template.
7. Create the partial application to configure the partial region using the rm xsa in the following
command. You should point static pl app name as --static-pn command line option to
define the relation between base and partial.
petalinux-create apps --template dfx_dtg_versal_partial -n <rm-app> --
enable --srcuri <rm.xsa>" --static-pn <static-app>

This command generates and packages the rm dtbo, pdi files into the rootfs (/lib/
firmware/xilinx/<static-app>/<rm-app>).

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 190
Appendix A: Migration

8. To build the application, use the following command. The following command generates the
rootfs containing both static and rprm dtbos, and respective pdi files.
petalinux-build or petalinux-build -c rootfs

To build only the application


petalinux-build -c <static-app>
petalinux-build -c <rm-app>

In <TMPDIR>/deploy/rpm you can see <static-app>.rpm and <rm-app>.rpm


Note: The pdi's in the design should have i*_partial.pdi in the xsa files to avoid an error.

Note: In the DFX use case, you can use the static xsa to create the Versal boot firmware images so
static pdi is packaged as a part of BOOT.BIN.

Boot Steps

Up the target with previously built images using any of the boot methods in the documentation.
Once the target is up, run the following commands.

fpgautil -o /lib/firmware/xilinx/<static-app>/<static-app>.dtbo
fpgautil -b /lib/firmware/xilinx/<staticapp>/rp0/<rprm-app>/<rprm-app>.pdi
-o /lib/firmware/xilinx/<staticapp>/rp0/<rprm-app>/<rprm-app>.dtbo -f
Partial -n PR0

ZynqMP
The FPGA manager provides an interface to Linux for reconfiguring the programmable region
later. It packs the dtbos and bitstreams files into the /lib/firmware/xilinx directory in the
root file system.

This section helps to build and boot DFX design for the ZynqMP platform.

Note: If DFX applications(rm.xsa) have any memory mapped PL IPs only then use fpgamanager_dtg_dfx
template. If not you can use --template dfx_user_dts install to pack only pdi as part of rootfs.

Prerequisites

• ZynqMP static design(static xsa) contains static bitream which includes static PL IPs and
reprogrammable regions
• ZynqMP reconfigurable module design(rm.xsa) which includes bitstream with ips that you
want to program
• You can have more than one rm xsa files

Build Steps

1. Source the PetaLinux tool.


source /opt/petalinux/petalinux-v<petalinuxversion>/settings.sh

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 191
Appendix A: Migration

2. Create a ZynqMP template project or BSP project


petalinux-create project -n zynqmp-dfx --template zynqmp
petalinux-create project -s <bsp path> -n zynqmp-dfx

3. Go to the project
cd zynqmp-dfx

4. Configure the project with static.xsa/base.xsa


petalinux-config --get-hw-description <base.xsa/static.xsa>

5. Enable FPGA manager using the following command:


petalinux-config -> FPGA MANAGER

Note: The PetaLinux FPGA manager configuration performs the following:

• fpga-overlay Machine features


• Enables the required kernel configs to load the fpgamanager driver
6. Create the static application using the following command from static xsa
petalinux-create apps --template dfx_dtg_zynqmp_static -n <static-app> --
enable --srcuri "<static xsa>"

The previous command creates and packages the static dtbo and pdi files into the rootfs
(/lib/firmware/xilinx/) using dfx_dtg_zynqmp_static template.
7. Create the partial application to configure the partial region using the rm xsa in the following
command. You should point static pl app name as --static-pn command line option to
define the relation between base and partial.
petalinux-create apps --template dfx_dtg_zynqmp_partial -n <rm-app> --
enable --srcuri <rm.xsa>" --static-pn <static-app>

This command generates and packages the rm dtbo, pdi files into the rootfs (/lib/
firmware/xilinx/<static-app>/<rm-app>).
8. To build the application, use the following command. The following command generates the
rootfs containing both static and rprm dtbos, and respective pdi files.
petalinux-build or petalinux-build -c rootfs

To build only the application


petalinux-build -c <static-app>
petalinux-build -c <rm-app>

In <TMPDIR>/deploy/rpm you can see <static-app>.rpm and <rm-app>.rpm


Note: The pdi's in the design should have i*_partial.pdi in the xsa files to avoid an error.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 192
Appendix A: Migration

Boot Steps

Up the target with previously built images using any of the boot methods in the documentation.
Once the target is up, run the following commands.

fpgautil -o /lib/firmware/xilinx/<static-app>/<static-app>.dtbo
fpgautil -b /lib/firmware/xilinx/<staticapp>/rp0/<rprm-app>/<rprm-app>.pdi
-o /lib/firmware/xilinx/<staticapp>/rp0/<rprm-app>/<rprm-app>.dtbo -f
Partial -n PR0

Dynamic Configuration with User Specified dtsi/dtbo


Flow for Zynq/ZynqMP/Versal
This section provides information on the mechanism and infrastructure required to work with
custom IPs that have readily (hand-stitched) available dtsi files instead of relying on the DTG to
generate them when the FPGA manager is enabled. This generates/packs the dtbo and bin/pdi
files into the rootfs /lib/firmware/xilinx directory.

Prerequisites

• dtsi and its corresponding pdi/bit.bin or


• dtbo and its corresponding pdi/bit.bin files

Build Steps

1. Source the PetaLinux tool.


source /opt/petalinux/petalinux-v<petalinuxversion>/settings.sh

2. Create a Versal template project or BSP project


petalinux-create project -n zynqmp-dfx --template zynqMP
petalinux-create project -s <bsp path> -n zynqmp

3. Go to the project
cd zynqmp-dfx

4. Configure the project with static.xsa/base.xsa


petalinux-config --get-hw-description <base.xsa/static.xsa>

5. Enable FPGA manager using the following command:


petalinux-config -> FPGA MANAGER

Note: The PetaLinux FPGA manager configuration performs the following:

• fpga-overlay Machine features


• Enables the required kernel configs to load the fpgamanager driver

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 193
Appendix A: Migration

6. Create the FPGA manager template


petalinux-create apps --template dfx_user_dts -n can-interface --srcuri
"can.dtsi can.bit.bin" --enable

Or
petalinux-create apps --template dfx_user_dts -n can-interface --srcuri
"can.dtbo can.bit.bin" --enable

Or
petalinux-create apps --template dfx_user_dts -n can-interface --srcuri
"can.dtsi can.pdi" --enable

Or
petalinux-create apps --template dfx_user_dts -n can-interface --srcuri
"can.dtbo can.pdi" --enable

Or
petalinux-create apps -template dfx_user_dts -n usrapp -scruri "user.dts
user1.dtsi user2.dtsi system.pdi" -enable

7. Build the application.


If you want to build as part of rootfs
petalinux-build

Or
petalinux-build -c rootfs

If you want to build only the application.


petalinux-build -c can interface

Boot Steps

Up the target with previously built images using any of the boot methods in the documentation.
Once the target is up, run the following commands.

fpgautil -o /lib/firmware/can interface/pl.dtbo -b /lib/firmware/xilinx/can


interface/design_1_wrapper.bit.bin

Customizing the Generated Dynamic Configuration


PL dtsi Files
If you have any custom user dtsi files to this PL applications or PL properties, you can refer to
this section

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 194
Appendix A: Migration

• For Zynq full PL programming if you have a custom pl dtsi file, provide the custom dtsi file to
the srcuri and it is used while generating pl.dtbo file
petalinux-create apps --template dfx_dtg_zynq_full -n can-interface --
srcuri "<path-to-xsa>/system.xsa pl-custom.dtsi" --enable

• For ZynqMP full PL programming, if you have a custom pl dtsi file, provide the custom dtsi file
to the srcuri and it is used while generating pl.dtbo file
petalinux-create apps --template dfx_dtg_zynqmp_full -n can-interface --
srcuri "<path-to-xsa>/system.xsa pl-custom.dtsi" --enable

• For Versal full PL programming, if you have a custom pl dtsi file, provide the custom dtsi file to
the srcuri and it is used while generating pl.dtbo file
petalinux-create apps --template dfx_dtg_versal_full -n can-interface --
srcuri "<path-to-xsa>/system.xsa pl-custom.dtsi" --enable

• For ZynqMP DFX programming if you have a custom pl dtsi file for static PL, provide the
custom dtsi file to the srcuri and it is used while generating pl.dtbo file
petalinux-create apps --template dfx_dtg_zynqmp_static -n <static-app> --
enable --srcuri "<static xsa> pl-custom.dtsi"

• For ZynqMP DFX programming, if you have a custom pl dtsi file for rm PL application, provide
the custom dtsi file to the srcuri, and it is used while generating pl-partial-rm.dtbo file
petalinux-create apps --template dfx_dtg_zynqmp_partial -n <rm-app> --
enable --srcuri <rm.xsa> pl-partial-custom.dtsi" --static-pn <static-app>

• For Versal DFX programming, if you have a custom pl dtsi file for static PL, provide the custom
dtsi file to the srcuri and it is used while generating pl.dtbo file
petalinux-create apps --template dfx_dtg_versal_static -n <static-app> --
enable --srcuri "<static xsa> pl-custom.dtsi"

• For Versal DFX programming, if you have a custom pl dtsi file for rm PL application, provide
the custom dtsi file to the srcuri, and it is used while generating pl-partial-rm.dtbo file
petalinux-create apps --template dfx_dtg_versal_partial -n <rm-app> --
enable --srcuri <rm.xsa> pl-partial-custom.dtsi" --static-pn <static-app>

Examples
1. petalinux-create apps -template dfx_user_dts -n usrapp -scruri
"user.dtsi system.bit" -enable

2. petalinux-create apps -template dfx_user_dts -n usrapp -scruri "user.dts


user1.dtsi user2.dtsi system.bit" -enable

3. petalinux-create apps -template dfx_user_dts -n usrapp -scruri


"user.dtsi system.pdi" -enable

4. petalinux-create apps -template dfx_user_dts -n usrapp -scruri "user.dts


user1.dtsi user2.dtsi system.pdi" -enable

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 195
Appendix A: Migration

5. petalinux-create apps -template dfx_user_dts -n usrapp -scruri


"user.dtbo system.bit.bin" -enable

6. petalinux-create apps -template dfx_user_dts -n usrapp -scruri


"user.dtbo system.pdi" -enable

7. petalinux-create apps -template dfx_user_dts -n usrapp -scruri


"user.dtbo" -enable

8. petalinux-create apps -template dfx_dtg_zynq_full -n usrapp -scruri


"flat.xsa" -enable

9. petalinux-create apps -template dfx_dtg_zynq_full -n usrapp -scruri


"flat.xsa custom.dtsi" -enable

10. petalinux-create apps -template dfx_dtg_zynqmp_full -n usrapp -scruri


"flat.xsa" -enable

11. petalinux-create apps -template dfx_dtg_zynqmp_full -n usrapp -scruri


"flat.xsa custom.dtsi" -enable

Login Changes
Follow the steps for login change:

1. serial-autologin-root option in PetaLinux tool is disabled by default. If required, you can


enable this with $ petalinux-config -c rootfs -→ Image Features -→ [ ] serial-autologin-root.
2. The root login is disabled by default. The default user is petalinux and the password should
be set on first boot. If you want to use ssh login, you should first boot via console and need
to set password.
3. Yocto removed plain text passwords support. The password should be in salt form. PetaLinux
converts the provided password in config to static salt password using openssl and add to
plnxtool.conf.
Config settings to set user and password:
petalinux-config -c rootfs -→ PetaLinux RootFS Settings -→
(root:root;petalinux:petalinux:passwd-expire;)

In plnxtool.conf EXTRA_USERS_PARAMS looks like:


EXTRA_USERS_PARAMS = "usermod -p '\$6\$xx\$CkLCyUiVJPDvNL9C/
gQans7jV3BvnVoW60raOcEE.KlziPn8pPMe8WvAQ3cPwwO4YRcYRBjlUhSfw/kaubhtp1'
root; \
useradd -p \$6\$xx\$12fBVQgrrkB6ZmS6DSUIeVLW3Cot/
hC4g8ZhbcwLZtKG93spibFJ/.0rF688RnsqMrgIbnHFkZnJu0Tk9.7F41'
petalinux;passwd-expire petalinux; \"

Note: Display WARNING message when 'root' password is set to 'root'. Warning: Root password set to
'root', It is highly recommended to change Root password.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 196
Appendix A: Migration

4. Add config support to specify passwd-expire.


petalinux-config -c rootfs -→ PetaLinux RootFS Settings -→
(root:root;petalinux:petalinux:passwd-expire;) Add Extra Users

5. Removed the ROOTFS_PASSWD configuration option. Use EXTRA_USERS configuration to


specify the root user password.
6. You can skip the root password using petalinux-config -c rootfs -> Image Features -> empty-
root-password

Systemv to Systemd
SYSVINIT

• systemv (sysv) is one of the first and traditional init systems for the UNIX/Linux operating
system.
• If you are starting and stopping init services using /etc/init.d/sshd start, you Are on a
SystemVinit system.

SYSTEMD

• systemd is a new init system and service manager for Linux operating systems.
• If you are starting and stopping things using systemctl restart sshd, you are on a
SystemD system.

By default SYSTEMD enabled as init-manager for AMD Zynq™ UltraScale+™ MPSoC and AMD
Versal™ platforms, SYSVINIT enabled as init-manager for Zynq and MicroBlaze™ platforms.

Note: Customers using their own init-script should modify as required to work with SYSTEMD. In old
releases, it used to be SYSVINIT.

To Switch between sysv and systemd use the following config:

petalinux-config -c rootfs, select Image Features -→ Init-manager (systemd) save and exit.

Run petalinux-build.

Yocto Override Syntax Changes


The [:]colon character replaces the use of [ _ ] underscore referring to an override.

Check the link for more informationhttps://docs.yoctoproject.org/migration-guides/


migration-3.4.html#override-syntax-changes.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 197
Appendix A: Migration

Yocto Recipe Name Changes


Yocto updated the following recipe names from 2021.1:

Table 36: Updated Yocto Recipe Names

Old Recipe File Name New Recipe File Name


fsbl.bb fsbl-firmware.bb
plm.bb plm-firmware.bb

If you are creating or using any bbappends for these components, you need to update them.

For example:

mkdir <plnx-proj-root>/project-spec/meta-user/recipes-bsp/embeddedsw/
touch <plnx-proj-root>/project-spec/meta-user/recipes-bsp/embeddedsw/fsbl-
firmware_%.bbappend
Add recipe changes into fsbl-firmware_%.bbappend file.

U-Boot Image Changes


From 2021.1, PetaLinux removed DTB from u-boot.elf. U-Boot now uses the DTB from
BOOT.BIN instead of u-boot.elf. If you are using a custom BIF file to generate BOOT.BIN,
include the DTB in the file so that the boot does not fail.

Table 37: U-Boot Files Deployed by PetaLinux

File name Description


u-boot.elf Self-extractable U-Boot elf containing the U-Boot binary
symbols with a larger size than previous versions
u-boot-dtb.elf Self-extractable U-Boot elf that has the U-Boot binary with DTB
u-boot.bin Contains the U-Boot binary
u-boot-dtb.bin Contains the U-Boot binary with DTB

By default, PetaLinux uses u-boot.elf to create JTAG/BOOT.BIN. During BOOT.BIN


creation, Bootgen removes the symbols from u-boot.elf so that there is no size difference in
the final BOOT.BIN. You can also use u-boot-dtb.elf for BOOT.BIN. In that case, U-Boot
uses the DTB from u-boot-dtb.elf instead of BOOT.BIN.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 198
Appendix A: Migration

MCS File Support


From 2021.2, PetaLinux supports generating MCS file for AMD Zynq™ , Zynq UltraScale+
MPSoC, and AMD Versal™ platforms using Bootgen utility. This enables you to program the MCS
file directly to a target board and boot. The output MCS file can be found in <plnx-proj-
root>/images/linux/ with the name boot.mcs.

The following is the command to generate the MCS file:

petalinux-package boot --u-boot --kernel --offset <Fit Image Flash Offset


Address> --format MCS --force

For more details see Generate MCS Image in Packaging Boot Image for specific platform.

BIF File Changes


In releases prior to 2021.2, PetaLinux used to maintain the bootgen.bif file in the <plnx-
proj-root>/build directory and the images path pointed to /tmp/tmp-xxx/
<imagename>. From 2022.2, the bootgen.bif file is generated in the <plnx-proj-root>/
images/linux folder with the exact image paths from where you are pointing.

The following is the BIF file generated with the old releases for AMD Zynq™ UltraScale+™
MPSoC:

the_ROM_image:
{
[bootloader, destination_cpu=a53-0] /tmp/tmp.wpgCyCGXpV/zynqmp_fsbl.elf
[pmufw_image] /tmp/tmp.wpgCyCGXpV/pmufw.elf
[destination_device=pl] /tmp/tmp.wpgCyCGXpV/project_1.bit
[destination_cpu=a53-0, exception_level=el-3, trustzone] /tmp/
tmp.wpgCyCGXpV/bl31.elf
[destination_cpu=a53-0, load=0x00100000] /tmp/tmp.wpgCyCGXpV/system.dtb
[destination_cpu=a53-0, exception_level=el-2] /tmp/tmp.wpgCyCGXpV/u-boot.elf
}

The following is the BIF file generated with the 2024.1 release for Zynq UltraScale+ MPSoC:

the_MCS_image:
{
[bootloader, destination_cpu=a53-0] <plnx-proj-root>/images/linux/
zynqmp_fsbl.elf
[pmufw_image] <plnx-proj-root>/images/linux/pmufw.elf
[destination_device=pl] <plnx-proj-root>/project-spec/hw-description/
project_1.bit
[destination_cpu=a53-0, exception_level=el-3, trustzone] <plnx-proj-root>/
images/linux/bl31.elf

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 199
Appendix A: Migration

[destination_cpu=a53-0, load=0x00100000] <plnx-proj-root>/images/linux/


system.dtb
[destination_cpu=a53-0, exception_level=el-2] <plnx-proj-root>/images/
linux/u-boot.elf
}

Use Yocto Environment Variables in


petalinux-config Option
From this release, PetaLinux supports using all Yocto variables in petalinux-config, for
example, TMPDIR. To use the shell variables, you need to export the shell variable to
BB_ENV_PASSTHROUGH_ADDITIONS. You cannot use normal shell variables directly to align with
Yocto like the previous versions.

export BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS
BB_USERNAME"

Note: In the previous example, the host machine exports the user environment variable by default.

export BB_USERNAME=$(whoami)
exportBB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS
BB_USERNAME"

Note: In the previous example, BB_USERNAME is a new environment variable defined and exported to the
BB_ENV_PASSTHROUGH_ADDITIONS Yocto variable. After it is exported to
BB_ENV_PASSTHROUGH_ADDITIONS, you can use BB_USERNAME for the petalinux-config options

Host GCC Version Upgrade


From this release, the gcc version should be greater than 7. Using lower versions of gcc causes
build issues.

From 2024.1 PetaLinux release onwards 'buildtools-extended' support is removed.

Removed config.project
Removed config.project metadata file from PetaLinux, as the metadata is in petalinux/
metadata file.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 200
Appendix A: Migration

Usage of uenv.txt
Set any U-Boot environment through Uenv.txt file:

• Add the file into fat partition of sd/emmc/usb where U-Boot sits
• U-Boot reads the file and makes changes from Uenv.txt.

This is possible only in sd/emmc/usb boot modes.

Renamed ARM Trusted Firmware


Configuration
The Arm trusted firmware configuration menu is changed to Trusted Firmware
configuration.

Figure 39: Trusted Firmware Configuration

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 201
Appendix B: PetaLinux to Create PL Applications and Install on Target

Appendix B

PetaLinux to Create PL Applications


and Install on Target
This section is useful for PL application developers who have setup bootable images from the
BSP and want to create only PL applications.

1. Source the PetaLinux tool.


2. Create the project.
petalinux-create project -s <bsp>

3. Go to the bsp.
4. Use the petalinux-create command to add the PL xsa files into the PetaLinux project.
The following command creates the fpgamanager_dtg app with the xsa file to generate the
dtsi and bit files.
petalinux-create apps --template dfx_dtg_<platform>_full (platform can
be zynq, zynqmp and versal) -n can-interface --srcuri <path-to-xsa>/
system.xsa

INFO: Create apps: can-interface


INFO: Copying source urls into the project directory
INFO: New apps successfully created in <plnx-proj-root>/project-spec/
meta-user/recipes-apps/can-interface
INFO: Enabling created component...
INFO: Sourcing build environmentINFO: Silentconfig rootfs
INFO: can-interface has been enabled

Note: For each XSA, create a separate app using the previous command. FPGA manager should be
enabled in petalinux-config.

5. Run petalinux-build.
6. You can find the dtbo and bin files into <proj>/build/tmp/deploy/rpm dir.
7. You can get the required rpm files onto the target using tftp and install the rpms.
rpm -i <rpmname>

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 202
Appendix C: PetaLinux Project Structure

Appendix C

PetaLinux Project Structure


This section provides a brief introduction to the file and directory structure of a PetaLinux
project. A PetaLinux project supports development of a single Linux system development at a
time. A built Linux system is composed of the following components:

• Device tree
• First stage boot loader (optional)
• U-Boot
• Linux kernel
• The root file system is composed of the following components:
○ Prebuilt packages

○ Linux user applications (optional)

○ User modules (optional)

A PetaLinux project directory contains configuration files of the project, the Linux subsystem,
and the components of the subsystem. The petalinux-build command builds the project
with those configuration files. You can run petalinux-config to modify them. The following
is an example of a PetaLinux project:

project-spec
hw-description
configs
meta-user
pre-built
linux
implementation
images
xen
hardware
<project-name>
components
plnx_workspace
device-tree
config.project
README

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 203
Appendix C: PetaLinux Project Structure

Table 38: PetaLinux Project Description

File / Directory in a PetaLinux Project Description


/.petalinux/ Directory to hold tools usage.
/config.project/ Project configuration file.
/project-spec Project specification.
/project-spec/hw-description Hardware description imported from AMD Vivado™ design
tools.
/project-spec/configs Configuration files of top level config and RootFS config.
/project-spec/configs/config Configuration file used to store user settings.
/project-spec/configs/rootfs_config Configuration file used for root file system.
/project-spec/configs/busybox Configuration file for busybox.
/project-spec/configs/init-ifupdown Configuration file for Ethernet.
/components/plnx_workspace/device-tree/device- Device tree files used to build device tree. The following files
tree/ are auto generated by petalinux-config:
• skeleton.dtsi (Zynq 7000 devices only)
• zynq-7000.dtsi (Zynq 7000 devices only)
• zynqmp.dtsi (Zynq UltraScale+ MPSoC only)
• pcw.dtsi (Zynq 7000 devices and Zynq UltraScale+
MPSoC only)
• pl.dtsi
• system-conf.dtsi
• system-top.dts
• <bsp name>.dtsi
• versal.dtsi for Versal
It is not recommended to edit these files, as these files are
regenerated by the tools.
/project-spec/meta-user/recipes-bsp/device- system-user.dtsi is not modified by any PetaLinux tools.
tree/files/ This file is safe to use with revision control systems. In
addition, you can add your own DTSI files to this directory.
You have to edit the <plnx-proj-root>/project-spec/
meta-user/recipes-bsp/device-tree/device-
tree.bbappend by adding your DTSI file.
/project-spec/meta-user/recipes-bsp/u-boot/ platform-top.h is copied to include/configs/
files/platform-top.h (only for MicroBlaze processors) directory in the U-Boot source
/project-spec/meta-user/conf/petalinuxbsp.conf This configuration file contains all the local user
configurations for your build environment. It is a substitute
for local.conf in the Yocto meta layers.

Notes:
1. All the paths are relative to <plnx-proj-root>.

When the project is built, three directories are auto generated:

• <plnx-proj-root>/build for the files generated for build.


• <plnx-proj-root>/images for the bootable images.
• <plnx-proj-root>/build/tmp for the files generated by Yocto. This directory is
configurable through petalinux-config.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 204
Appendix C: PetaLinux Project Structure

• <plnx-proj-root>/components/yocto has Yocto eSDK. This file is generated when


execute petalinux-config/petalinux-build.
• When petalinux-package --prebuilt is run, it creates a pre-built/directory in
<PROJECT>/ and copies the build image files from the <PROJECT>/images/linux
directory to the <PROJECT>/pre-built/linux/images/ directory.

Here is an example:

├── build
│ ├── bitbake-cookerdaemon.log
│ ├── build.log
│ ├── cache
│ ├── conf
│ ├── downloads
│ ├── misc
│ ├── sstate-cache
│ └── tmp
├── components
│ ├── plnx_workspace
│ └── yocto
├── config.project
├── hardware
│ └── project-name
├── images
│ └── linux
├── pre-built
│ └── linux
├── project-spec
│ ├── attributes
│ ├── configs
│ ├── hw-description
│ └── meta-user
└── README

Note: <plnx-proj-root>/build/ are automatically generated. Do not manually edit files in this
directory. Contents in this directory are updated when you run petalinux-config or petalinux-
build. <plnx-proj-root>/images/ are also automatically generated. Files in this directory are
updated when you run petalinux-build.

The following table is an example for AMD Zynq™ UltraScale+™ MPSoC.

By default the build artifacts are removed to preserve space after petalinux-build. To
preserve the build artifacts, you have to add the INHERIT:remove = "rm_work" in <plnx-
proj-root>/project-spec/meta-user/conf/petalinuxbsp.conf, but it increases
the project space.

Table 39: Build Directory in a PetaLinux Project

Build Directory in a PetaLinux Project Description


<plnx-proj-root>/build/build.log Logfile of the build.
<plnx-proj-root>/build/misc/config/ Directory to hold files related to the Linux subsystem build.
<plnx-proj-root>/build/misc/rootfs_config/ Directory to hold files related to the RootFS build.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 205
Appendix C: PetaLinux Project Structure

Table 39: Build Directory in a PetaLinux Project (cont'd)

Build Directory in a PetaLinux Project Description


${TMPDIR}/work/zynqmp_generic-xilinx-linux/ RootFS copy of target. This is the staging directory.
petalinux-image-minimal/1.0-r0/rootfs
${TMPDIR}/zynqmp_generic-xilinx-linux Stage directory to hold the libs and header files required to
build user apps/libs.
${TMPDIR}/work/zynqmp_generic-xilinx-linux/ Directory to hold files related to the kernel build.
linux-xlnx/
${TMPDIR}/work/zynqmp_generic-xilinx-linux/u- Directory to hold files related to the U-Boot build.
boot-xlnx
<plnx-proj-root>/components/plnx_workspace/ Directory to hold files related to the device tree build.
device-tree/device-tree"
<plnx-proj-root>/components/yocto Directory to hold Yocto eSDK content.

Table 40: Image Directory in a PetaLinux Project

Image Directory in a PetaLinux Project Description


<plnx-proj-root>/images/linux/ Directory to hold the bootable images for Linux subsystem
<plnx-proj-root>/images/linux Directory to hold the bootable images for xen hyperviser

Project Layers
The PetaLinux project has the following layer under <plnx-proj-root>/project-spec.

meta-user

This layer is a place holder for all user-specific changes. You can add your own bbappend and
configuration files in this layer.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 206
Appendix D: Generating Boot Components

Appendix D

Generating Boot Components

Platform Loader and Manager Firmware


(PLM)
This is for AMD Versal™ adaptive SoC. This is mandatory. By default, the top-level system
settings are set to generate the PLM.

If you had disabled PLM from menuconfig previously, you can configure the project to build PLM
as follows:

1. Launch top level system settings configuration menu and configure:


petalinux-config

a. Select Linux Components Selection ---> submenu.


b. Select PLM.
c. Enter your settings.
d. Exit the menu and save the change.
2. Build the PLM when building the project:
petalinux-build

3. Build the PLM only:


petalinux-build -c plm

The PLM ELF file is installed as plm.elf for Versal adaptive SoC in images/linux inside the
project root directory.

For more information on PLM, see Versal Adaptive SoC System Software Developers Guide
(UG1304).

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 207
Appendix D: Generating Boot Components

Processing System Management Firmware


(PSM)
This is for AMD Versal™ adaptive SoC. This is mandatory. By default, the top-level system
settings are set to generate the PSM.

If you had disabled PSM from menuconfig previously, you can configure the project to build PSM
as follows:

1. Launch top level system settings configuration menu and configure:


petalinux-config

a. Select the Linux Components Selection submenu.


b. Select PSM firmware.
c. Enter your settings.
d. Exit the menu and save the change.
2. Build the PSM when building the project:
petalinux-build

3. Build the PSM only:


petalinux-build -c psm-firmware

The PSM ELF file is installed as psmfw.elf for Versal adaptive SoC in images/Linux inside
the project root directory.

For more information on PSM, see Versal Adaptive SoC System Software Developers Guide
(UG1304).

Image Selector
Note: This section is only for AMD Zynq™ UltraScale+™ MPSoCs.

By default, the top-level system settings are not set to generate the Image Selector.

Image Selector currently supports the selection of boot images based on the following data:

• Board EEPROM data


• QSPI A/B update register data

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 208
Appendix D: Generating Boot Components

If you want enable Image Selector from menuconfig, configure the project to build Image Selector
as follows:

1. Launch top level system settings configuration menu and configure:


petalinux-config

a. Select the Linux Components Selection submenu.


b. Select Image Selector.
c. Enter your settings.
d. Exit the menu and save the change.
2. Build the Image Selector when building the project:
petalinux-build

3. Build the Image Selector only:


petalinux-build -c imgsel

The image selector ELF file is installed as imgsel.elf for Zynq UltraScale+ MPSoCs in the
images/Linux inside the project root directory.

First Stage Boot Loader for Zynq UltraScale+


and Zynq 7000 Devices
By default, the top level system settings are set to generate the first stage boot loader. This is
optional.

Note: If you do not want the PetaLinux build FSBL/FS-BOOT, you need to manually build it on your own.
Else, your system does not boot properly.

If you had disabled first stage boot loader from menuconfig previously, You can configure the
project to build first stage boot loader as follows:

1. Launch top level system settings configuration menu and configure:


petalinux-config

a. Select Linux Components Selection ---> submenu.


b. Select First Stage Boot Loader option.
[*] First Stage Bootloader

c. Select the FSBL Configuration ---> submenu.


d. For application compiler flags, select FSBL Configuration → FSBL compiler flags.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 209
Appendix D: Generating Boot Components

e. For BSP compiler flags, select FSBL Configuration → FSBL BSP extra compiler flags.
f. Enter your compilation flags.
g. Exit the menu and save the change.
2. Launch petalinux-build to build the FSBL:
Build the FSBL when building the project:
petalinux-build

Build the FSBL only:


petalinux-build -c fsbl (for MicroBlaze, it is fs-boot)

The boot loader ELF file is installed as zynqmp_fsbl.elf for Zynq UltraScale+ MPSoC,
zynq_fsbl.elf for AMD Zynq™ 7000 devices and fs-boot.elf for MicroBlaze™
processors in images/linux inside the project root directory.

For more information on FSBL, see https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/


18842019/FSBL.

Trusted Firmware-A (TF-A)


This is for Zynq UltraScale+ MPSoC and Versal adaptive SoC. This is mandatory. By default, the
top level system settings are set to generate the TF-A.

You can set the TF-A configurable options as follows:

1. Launch top level system settings configuration menu and configure:


petalinux-config

a. Select the Trusted Firmware-A Compilation Configuration ---> submenu.


b. Enter your settings.
c. Exit the menu and save the change.
2. Build the TF-A when building the project:
petalinux-build

Build the TF-A only:


petalinux-build -c arm-trusted-firmware

The TF-A ELF file is installed as bl31.elf for Zynq UltraScale+ MPSoC and Versal adaptive
SoC in images/linux inside the project root directory.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 210
Appendix D: Generating Boot Components

For more information on TF-A, see https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/


18842107/Arm+Trusted+Firmware.

PMU Firmware
This is for Zynq UltraScale+ MPSoC only. This is optional. By default, the top level system
settings are set to generate the PMU firmware.

CAUTION! If you do not want PetaLinux to build the PMU firmware, you have to manually build it on your
own. Else, your system does not boot properly.

You can configure the project to build PMU firmware as follows:

1. Launch top level system settings configuration menu and configure:


petalinux-config

a. Select Linux Components Selection.


b. Select PMU Firmware option.
[*] PMU Firmware

c. Select the PMUFW Configuration → PMUFW compiler flags submenu.


d. Enter your compilation flags.
e. Exit the menu and save the change.
2. Build the PMU firmware when building the project:
petalinux-build

Build the PMU firmware only:


petalinux-build -c pmufw

The PMU firmware ELF file is installed as pmufw.elf for Zynq UltraScale+ MPSoC in
images/linux inside the project root directory.
For more information on PMU Firmware, see https://www.wiki.xilinx.com/PMU+Firmware.

FS-Boot for MicroBlaze Platform Only


FS-Boot in PetaLinux is a first stage boot loader demo for MicroBlaze™ platform only. It is to
demonstrate how to load images from flash to the memory and jump to it. If you want to try FS-
Boot, you must have a minimum of 8 KB block RAM.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 211
Appendix D: Generating Boot Components

FS-Boot supports parallel flash and SPI flash in standard SPI mode and Quad SPI mode only.

In order for FS-Boot to know where in the flash should get the image, macro
CONFIG_FS_BOOT_START needs to be defined. This is done by the PetaLinux tools. PetaLinux
tools set this macro automatically from the boot partition settings in the menuconfig primary
flash partition table settings. For parallel flash, it is the start address of boot partition. For SPI
flash, it is the start offset of boot partition.

The image in the flash requires a wrapper header followed by a BIN file. FS-Boot gets the target
memory location from wrapper. The wrapper needs to contain the following information:

Table 41: Wrapper Information

Offset Description Value


0×0 FS-Boot bootable image magic code ×0b8b40008

0×4 BIN image size User-defined

0×100 FS-Boot bootable image target memory User-defined. The PetaLinux tool automatically
address calculates it from the U-Boot text base address
offset from the Memory Settings from the
menuconfig.
0×10c Where the BIN file start None

The FS-Boot ignores other fields in the wrapper header. The PetaLinux tool generates the
wrapper header to wrap around the U-Boot BIN file.

Note: PetaLinux only supports 32-bit MicroBlaze processors.

The FS-Boot supports symmetric multi processing (SMP) from the 2020.1 release onwards. You
can have multiple MicroBlaze processors in your design. A maximum of eight cores is supported.

The same FS-Boot which is built as part of the petalinux-build/petalinux-build -c


fsboot works for all the cores. XSDB is needed to flash the FS-Boot on all the cores. The
following is an example for four cores. xsdb > ta lists all the available cores. To boot your
target with SMP support, follow these steps:

<plnx-tool>/tools/xsct/bin/xsdb
xsdb > connect -url <target-url>
xsdb > fpga -f <plnx-proj-root>/images/linux/system.bit
xsdb > ta
xsdb > ta <core number>
xsdb > dow -f <plnx-proj-root>/images/linux/fs-boot.elf
the above two steps for all available cores.
xsdb > dow -f <plnx-proj-root>/images/linux/u-boot.elf
xsdb > dow -f <plnx-proj-root>/images/linux/image.ub

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 212
Appendix E: QEMU Virtual Networking Modes

Appendix E

QEMU Virtual Networking Modes


There are two execution modes in QEMU: non-root (default) and root requires sudo or root
permission. The difference in the modes relates to virtual network configuration.

• Non-Root Mode: QEMU sets up an internal virtual network which restricts network traffic
passing from the host and the guest. This works similar to a NAT router. You can not access
this network unless you redirect tcp ports.

• Root Mode: QEMU creates a subnet on a virtual Ethernet adapter, and relies on a DHCP
server on the host system.

The following sections detail how to use the modes, including redirecting the non-root mode so
it is accessible from your local host.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 213
Appendix F: AMD IP Models Supported by QEMU

Appendix F

AMD IP Models Supported by QEMU


Note: By default, QEMU disables any devices for which there is no model available. For this reason it is not
possible to use QEMU to test your own customized IP cores (unless you develop C/C++ models for them
according to QEMU standard).

For more information on AMD IP models supported by QEMU, see Quick Emulator User Guide:
QEMU.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 214
Appendix G: Xen Zynq UltraScale+ MPSoC and Versal Adaptive SoC Example

Appendix G

Xen Zynq UltraScale+ MPSoC and


Versal Adaptive SoC Example
This section details on the Xen AMD Zynq™ UltraScale+™ MPSoC and AMD Versal™ adaptive
SoC example. It describes how to get Linux to boot as dom0 on top of Xen on Zynq UltraScale+
MPSoC and Versal adaptive SoC.

Prerequisites
This section assumes that the following prerequisites are satisfied:

• You have PetaLinux tools software platform ready for building a Linux system customized to
your hardware platform. For more information, see Importing Hardware Configuration.
• You have created a PetaLinux project from the reference BSP.
• There are DOM0 Xen related prebuilts in the pre-built/linux/xen directory, which are
xen.dtb, xen-openamp.dtb, xen-qemu.dtb, xen-Image, and xen-rootfs.cpio.gz.

Boot Prebuilt Linux as dom0


1. Copy the prebuilt Xen images to your TFTP directory so that you can load them from U-Boot
with TFTP.
cd <plnx-proj-root>
cp pre-built/linux/xen/xen.dtb <tftpboot>/
cp pre-built/linux/xen/xen-openamp.dtb <tftpboot>/
cp pre-built/linux/xen/xen-qemu.dtb <tftpboot>/
cp pre-built/linux/xen/xen-Image <tftpboot>/
cp pre-built/linux/xen/xen-rootfs.cpio.gz <tftpboot>/
cp pre-built/linux/xen/xen_boot_tftp.scr <tftpboot>/
cp pre-built/linux/xen/xen_boot_sd.scr <tftpboot>/
cp pre-built/linux/xen/xen <tftpboot>/

2. Boot the prebuilt U-Boot image on the board with either JTAG boot or boot from SD card.
Note: For SD card boot, see Booting PetaLinux Image on Hardware with an SD Card and for JTAG
boot, see Booting PetaLinux Image on Hardware with JTAG.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 215
Appendix G: Xen Zynq UltraScale+ MPSoC and Versal Adaptive SoC Example

3. Setup TFTP server IP from U-Boot:


platform> setenv serverip <TFTP SERVERIP>

4. Load Xen images from U-Boot.


• TFTP Boot: xen_boot_tftp.scr, to be loaded at address 0xC00000 as shown:
tftpb 0xC00000 xen_boot_tftp.scr; source 0xC00000

• SD Boot: xen_boot_sd.scr, to be loaded at address 0xC00000 as shown:


load mmc 0:1 0xC00000 xen_boot_sd.scr; source 0xC00000

Rebuild Xen
After creating a PetaLinux project for Zynq UltraScale+ MPSoC and AMD Versal™ adaptive SoC,
follow the steps to build Xen images:

1. Go to cd <proj root directory>.


2. In the petalinux-config command, select Image Packaging Configuration → Root
filesystem type (INITRD).
3. In petalinux-config -c rootfs, select PetaLinux Package Groups → Packagegroup-
petalinux-xen → [*] packagegroup-petalinux-xen.
Note: If you enable Xen when /switch_root is enabled, you see build failures as Xen only supports
ramfs boot. ext4-based boot is enable if you enable switch_root. To resolve the issue, change the
previous config to petalinux-image-minimal from petalinux-initramfs-image.

4. Enable the following configuration to add the xen.dtsi file into system.dtb petalinux-config →
DTG Settings → Enable Xen dtsi
5. Select the xen rootfs packages or package groups.
6. Run petalinux-build.
7. The build artifacts are in images/linux in the project directory.

Note: By default, the petalinux-build command does not build Xen. The default root file system does
not contain the Xen tools. You have to use Xen RootFS.

IMPORTANT! You are required to update dom0 memory in xen-bootargs in the xen.dtsi file based on
the image/RootFS size. Also, adjust the previous load addresses based on the image/RootFS size without
overlapping.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 216
Appendix G: Xen Zynq UltraScale+ MPSoC and Versal Adaptive SoC Example

Boot Built Linux as dom0


1. Copy built Xen images to your TFTP directory so that you can load them from U-Boot with
TFTP.
cd <plnx-proj-root>
cp images/linux/system.dtb <tftpboot>/
cp images/linux/Image <tftpboot>/
cp images/linux/xen_boot_tftp.scr <tftpboot>/
cp images/linux/xen_boot_sd.scr <tftpboot>/
cp images/linux/xen <tftpboot>/
cp images/linux/rootfs.cpio.gz <tftpboot>/

2. Boot built U-Boot image on the board with either JTAG boot or boot from SD card.
Note: For SD card boot, see Booting PetaLinux Image on Hardware with an SD Card and for JTAG
boot, see Booting PetaLinux Image on Hardware with JTAG.

Note: You can also point external built images for dom1 and dom2 to the domU kernels in the
configuration, so that Xen boot script is updated with the images that are being pointed. Example to
edit the configuration file and build xen boot script as follows:

vi images/linux/xen.cfg
export XEN_CONFIG="<Absolute path for xen.cfg>"
export XEN_CONFIG_SKIP="1"
export BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS
XEN_CONFIG XEN_CONFIG_SKIP"
petalinux-build -c kernel -x do_deploy

Note: Xen boot files are generated in the <plnx-proj-root>/images/linux folder.

3. Setup TFTP server IP from U-Boot:


Platform> setenv serverip <TFTP SERVERIP>

Note: Platform refers to AMD Versal™ or AMD Zynq™ UltraScale+™ MPSoC.

4. Load Xen images from U-Boot:


• TFTP Boot: xen_boot_tftp.scr, to be loaded at address 0xC00000 as shown::
tftpb 0xC00000 xen_boot_tftp.scr; source 0xC00000

• SD Boot: xen_boot_sd.scr, to be loaded at address 0xC00000 as shown:


load mmc 0:1 0xC00000 xen_boot_sd.scr; source 0xC00000

Note: For more information, see http://www.wiki.xilinx.com/XEN+Hypervisor.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 217
Appendix H: Booting Prebuilt OpenAMP

Appendix H

Booting Prebuilt OpenAMP


Use the following steps to execute OpenAMP:

To boot prebuilt Linux for AMD Versal™ adaptive SoC, follow these steps:

1. Generate BOOT.BIN for Versal adaptive SoC.


petalinux-package boot --plm pre-built/linux/images/plm.elf --psmfw pre-
built/linux/images/psmfw.elf --dtb pre-built/linux/images/openamp.dtb --
u-boot -o pre-built/linux/images/BOOT.BIN --force.

2. Boot Linux
petalinux-boot jtag --prebuilt 3 --hw_server-url <hostname:3121>

To boot prebuilt Linux for AMD Zynq™ UltraScale+™ MPSoC, follow these steps:

cd <plnx-proj-root>
cp pre-built/linux/images/openamp.dtb pre-built/linux/images/system.dtb
petalinux-boot --jtag --prebuilt 3 --hw_server-url <hostname:3121>

Once Linux is booted, run the following commands for Versal devices only:

1. modprobe virtio_rpmsg_bus
2. modprobe zynqmp_r5_remoteproc

To load OpenAMP firmware and run OpenAMP test application, run the following command:

echo <echo_test_firmware> > /sys/class/remoteproc/remoteproc0/firmware

For example, to load image_echo_test, run:

echo image_echo_test > /sys/class/remoteproc/remoteproc0/firmware


echo start > /sys/class/remoteproc/remoteproc0/state
echo_test
echo stop > /sys/class/remoteproc/remoteproc0/state

To stop running, run the following command:

echo stop > /sys/class/remoteproc/remoteproc0/state

For more examples, see Libmetal and OpenAMP for Zynq Devices User Guide (UG1186).

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 218
Appendix I: Partitioning and Formatting an SD Card

Appendix I

Partitioning and Formatting an SD


Card
For partitioning and formatting an SD card, the following tools are required:

• fdisk
• mkfs

The steps and logs for partitioning are as follows:

• sudo fdisk /dev/sdb


Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

• Command (m for help): n


Partition type
○ p primary (0 primary, 0 extended, 4 free)

○ e extended (container for logical partitions)

• Select (default p): p


Partition number (1-4, default 1):
First sector (2048-62333951, default 2048):

• Last sector, +sectors or +size{K,M,G,T,P} (2048-62333951, default


62333951): 21111220
Creates a new partition 1 of type 'Linux' and of size 10.1 GB. Partition #1 contains a vfat
signature.
• Do you want to remove the signature? [Y]es/[N]o: y
The signature is removed by a write command.
• Command (m for help): n
Partition type
○ p primary (1 primary, 0 extended, 3 free)

○ e extended (container for logical partitions)

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 219
Appendix I: Partitioning and Formatting an SD Card

• Select (default p): p


Partition number (2-4, default 2):
First sector (21111221-62333951, default 21112832):
Last sector, +sectors or +size{K,M,G,T,P} (21112832-62333951, default
62333951):
Created a new partition 2 of type 'Linux' and of size 19.7 GB.

• Command (m for help): w


The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
Steps and log for formatting:

• sudo mkfs.vfat /dev/sdb1


mkfs.fat 4.1 (2017-01-24)
• sudo mkfs.ext4 /dev/sdb2
mke2fs 1.44.1 (24-Mar-2018)
Creating file system with 5152640 4k blocks and 1289280 inodes
File system UUID: ad549f34-ee6e-4efc-ab03-fba390e98ede
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and file system accounting information: done

• SD EXT ROOTFS BOOT:

Mount the fat partition and copy BOOT.BIN, boot.scr, Image, and
system.dtb files on it.
Mount the EXT partition and untar rootfs.tar.gz to it.
Finally unmount the SD card and use it for booting.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 220
Appendix J: Auto-mounting an SD Card

Appendix J

Auto-mounting an SD Card
Auto-mounting an SD Card during the Build

To auto-mount an SD card during the build, follow the instructions here: How to Auto Mount SD
card in Yocto Recipes.

Auto-mounting SD Partitions after Linux is Running

To mount the SD partitions to a user-defined path, follow these steps:

1. Boot the target to the Linux prompt.


2. Create the direct path, for example:
mkdir /media/card

3. Edit the file as follows:


vim /etc/fstab

Once the editor opens, add the following line:


/dev/mmcblk0p2 /media/card ext4 defaults 0 1 4

Save and exit.


reboot

4. Check the SD mount point using the mount command:


root:16:12:48:~# mount
mount
/dev/mmcblk0p2 on / type ext4 (rw,relatime)
devtmpfs on /dev type devtmpfs
(rw,relatime,size=504544k,nr_inodes=126136,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
securityfs on /sys/kernel/security type securityfs
(rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=666)
tmpfs on /run type tmpfs
(rw,nosuid,nodev,size=407068k,nr_inodes=819200,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs
(ro,nosuid,nodev,noexec,size=4096k,nr_inodes=1024,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2
(rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup
(rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 221
Appendix J: Auto-mounting an SD Card

cgroup on /sys/fs/cgroup/pids type cgroup


(rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup
(rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/cpuset type cgroup
(rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup
(rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/freezer type cgroup
(rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/perf_event type cgroup
(rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/memory type cgroup
(rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/blkio type cgroup
(rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/debug type cgroup
(rw,nosuid,nodev,noexec,relatime,debug)
cgroup on /sys/fs/cgroup/devices type cgroup
(rw,nosuid,nodev,noexec,relatime,devices)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs
(rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,nr_inodes=1048576)
nfsd on /proc/fs/nfsd type nfsd (rw,relatime)
configfs on /sys/kernel/config type configfs
(rw,nosuid,nodev,noexec,relatime)
ramfs on /run/credentials/systemd-sysusers.service type ramfs
(ro,nosuid,nodev,noexec,relatime,mode=700)
tmpfs on /var/volatile type tmpfs (rw,relatime)
/dev/mmcblk0p1 on /boot type vfat
(rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,short
name=mixed,errors=remount-ro)
/dev/sda on /run/media/sda type vfat
(rw,relatime,gid=6,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,io
charset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sdb on /run/media/sdb type vfat
(rw,relatime,gid=6,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,io
charset=iso8859-1,shortname=mixed,errors=remount-ro)
tmpfs on /run/user/1000 type tmpfs
(rw,nosuid,nodev,relatime,size=203532k,nr_inodes=50883,mode=700,uid=1000,
gid=1000)

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 222
Appendix K: Deprecated BSP Support

Appendix K

Deprecated BSP Support


This section elaborates on migrating the existing BSP to develop the deprecated BSP and
creating a BSP hardware design. The following are the BSPs are deprecated from 2024.1 and
onward releases.

• Zynq
○ xilinx-zc706

• ZynqMP
○ xilinx-zcu111

• Versal

○ xilinx-vmk180-emmc

○ xilinx-vmk180-opsi

• MicroBlaze
○ xilinx-kc705

○ xilinx-kcu105

○ xilinx-ac701

○ xilinx-vcu118

• BSP hardware designs are created using the Vivado board files and configurable example
design(CED).
○ https://github.com/Xilinx/XilinxCEDStore/wiki/Accessing-the-Vivado-Examples-Store-
Repository
• Step to migrate the existing BSP to support the deprecated BSPs are outlined in every BSP
"README" file in section "Steps to migrate BSP < BSP name>". User should extract the
existing BSP to follow migration steps from README file

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 223
Appendix K: Deprecated BSP Support

Table 42: Deprecated BSP to Existing BSP Mapping

Deprecated BSP Exiting BSP to be used


xilinx-zc706 xilinx-zc701
xilinx-zcu111 xilinx-zcu208

xilinx-vmk180-emmc xilinx-vmk180
xilinx-vmk180-opsi xilinx-vmk180
xilinx-kc705 xilinx-sp701
xilinx-kcu105 xilinx-sp701
xilinx-ac701 xilinx-sp701
xilinx-vcu118 xilinx-sp701

• YOCTO_MACHINE and YOCTO_INCLUDE_MACHINE for all the deprecated are mentioned in


the section Machine Support

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 224
Appendix L: PetaLinux Commands

Appendix L

PetaLinux Commands
There are eight independent commands that make up the PetaLinux design flow. They are:

• petalinux-create
• petalinux-config
• petalinux-build
• petalinux-boot
• petalinux-package
• petalinux-util
• petalinux-upgrade
• petalinux-devtool

In most cases, the PetaLinux commands are flexible such that the specific options passed to the
tools present you with a unique use model, compared to other options for the same tool.

For the purposes of this document, command line arguments that behave as modifiers for
workflows are referred to as "options." User-specified values that are accepted by options are
shown in italics. In some cases, omitting the user-specified value might result in a built-in default
behavior. See the "Default Value" column in the tables for details about relevant default values.

petalinux-create
The petalinux-create tool creates objects that are part of a PetaLinux project. This tool
provides two separate workflows. In the petalinux-create project workflow, the tool
creates a new PetaLinux project directory structure. In the petalinux-create COMPONENT
workflow, the tool creates a component within the specified project.

These workflows are executed with petalinux-create project or petalinux-create


COMPONENT, respectively.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 225
Appendix L: PetaLinux Commands

petalinux-create Command Line Options


The following table details the command line options that are common to all petalinux-
create workflows.

Table 43: petalinux-create Command Line Options

Option Functional Description Value Range Default Value


SubCommand Specify the TYPE of object to create. This is • project None
required.
• apps
• modules
-n,--name NAME Create object with the specified NAME. This is User-specified When creating a
optional when creating a project from a BSP project from a BSP
source. Otherwise, this is required. source, the project
takes the name of
the source BSP.

-f , --force Overwrite existing files on disk. This is optional. None None


-h,--help Display usage information. This is optional. None None

petalinux-create project
The petalinux-create project command creates a new PetaLinux project at the specified
location with a specified name. If the specified location is on the Network File System (NFS), it
changes the TMPDIR automatically to /tmp/<projname_timestamp>. If /tmp/
<projname_timestamp> is also on NFS, it throws an error. You can change the TMPDIR
through petalinux-config. Do not configure the same location as TMPDIR for two different
PetaLinux projects, as this can cause build errors.

petalinux-create project Options


The following table details options used when creating a project. These options are mutually
exclusive, and one of them must be used when creating a new project.

Table 44: petalinux-create project Options

Option Functional Description Value Range Default Value


--template TEMPLATE Assumes the specified CPU • microblaze None
architecture, and is only required
when --source is not provided. • zynqMP
• zynq
• versal
-s,--source SOURCE Creates project based on User-specified None
specified BSP file. SOURCE is the
full path on disk to the BSP file.
This is optional.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 226
Appendix L: PetaLinux Commands

Table 44: petalinux-create project Options (cont'd)

Option Functional Description Value Range Default Value


--tmpdir TMPDIR Specify the local drive path as User-specified None
TMPDIR location when creating
project.
Default TMPDIR cannot be under
NFS. By default.
PetaLinux sets the TMPDIR
under /tmp when project is on
NFS.
You can set your own local drive
as TMPDIR PATH using --tmpdir
option.

Note: For AMD boards, the -s, --source BSP flows are suggested. For custom boards, the --template
flow is required.

petalinux-create project Examples


The following examples demonstrate proper usage of the petalinux-create project
command.

• Create a new project from a reference BSP file:


petalinux-create project -s <PATH-TO-BSP>

• Create a new project based on the MicroBlaze™ processor template:


petalinux-create project -n <NAME> --template microblaze

• Create a project from the PetaLinux project BSP and specify the TMPDIR PATH:
petalinux-create project -s <PATH_TO_PETALINUX_PROJECT_BSP> --tmpdir
<TMPDIR PATH>

• Create a project from a template and specify the TMPDIR PATH:


petalinux-create project -n <PROJECT> --template <TEMPLATE> --tmpdir
<TMPDIR PATH>

By default, the directory structure created by --template is minimal, and is not useful for
building a complete system until initialized using the petalinux-config --get-hw-
description command. Projects created using a BSP file as their source are suitable for
building immediately.

petalinux-create apps/modules
The petalinux-create apps/modules command allows you to create various components
within the specified PetaLinux project. These components can be selectively included or
excluded from the final system by toggling them using the petalinux-config -c rootfs
workflow.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 227
Appendix L: PetaLinux Commands

petalinux-create apps Options


The petalinux-create apps command allows you to customize how application
components are created. The following table details options that are common when creating
applications within a PetaLinux project

Table 45: petalinux-create apps Options

Default
Option Functional Description Value Range
Value
--template TEMPLATE Create the component using a pre- • c c
defined application template. This
is optional. • c++
• autoconf
• dfx_user_dts
• dfx_dtg_zynq_full
• dfx_dtg_zynqmp_full
• dfx_dtg_versal_full
• dfx_dtg_zynqmp_static
• dfx_dtg_zynqmp_partial
• dfx_dtg_versal_static
• dfx_dtg_versal_partial
• install
--enable Upon creating the component, None Disabled
enable it in the project’s root file
system. You can also enable using
the petalinux-config -c
rootfs. This is optional.

--srcuri Creates an application with local None None


sources or from remote source.

petalinux-create apps/modules Examples


The following examples demonstrate proper usage of the petalinux-create apps/
modules command.

• Create an application component that is enabled in the root file system.


petalinux-create apps -n <NAME> --template <template> --enable

• Create a new install-only application component. In this flow, nothing is compiled.


petalinux-create apps -n <NAME> --template install

• Create a new kernel module and enable it.


petalinux-create modules -n <name> --template <template> --enable

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 228
Appendix L: PetaLinux Commands

• Create an application with multiple source files.


petalinux-create apps --template install --name mylibs --srcuri "<path-to-
dir>/mylib1.so <path-to-dir>/mylib2.so"

• Create an app with remote sources. The following examples create applications with specified
git/http/https pointing to the srcuri.
petalinux-create apps -n myapp --enable --srcuri http://example.tar.gz

petalinux-create apps -n myapp --enable --srcuri git://example.git


\;protocol=https

petalinux-create apps -n myapp --enable --srcuri https://example.tar.gz

Note: This is applicable for applications and modules.

petalinux-config
The petalinux-config tool allows you to customize the specified project. This tool provides
two separate workflows. In the petalinux-config --get-hw-description workflow, a
project is initialized or updated to reflect the specified hardware configuration. In the
petalinux-config -c COMPONENT workflow, the specified component is customized using
a menuconfig interface.

petalinux-config Command Line Options


The following table details the available options for the petalinux-config tool.

Table 46: petalinux-config Command Line Options

Option Functional Description Value Range Default Value


-p, --project <path to Specifies path to the project to be User-specified Current Directory
project directory> configured.
--get-hw-description Initializes or updates the hardware User-specified Current Directory
<DIR containing configuration for the PetaLinux project.
XSA>/--get-hw- Mutually exclusive with -c. This is
description=<DIR required.
containing XSA>/--get-
hw-description=<PATH-
TO-XSA>

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 229
Appendix L: PetaLinux Commands

Table 46: petalinux-config Command Line Options (cont'd)

Option Functional Description Value Range Default Value


-c,--component Configures the specified system • kernel None
COMPONENT component. Mutually exclusive with --
get-hw-description. This is • rootfs
required. • u-boot
• bootloader (for AMD
Zynq™ UltraScale+™
MPSoC, Zynq
architecture, and
MicroBlaze™ CPU)
• pmufw, for Zynq
UltraScale+ MPSoC only
• device-tree
• plm, for AMD Versal™
adaptive SoC
• psmfw, for Versal
adaptive SoC
--silentconfig Allows you to restore a prior None None
configuration. Example:
Execute the following command after
enabling or disabling different configs
by editing <proj-root>/project-
spec/configs/config
$ petalinux-config --
silentconfig
-v,--verbose Displays additional output messages. None None
This is optional.
-h,--help Displays tool usage information. This is None None
optional.

petalinux-config --get-hw-description
The petalinux-config --get-hw-description command allows you to initialize or
update a PetaLinux project with hardware-specific information from the specified AMD Vivado™
Design Suite hardware project. The components affected by this process can include FSBL
configuration, U-Boot options, Linux kernel options, and the Linux device tree configuration. This
workflow should be used carefully to prevent accidental and/or unintended changes to the
hardware configuration for the PetaLinux project. The path used with this workflow is the
directory that contains the XSA file rather than the full path to the XSA file itself. This entire
option can be omitted if run from the directory that contains the XSA file.

petalinux-config --get-hw-description Examples


The following examples demonstrate proper usage of the petalinux-config --get-hw-
description command.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 230
Appendix L: PetaLinux Commands

• Initialize a PetaLinux project within the project directory with an external XSA.
petalinux-config --get-hw-description <PATH-TO-XSA DIRECTORY>/--get-hw-
description=<PATH-TO-XSA DIRECTORY>/--get-hw-description=<PATH-TO-XSA>

• Initialize a PetaLinux project from within the directory containing an XSA.


petalinux-config --get-hw-description -p <PATH-TO-PETALINUX-PROJECT>

• Initialize a PetaLinux project from a neutral location.


petalinux-config --get-hw-description <PATH-TO-XSA DIRECTORY>/--get-hw-
description=<PATH-TO-XSA DIRECTORY>/--get-hw-description=<PATH-TO-XSA> -p
<PATH-TO-PETALINUX-PROJECT>

petalinux-config -c COMPONENT
The petalinux-config -c COMPONENT command allows you to use a standard menuconfig
interface to control how the embedded Linux system is built, and also generates the source code
for embedded software applications. When petalinux-config is executed with no other
options, it launches the system-level or "generic" menuconfig. This interface allows you to specify
the information, such as the desired boot device, or metadata about the system, such as the
default hostname. The petalinux-config -c kernel, petalinux-config -c u-boot,
and petalinux-config -c rootfs workflows launch the menuconfig interfaces for
customizing the Linux kernel, U-Boot, and the root file system, respectively.

The --silentconfig option allows you to restore a prior configuration.

Example:

Execute the following command after enabling or disabling different configs by editing <proj-
root>/project-spec/configs/rootfs_config

petalinux-config -c rootfs --silentconfig

Use this command to use the existing configurations without editing. In this case, the menuconfig
is not launched.

petalinux-config -c COMPONENT Examples


The following examples demonstrate proper usage of the petalinux-config -c
COMPONENT command:

• Start the menuconfig for the system-level configuration.


petalinux-config

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 231
Appendix L: PetaLinux Commands

• Enable different rootfs packages without opening the menuconfig. Execute the following
command after enabling or disabling different packages by editing <proj-root>/project-
spec/configs/rootfs_config
petalinux-config -c rootfs --silentconfig

The following warning message appears when petalinux-config or petalinux-build for


components (for example: petalinux-build -c u-boot) is run. This message can be
ignored.

WARNING! SRC_URI is conditionally overridden in this recipe. Thus several devtool-override-* branches
are created, one for each override that makes changes to SRC_URI. It is recommended that you make
changes to the devtool branch first, checkout, and rebase each devtool-override-* branch and update any
unique patches there (duplicates on those branches are ignored by devtool finish/update-recipe).

petalinux-build
The petalinux-build tool builds either the entire embedded Linux system or a specified
component of the Linux system. This tool uses the Yocto Project underneath. Whenever
petalinux-build is invoked, it internally calls bitbake. While the tool provides a single
workflow, the specifics of its operation can be dictated using the petalinux-build -c and
petalinux-build -x options.

petalinux-build Command Line Options


The following table outlines the valid options for the petalinux-build tool.

Table 47: petalinux-build Command Line Options

Option Functional Description Value Range Default Value


-p,--project PROJECT PetaLinux project directory path. This is User-specified None
optional.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 232
Appendix L: PetaLinux Commands

Table 47: petalinux-build Command Line Options (cont'd)

Option Functional Description Value Range Default Value


-c, --component Builds specified component. These are • bootloader (AMD Zynq™ None
COMPONENT the default values which are UltraScale+™ MPSoC,
supported. You can build against your Zynq architecture, and
own target (such as your application or MicroBlaze™ CPU)
module). This is optional.
• kernel
• u-boot
• rootfs
• pmufw, only for Zynq
UltraScale+ MPSoC
• arm-trusted-firmware,
for Zynq UltraScale+
MPSoC and AMD
Versal™ adaptive SoC.
• device-tree
• plm, only for Versal
adaptive SoC
• psmfw, only for Versal
adaptive SoC
• apps
• modules
-x, --execute STEP Executes specified build step. All Yocto • build Build
tasks can be passed through this
option. To get all tasks of a component, • clean
use “listtasks”. This is optional. • cleanall
• cleansstate
• distclean
• install
• listtasks
• populate_sysroot
• package
• mrproper
-v,--verbose Displays additional output messages. None None
This is optional.
-s, --sdk Builds Yocto SDK. This is optional. None None
--esdk Builds Yocto e-SDK.This is optional. None Nnone
-h Lists all the sub-components of a rootfs None
component. Valid only for rootfs. This
is optional.
-f, --force Forces a specific task to run against a None None
component, or a single task in the
component, ignoring the stamps. This
is optional.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 233
Appendix L: PetaLinux Commands

petalinux-build --component
The petalinux-build -c option builds the specified component of the embedded system.
When no components are specified, the petalinux-build tool operates on the project as a
whole. User-created components for the root file system can be built by targeting those
components by name (for example, with -c <APP-NAME>). This is equivalent to bitbake
<COMPONENT>. Each recipe can be specified as a component for petalinux-build -c
<component>. The component can be a user created app or package/package group in the root
filesystem.

The petalinux-build command with no arguments runs bitbake petalinux-user-


image internally. The default image target is petalinux-image-minimal. There is no
restriction on the components, and you can build your own packages. For the names of the
packages, search in petalinux-config -c rootfs.

An example to build base-files is as follows:

petalinux-build -c base-files

petalinux-build -c component options


The following table summarizes the available components that can be targeted with this
command:

Table 48: petalinux-build -c Components

Equivalent Bitbake
Component Description
Commands
bootloader bitbake virtual/fsbl Build only the boot loader elf image and copy it into <plnx-
bitbake virtual/fsboot (for proj-root>/images/linux/. For AMD Zynq™ UltraScale+™
MicroBlaze™ processor) MPSoC and Zynq 7000 devices, it is FSBL and for MicroBlaze™
processor, it is fs-boot.
device tree bitbake virtual/dtb Build only the device tree DTB file and copy it into <plnx-proj-
root>/images/linux/.
The device tree source is in <plnx-proj-root>/components/
plnx_workspace/device-tree/device-tree/.

arm-trusted- bitbake virtual/arm- Build only the TF-A image and copy it into <plnx-proj-root>/
firmware trusted-firmware images/linux.

pmufw bitbake virtual/pmufw Build only the PMU firmware image and copy it into <plnx-
proj-root>/images/linux.

kernel bitbake virtual/kernel Build only the Linux kernel image and copy it into <plnx-proj-
root>/images/linux.

rootfs bitbake petalinux-user- Build only the root file system. It generates the target rootfs in $
image -c {TMPDIR}/work/${MACHINE}/petalinux-user-image/
do_image_complete 1.0-r0/rootfs/ and the sysroot in ${TMPDIR}/tmp/
sysroots/${MACHINE}.

u-boot bitbake virtual/ Build only the U-Boot elf image and copy it into <plnx-proj-
bootloader root>/images/linux.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 234
Appendix L: PetaLinux Commands

Table 48: petalinux-build -c Components (cont'd)

Equivalent Bitbake
Component Description
Commands
plm virtual/plm Build only the PLM image and copy it into <plnx-proj-root>/
images/linux.

psmfw virtual/psm-firmware Build only the PSM firmware image and copy it into <plnx-
proj-root>/image/linux.

image selector imgsel Build only the Image Selector firmware image and copy it into
<plnx-proj-root>/image/linux.

petalinux-build --execute
The petalinux-build -x option allows you to specify a build step to the petalinux-
build tool to control how the specified components are manipulated. The Yocto task name has
a do_ prefixed to the petalinux-build step. All Yocto tasks can be passed through this
option. To get all tasks of a component, use listtasks.

Commands for petalinux-build -x


The following table summarizes some of the available commands that can be used with this
option:

Table 49: petalinux-build -x options

Component Description
clean Cleans build data for the target component.
cleansstate/ Removes the shared state cache of the corresponding component.
distclean
cleanall Removes the downloads and shared state cache. Cleans the work directory of a component.
mrproper Cleans the build area. This removes the <plnx-proj-root>/build/, <TMPDIR>, and <plnx-
proj-root>/images/ directories. This is the recommended way of cleaning the entire project.
build Builds the target component.
install Installs the target component. For bootloader, TF-A, Linux kernel, U-Boot, and device tree, it
copies the generated binary into <plnx-proj-root>/images/linux/. For the root file system
and root file system component, it copies the generated binary to target the root file system
host copy ${TMPDIR}/work/${MACHINE}/petalinux-user-image/1.0-r0/rootfs/.
package Generates FIT image image.ub from build area and copies it into <plnx-proj-root>/
images/linux/. Valid for -c all or when no component is specified only.
listtasks Gets all tasks of a specific component.

petalinux-build Examples
The following examples demonstrate proper usage of the petalinux-build command.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 235
Appendix L: PetaLinux Commands

• Clear the build area of the PetaLinux project for archiving as a BSP or for revision control. This
example retains the images directory of the project.
petalinux-build -x distclean

• Clean all build collateral from the U-Boot component of the PetaLinux project.
petalinux-build -c u-boot -x cleansstate

• Clean all build collateral. It removes build/, ${TMPDIR} and images. This brings the project to
its initial state.
petalinux-build -x mrproper

• Create an updated FIT image from the current contents of the deploy area.
petalinux-build -x package

• Build the entire PetaLinux project.


petalinux-build

• Build the kernel forcefully by ignoring the stamps (output of tasks from last successful build).
petalinux-build -c kernel -f

• Compile kernel forcefully by ignoring do_compile task stamp.


petalinux-build -c kernel -x compile -f

• Build the eSDK and copy it to <proj_root>/images/linux/esdk.sh


petalinux-build --esdk

• Pack all the components of petalinux-build.


petalinux-build --archiver

• Pack only the sysroot components.


petalinux-build --sdk --archiver

Note: You can find the archiver tar in <plnx-proj-root>/images/linux.

petalinux-boot
The petalinux-boot command boots MicroBlaze™ CPU, AMD Zynq™ devices, AMD Versal™
adaptive SoC, and AMD Zynq™ UltraScale+™ MPSoC with PetaLinux images through JTAG/
QEMU. This tool provides two distinct workflows:

• In petalinux-boot jtag workflow, images are downloaded and booted on a physical


board using a JTAG cable connection.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 236
Appendix L: PetaLinux Commands

• In petalinux-boot qemu workflow, images are loaded and booted using the QEMU
software emulator.

Either the jtag or the qemu is mandatory for the petalinux-boot tool. By default, the
petalinux-boot tool loads binaries from the <plnx-proj-root>/images/linux/
directory.

petalinux-boot Command Line Options


The following table details the command line options that are common to all petalinux-boot
workflows.

Table 50: petalinux-boot Command Line Options

Option Functional Description Value Range Default Value


jtag Use the JTAG workflow. Mutually None None
exclusive with the QEMU
workflow. One of the two, jtag or
qemu is required.
qemu Use the QEMU workflow. Mutually None None
exclusive with the JTAG workflow.
One of the two, jtag or qemu is
required.
-D, -v,--verbose, -- Displays additional output None None
debug messages. This is optional.
-h,--help Displays tool usage information. None None
This is optional.

petalinux-boot jtag
The petalinux-boot jtag command boots the MicroBlaze™ CPUs, the AMD Zynq™
UltraScale+™ MPSoCs, Zynq 7000 devices, or AMD Versal™ adaptive SoCs with a PetaLinux
image using a JTAG connection.

Note: The petalinux-boot jtag command might not work as expected when executed within a virtual
machine because virtual machines often have problems with JTAG cable drivers.

petalinux-boot jtag Options


The following table contains details of options specific to the JTAG boot workflow.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 237
Appendix L: PetaLinux Commands

Table 51: petalinux-boot jtag Options

Option Functional Description Value Range Default Value


--prebuilt Boot a prebuilt image. This is optional. • 1 (bitstream / None
FSBL)
• 2 (U-Boot)
• 3 (Linux kernel)
Note: 1 is not a
valid option for the
QEMU workflow.
--u-boot This option can be use to download User-specified <plnx-proj-root>/
specified U-Boot binary along with images/linux/u-
dependent files to boot into the U- boot.elf
Boot. It selects an U-Boot ELF image
from <plnx-proj-root>/images/
linux/. This is optional.
--kernel This option can be use to download User-specified • zImage for AMD Zynq™
specified kernel binary along with 7000 devices
dependent files to boot kernel. This
option picks the kernel image from • Image for AMD Zynq™
<plnx-proj-root>/images/ UltraScale+™ MPSoC, and
linux/. This is optional. AMD Versal™ adaptive
SoC
• image.elf for
MicroBlaze™ CPU
The default image is in
<plnx-proj-root>/
images/linux.
--xsdb-connect COMMAND Customized XSDB connection User-specified None
command to run prior to boot. This is
optional.
--hw_server-url URL URL of the hw_server to connect to. User-specified None
This is optional.
--tcl OUTPUTFILE Log JTAG Tcl commands used for boot. User-specified None
This is optional.
--fpga Program FPGA bitstream. This is None If no bitstream is specified
optional. with the --bitstream
option, it uses the bitstream
from one of the following
locations:

• If you are using build


images to boot, it picks
the bitstream from
<plnx-proj-root>/
images/linux/
system.bit

• If you are using prebuilt


images to boot, it picks
the bitstream pick
<plnx-proj-root>/
prebuilt/linux/
implementation/
download.bit

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 238
Appendix L: PetaLinux Commands

Table 51: petalinux-boot jtag Options (cont'd)

Option Functional Description Value Range Default Value


before-connect <CMD> Extra command to run before XSDB None None
connect command. Ensure the
command is properly quoted in your
shell. This is optional and can be used
multiple times.
after-connect <CMD> Extra commands to run after XSDB None None
connect command. Ensure the
command is properly quoted in your
shell. This is optional and can be used
multiple times.
--rootfs Specify the cpio rootfile system needs User-specified <plnx-proj-root>/images/
to be used for jtag boot. Supports for: linux/rootfs.cpio.gz.u-boot
Zynq, Zynq UltraScale+ MPSoC, Versal,
and MicroBlaze.

petalinux-boot jtag Examples


Select the images for loading on target from the following:

1. Prebuilt directory: <plnx-proj-root>/pre-built/linux/images. These are prebuilt


images packed along with the BSP.
2. Images directory: <plnx-proj-root>/images/linux. These are the images built by the
user.

The following examples demonstrate some use-cases of the petalinux-boot jtag


command.

• Download bitstream and FSBL for Zynq 7000 devices, and FSBL and PMU firmware for Zynq
UltraScale+ MPSoC
petalinux-boot jtag --prebuilt 1

Note: Images are taken from <plnx-proj-root>/pre-built/linux/images directory.

• Boot U-Boot on target board after loading bitstream/boot loader.


petalinux-boot jtag --prebuilt 2

Note: Images are taken from <plnx-proj-root>/pre-built/linux/images directory.

petalinux-boot jtag --u-boot --fpga

Note: Images are taken from <plnx-proj-root>/images/linux directory.

○ For MicroBlaze™ processors, the previous commands download the bitstream to the target
board, and boot the U-Boot on the target board.
○ For Zynq 7000 devices, they download the bitstream and FSBL to the target board, and
boot the U-Boot on the target board.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 239
Appendix L: PetaLinux Commands

○ For Zynq UltraScale+ MPSoC, they download the bitstream, PMU firmware, FSBL, and U-
Boot, and boot upto U-Boot on the target board.
○ For AMD Versal™ adaptive SoC, they download BOOT.BIN (which contains the PDI, PLM
firmware, PSM firmware, U-Boot, and DTB) and boot the U-Boot on the target board.
• Boot prebuilt kernel on target board after loading bitstream, boot loader, and U-Boot.
petalinux-boot jtag --prebuilt 3

Note: Images are taken from <plnx-proj-root>/pre-built/linux/images directory.

petalinux-boot jtag --kernel

Note: Images are taken from <plnx-proj-root>/images/linux directory.

• Generate debug messages while loading images:


• petalinux-boot jtag --u-boot/--kernel -v
Note: Images are taken from <plnx-proj-root>/images/linux directory.

• For JTAG boot, specify the cpio rootfile system. It supportsZynq , Zynq UltraScale+ MPSoC,
Versal, and MicroBlaze.
• Boot customized rootfs image with kernel using JTAG:
[xhd-zcu102-7] Systest# connect com0
Connecting to device com0. Use Ctrl-\ to escape.
Zynq MP First Stage Boot Loader
Release 2024.1 Feb 28 2024 - 16:59:36

U-Boot 2024.01 (Feb 28 2024 - 15:26:19 +0000)

CPU: ZynqMP
Silicon: v3
Chip: zu9eg
Model: ZynqMP ZCU102 Rev1.0
Board: Xilinx ZynqMP
DRAM: 2 GiB (effective 4 GiB)
PMUFW: v1.1
EL Level: EL2
Secure Boot: not authenticated, not encrypted
Core: 71 devices, 31 uclasses, devicetree: board
Warning: Device tree includes old 'u-boot,dm-' tags: please fix by
2023.07!
NAND: 0 MiB
MMC: mmc@ff170000: 0
Loading Environment from nowhere... OK
In: serial
Out: serial,vidconsole
Err: serial,vidconsole
Bootmode: JTAG_MODE
Reset reason: EXTERNAL
Net:
ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id

Warning: ethernet@ff0e0000 (eth0) using random MAC address -


de:32:55:d7:f6:19
eth0: ethernet@ff0e0000

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 240
Appendix L: PetaLinux Commands

scanning bus for devices...


SATA link 0 timeout.
Target spinup took 0 ms.
AHCI 0001.0301 32 slots 2 ports 6 Gbps 0x3 impl SATA mode
flags: 64bit ncq pm clo only pmp fbss pio slum part ccc apst
Device 0: (1:0) Vendor: ATA Prod.: WDC WDS250G2B0A Rev: 4010
Type: Hard Disk
Capacity: 238475.1 MB = 232.8 GB (488397168 x 512)
starting USB...
Bus usb@fe200000: Register 2000440 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus usb@fe200000 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
Hit any key to stop autoboot: 0
JTAG: Trying to boot script at 20000000
## Executing script at 20000000
Trying to load boot images from jtag
## Loading init Ramdisk from Legacy Image at 04000000 ...
Image Name: petalinux-image-minimal-xilinx-z
Created: 2011-04-05 23:00:00 UTC
Image Type: AArch64 Linux RAMDisk Image (uncompressed)
Data Size: 32030528 Bytes = 30.5 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 00100000
Booting using the fdt blob at 0x100000
Working FDT set to 100000
Loading Ramdisk to 75d53000, end 77bdef40 ... OK
Loading Device Tree to 0000000075d42000, end 0000000075d52f56 ... OK
Working FDT set to 75d42000

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]


[ 0.000000] Linux version 6.6.10-xilinx-v2024.1-ga33033bade74 (oe-
user@oe-host) (aarch64-xilinx-linux-gcc (GCC) 12.2.0, GNU ld (GNU
Binutils) 2.39.0.20220819) #1 SMP Fri Feb 23 11:02:20 UTC 2024
[ 0.000000] KASLR disabled due to lack of seed
[ 0.000000] Machine model: ZynqMP ZCU102 Rev1.0
[ 0.000000] earlycon: cdns0 at MMIO 0x00000000ff000000 (options
'115200n8')
[ 0.000000] printk: bootconsole [cdns0] enabled
[ 0.000000] efi: UEFI not found.
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x0000000000000000-0x00000000ffffffff]
[ 0.000000] Normal [mem 0x0000000100000000-0x000000087fffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x000000007fefffff]
[ 0.000000] node 0: [mem 0x0000000800000000-0x000000087fffffff]
[ 0.000000] Initmem setup node 0 [mem
0x0000000000000000-0x000000087fffffff]
[ 0.000000] On node 0, zone Normal: 256 pages in unavailable ranges
[ 0.000000] cma: Reserved 256 MiB at 0x0000000065c00000 on node -1
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.1 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] psci: SMC Calling Convention v1.4
[ 0.000000] percpu: Embedded 19 pages/cpu s37864 r8192 d31768 u77824
[ 0.000000] Detected VIPT I-cache on CPU0

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 241
Appendix L: PetaLinux Commands

[ 0.000000] CPU features: detected: ARM erratum 845719


[ 0.000000] alternatives: applying boot alternatives
[ 0.000000] Kernel command line: earlycon console=ttyPS0,115200
root=/dev/ram0 rw init_fatal_sh=1
[ 0.000000] Unknown kernel command line parameters "init_fatal_sh=1",
will be passed to user space.
[ 0.000000] Dentry cache hash table entries: 524288 (order: 10,
4194304 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152
bytes, linear)
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages:
1031940
[ 0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap
free:off
[ 0.000000] software IO TLB: area num 4.
[ 0.000000] software IO TLB: mapped [mem
0x000000007bf00000-0x000000007ff00000] (64MB)
[ 0.000000] Memory: 3728820K/4193280K available (15232K kernel code,
1044K rwdata, 4456K rodata, 2816K init, 445K bss, 202316K reserved,
262144K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=16 to
nr_cpu_ids=4.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is
25 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16,
nr_cpu_ids=4
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] GIC: Adjusting CPU interface base to 0x00000000f902f000
[ 0.000000] Root IRQ handler: gic_handle_irq
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on
contention.
[ 0.000000] arch_timer: cp15 timer(s) running at 99.99MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0x1ffffffffffffff
max_cycles: 0x170f8de2d3, max_idle_ns: 440795206112 ns
[ 0.000000] sched_clock: 57 bits at 100MHz, resolution 10ns, wraps
every 4398046511101ns
[ 0.008362] Console: colour dummy device 80x25
[ 0.012557] Calibrating delay loop (skipped), value calculated using
timer frequency.. 199.98 BogoMIPS (lpj=399960)
[ 0.022973] pid_max: default: 32768 minimum: 301
[ 0.027689] Mount-cache hash table entries: 8192 (order: 4, 65536
bytes, linear)
[ 0.034990] Mountpoint-cache hash table entries: 8192 (order: 4, 65536
bytes, linear)
[ 0.043575] cacheinfo: Unable to detect cache hierarchy for CPU 0
[ 0.049554] rcu: Hierarchical SRCU implementation.
[ 0.053689] rcu: Max phase no-delay instances is 1000.
[ 0.059273] EFI services will not be available.
[ 0.063621] smp: Bringing up secondary CPUs ...
[ 0.068371] Detected VIPT I-cache on CPU1
[ 0.068418] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[ 0.068858] Detected VIPT I-cache on CPU2
[ 0.068888] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[ 0.069283] Detected VIPT I-cache on CPU3
[ 0.069311] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[ 0.069364] smp: Brought up 1 node, 4 CPUs
[ 0.103628] SMP: Total of 4 processors activated.
[ 0.108328] CPU features: detected: 32-bit EL0 Support
[ 0.113462] CPU features: detected: CRC32 instructions

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 242
Appendix L: PetaLinux Commands

[ 0.118652] CPU: All CPU(s) started at EL2


[ 0.122687] alternatives: applying system-wide alternatives
[ 0.129950] devtmpfs: initialized
[ 0.138567] clocksource: jiffies: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.142694] futex hash table entries: 1024 (order: 4, 65536 bytes,
linear)
[ 0.155507] pinctrl core: initialized pinctrl subsystem
[ 0.155957] DMI not present or invalid.
[ 0.159444] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[ 0.165491] DMA: preallocated 512 KiB GFP_KERNEL pool for atomic
allocations
[ 0.171984] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA32 pool for
atomic allocations
[ 0.179831] audit: initializing netlink subsys (disabled)
[ 0.185306] audit: type=2000 audit(0.120:1): state=initialized
audit_enabled=0 res=1
[ 0.185741] hw-breakpoint: found 6 breakpoint and 4 watchpoint
registers.
[ 0.199789] ASID allocator initialised with 65536 entries
[ 0.205270] Serial: AMBA PL011 UART driver
[ 0.223713] Modules: 26720 pages in range for non-PLT usage
[ 0.223723] Modules: 518240 pages in range for PLT usage
[ 0.224347] HugeTLB: registered 1.00 GiB page size, pre-allocated 0
pages
[ 0.235752] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page
[ 0.242018] HugeTLB: registered 32.0 MiB page size, pre-allocated 0
pages
[ 0.248802] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page
[ 0.255068] HugeTLB: registered 2.00 MiB page size, pre-allocated 0
pages
[ 0.261853] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page
[ 0.268120] HugeTLB: registered 64.0 KiB page size, pre-allocated 0
pages
[ 0.274905] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page
[ 0.349231] raid6: neonx8 gen() 2263 MB/s
[ 0.417300] raid6: neonx4 gen() 2222 MB/s
[ 0.485359] raid6: neonx2 gen() 2124 MB/s
[ 0.553429] raid6: neonx1 gen() 1809 MB/s
[ 0.621482] raid6: int64x8 gen() 1415 MB/s
[ 0.689549] raid6: int64x4 gen() 1568 MB/s
[ 0.757628] raid6: int64x2 gen() 1392 MB/s
[ 0.825681] raid6: int64x1 gen() 1033 MB/s
[ 0.825721] raid6: using algorithm neonx8 gen() 2263 MB/s
[ 0.897756] raid6: .... xor() 1653 MB/s, rmw enabled
[ 0.897801] raid6: using neon recovery algorithm
[ 0.902229] iommu: Default domain type: Translated
[ 0.906479] iommu: DMA domain TLB invalidation policy: strict mode
[ 0.912876] SCSI subsystem initialized
[ 0.916551] usbcore: registered new interface driver usbfs
[ 0.921898] usbcore: registered new interface driver hub
[ 0.927219] usbcore: registered new device driver usb
[ 0.932324] mc: Linux media interface: v0.10
[ 0.936522] videodev: Linux video capture interface: v2.00
[ 0.942012] pps_core: LinuxPPS API ver. 1 registered
[ 0.946936] pps_core: Software ver. 5.3.6 - Copyright 2005-2007
Rodolfo Giometti <[email protected]>
[ 0.956079] PTP clock support registered
[ 0.960008] EDAC MC: Ver: 3.0.0
[ 0.963515] zynqmp-ipi-mbox mailbox@ff9905c0: Registered ZynqMP IPI
mbox with TX/RX channels.
[ 0.971952] FPGA manager framework
[ 0.975176] Advanced Linux Sound Architecture Driver Initialized.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 243
Appendix L: PetaLinux Commands

[ 0.981563] Bluetooth: Core ver 2.22


[ 0.984708] NET: Registered PF_BLUETOOTH protocol family
[ 0.990008] Bluetooth: HCI device and connection manager initialized
[ 0.996360] Bluetooth: HCI socket layer initialized
[ 1.001230] Bluetooth: L2CAP socket layer initialized
[ 1.006285] Bluetooth: SCO socket layer initialized
[ 1.011519] clocksource: Switched to clocksource arch_sys_counter
[ 1.017408] VFS: Disk quotas dquot_6.6.0
[ 1.021178] VFS: Dquot-cache hash table entries: 512 (order 0, 4096
bytes)
[ 1.033466] NET: Registered PF_INET protocol family
[ 1.033666] IP idents hash table entries: 65536 (order: 7, 524288
bytes, linear)
[ 1.043019] tcp_listen_portaddr_hash hash table entries: 2048 (order:
3, 32768 bytes, linear)
[ 1.048853] Table-perturb hash table entries: 65536 (order: 6, 262144
bytes, linear)
[ 1.056574] TCP established hash table entries: 32768 (order: 6,
262144 bytes, linear)
[ 1.064693] TCP bind hash table entries: 32768 (order: 8, 1048576
bytes, linear)
[ 1.072678] TCP: Hash tables configured (established 32768 bind 32768)
[ 1.078478] UDP hash table entries: 2048 (order: 4, 65536 bytes,
linear)
[ 1.085177] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes,
linear)
[ 1.092380] NET: Registered PF_UNIX/PF_LOCAL protocol family
[ 1.098321] RPC: Registered named UNIX socket transport module.
[ 1.103816] RPC: Registered udp transport module.
[ 1.108515] RPC: Registered tcp transport module.
[ 1.113210] RPC: Registered tcp-with-tls transport module.
[ 1.118691] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 1.125138] PCI: CLS 0 bytes, default 64
[ 1.129305] Trying to unpack rootfs image as initramfs...
[ 1.140925] Initialise system trusted keyrings
[ 1.141144] workingset: timestamp_bits=46 max_order=20 bucket_order=0
[ 1.146731] NFS: Registering the id_resolver key type
[ 1.151248] Key type id_resolver registered
[ 1.155391] Key type id_legacy registered
[ 1.159428] nfs4filelayout_init: NFSv4 File Layout Driver
Registering...
[ 1.166097] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver
Registering...
[ 1.173775] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat,
Inc.
[ 1.214089] NET: Registered PF_ALG protocol family
[ 1.214157] xor: measuring software checksum speed
[ 1.221942] 8regs : 2523 MB/sec
[ 1.226284] 32regs : 2523 MB/sec
[ 1.230897] arm64_neon : 2364 MB/sec
[ 1.231083] xor: using function: 32regs (2523 MB/sec)
[ 1.236149] Key type asymmetric registered
[ 1.240226] Asymmetric key parser 'x509' registered
[ 1.245177] Block layer SCSI generic (bsg) driver version 0.4 loaded
(major 244)
[ 1.252499] io scheduler mq-deadline registered
[ 1.257019] io scheduler kyber registered
[ 1.261072] io scheduler bfq registered
[ 1.268391] irq-xilinx: mismatch in kind-of-intr param
[ 1.269976] irq-xilinx: /pl-bus/interrupt-controller@80020000:
num_irq=32, edge=0x1
[ 1.312120] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 1.314380] Serial: AMBA driver

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 244
Appendix L: PetaLinux Commands

[ 1.322394] brd: module loaded


[ 1.325941] loop: module loaded
[ 1.330486] tun: Universal TUN/TAP device driver, 1.6
[ 1.330675] CAN device driver interface
[ 1.334716] usbcore: registered new interface driver asix
[ 1.339162] usbcore: registered new interface driver ax88179_178a
[ 1.345246] usbcore: registered new interface driver cdc_ether
[ 1.351073] usbcore: registered new interface driver net1080
[ 1.356729] usbcore: registered new interface driver cdc_subset
[ 1.362641] usbcore: registered new interface driver zaurus
[ 1.368230] usbcore: registered new interface driver cdc_ncm
[ 1.373884] usbcore: registered new interface driver r8153_ecm
[ 1.380146] VFIO - User Level meta-driver version: 0.3
[ 1.385662] usbcore: registered new interface driver uas
[ 1.390149] usbcore: registered new interface driver usb-storage
[ 1.397187] rtc_zynqmp ffa60000.rtc: registered as rtc0
[ 1.401360] rtc_zynqmp ffa60000.rtc: setting system clock to
2024-03-03T06:23:28 UTC (1709447008)
[ 1.410392] i2c_dev: i2c /dev entries driver
[ 1.416754] usbcore: registered new interface driver uvcvideo
[ 1.421522] Bluetooth: HCI UART driver ver 2.3
[ 1.424668] Bluetooth: HCI UART protocol H4 registered
[ 1.429793] Bluetooth: HCI UART protocol BCSP registered
[ 1.435154] Bluetooth: HCI UART protocol LL registered
[ 1.440233] Bluetooth: HCI UART protocol ATH3K registered
[ 1.445662] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 1.452022] Bluetooth: HCI UART protocol Intel registered
[ 1.457309] Bluetooth: HCI UART protocol QCA registered
[ 1.462544] usbcore: registered new interface driver bcm203x
[ 1.468185] usbcore: registered new interface driver bpa10x
[ 1.473750] usbcore: registered new interface driver bfusb
[ 1.479245] usbcore: registered new interface driver btusb
[ 1.484740] usbcore: registered new interface driver ath3k
[ 1.490393] EDAC MC: ECC not enabled
[ 1.494346] sdhci: Secure Digital Host Controller Interface driver
[ 1.499932] sdhci: Copyright(c) Pierre Ossman
[ 1.504270] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.510868] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.516019] SMCCC: SOC_ID: ID = jep106:0049:0000 Revision = 0x24738093
[ 1.522578] zynqmp_firmware_probe Platform Management API v1.1
[ 1.528333] zynqmp_firmware_probe Trustzone version v1.0
[ 1.563330] securefw securefw: securefw probed
[ 1.563789] zynqmp-aes zynqmp-aes.0: will run requests pump with
realtime priority
[ 1.570619] usbcore: registered new interface driver usbhid
[ 1.575379] usbhid: USB HID core driver
[ 1.582324] ARM CCI_400_r1 PMU driver probed
[ 1.582978] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7
counters available
[ 1.592730] fpga_manager fpga0: Xilinx ZynqMP FPGA Manager registered
[ 1.598174] usbcore: registered new interface driver snd-usb-audio
[ 1.604955] pktgen: Packet Generator for packet performance testing.
Version: 2.75
[ 1.616725] Initializing XFRM netlink socket
[ 1.616822] NET: Registered PF_INET6 protocol family
[ 1.621275] Segment Routing with IPv6
[ 1.624312] In-situ OAM (IOAM) with IPv6
[ 1.628312] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 1.634622] NET: Registered PF_PACKET protocol family
[ 1.639164] NET: Registered PF_KEY protocol family
[ 1.643957] can: controller area network core
[ 1.648322] NET: Registered PF_CAN protocol family
[ 1.653073] can: raw protocol

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 245
Appendix L: PetaLinux Commands

[ 1.656033] can: broadcast manager protocol


[ 1.660213] can: netlink gateway - max_hops=1
[ 1.664738] Bluetooth: RFCOMM TTY layer initialized
[ 1.669437] Bluetooth: RFCOMM socket layer initialized
[ 1.674576] Bluetooth: RFCOMM ver 1.11
[ 1.678306] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 1.683605] Bluetooth: BNEP filters: protocol multicast
[ 1.688835] Bluetooth: BNEP socket layer initialized
[ 1.693785] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 1.699712] Bluetooth: HIDP socket layer initialized
[ 1.704705] 8021q: 802.1Q VLAN Support v1.8
[ 1.709189] 9pnet: Installing 9P2000 support
[ 1.713139] Key type dns_resolver registered
[ 1.724927] registered taskstats version 1
[ 1.724980] Loading compiled-in X.509 certificates
[ 1.736663] Btrfs loaded, zoned=no, fsverity=no
[ 1.736872] alg: No test for xilinx-zynqmp-rsa (zynqmp-rsa)
[ 2.601373] Freeing initrd memory: 31276K
[ 2.983335] ff000000.serial: ttyPS0 at MMIO 0xff000000 (irq = 24,
base_baud = 6249375) is a xuartps
[ 2.992418] printk: console [ttyPS0] enabled
[ 2.992418] printk: console [ttyPS0] enabled
[ 2.996716] printk: bootconsole [cdns0] disabled
[ 2.996716] printk: bootconsole [cdns0] disabled
[ 3.006605] ff010000.serial: ttyPS1 at MMIO 0xff010000 (irq = 25,
base_baud = 6249375) is a xuartps
[ 3.019501] of-fpga-region fpga-full: FPGA Region probed
[ 3.027203] nwl-pcie fd0e0000.pcie: host bridge /axi/pcie@fd0e0000
ranges:
[ 3.034109] nwl-pcie fd0e0000.pcie: MEM
0x00e0000000..0x00efffffff -> 0x00e0000000
[ 3.042120] nwl-pcie fd0e0000.pcie: MEM
0x0600000000..0x07ffffffff -> 0x0600000000
[ 3.050239] nwl-pcie fd0e0000.pcie: Link is DOWN
[ 3.055292] nwl-pcie fd0e0000.pcie: PCI host bridge to bus 0000:00
[ 3.061471] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 3.066953] pci_bus 0000:00: root bus resource [mem
0xe0000000-0xefffffff]
[ 3.073827] pci_bus 0000:00: root bus resource [mem
0x600000000-0x7ffffffff pref]
[ 3.081335] pci 0000:00:00.0: [10ee:d021] type 01 class 0x060400
[ 3.087395] pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot
[ 3.095411] pci 0000:00:00.0: bridge configuration invalid ([bus
00-00]), reconfiguring
[ 3.103544] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[ 3.110173] pci 0000:00:00.0: PCI bridge to [bus 01]
[ 3.119104] xilinx-zynqmp-dpdma fd4c0000.dma-controller: Xilinx DPDMA
engine is probed
[ 3.127765] spi-nor spi0.0: found mt25qu512a, expected m25p80
[ 3.133851] spi-nor spi0.0: mt25qu512a (131072 Kbytes)
[ 3.139095] 3 fixed-partitions partitions found on MTD device spi0.0
[ 3.145446] Creating 3 MTD partitions on "spi0.0":
[ 3.150236] 0x000000000000-0x000001e00000 : "qspi-boot"
[ 3.156377] 0x000001e00000-0x000001e40000 : "qspi-bootenv"
[ 3.162645] 0x000001e40000-0x000004240000 : "qspi-kernel"
[ 3.192681] xilinx-axipmon ffa00000.perf-monitor: Probed Xilinx APM
[ 3.199268] xilinx-axipmon fd0b0000.perf-monitor: Probed Xilinx APM
[ 3.205780] xilinx-axipmon fd490000.perf-monitor: Probed Xilinx APM
[ 3.212290] xilinx-axipmon ffa10000.perf-monitor: Probed Xilinx APM
[ 3.219579] i2c i2c-0: using pinctrl states for GPIO recovery
[ 3.225538] i2c i2c-0: using generic GPIOs for recovery
[ 3.231165] pca953x 0-0020: supply vcc not found, using dummy regulator
[ 3.237860] pca953x 0-0020: using no AI

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 246
Appendix L: PetaLinux Commands

[ 3.242517] pca953x 0-0021: supply vcc not found, using dummy regulator
[ 3.249206] pca953x 0-0021: using no AI
[ 3.253896] pca954x 0-0075: supply vdd not found, using dummy regulator
[ 3.268075] i2c i2c-0: Added multiplexed i2c bus 2
[ 3.278796] i2c i2c-0: Added multiplexed i2c bus 3
[ 3.328710] i2c i2c-0: Added multiplexed i2c bus 4
[ 3.333660] i2c i2c-0: Added multiplexed i2c bus 5
[ 3.338455] pca954x 0-0075: registered 4 multiplexed busses for I2C
mux pca9544
[ 3.345826] cdns-i2c ff020000.i2c: 400 kHz mmio ff020000 irq 52
[ 3.352826] i2c i2c-1: using pinctrl states for GPIO recovery
[ 3.358769] i2c i2c-1: using generic GPIOs for recovery
[ 3.364392] pca954x 1-0074: supply vdd not found, using dummy regulator
[ 3.371467] at24 6-0054: supply vcc not found, using dummy regulator
[ 3.378360] at24 6-0054: 1024 byte 24c08 EEPROM, writable, 1 bytes/
write
[ 3.385102] i2c i2c-1: Added multiplexed i2c bus 6
[ 3.390485] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.397795] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.405100] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.412408] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.419708] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.427010] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.434310] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.441610] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.449670] si5341 7-0036: Chip: 5341 Grade: 1 Rev: 1
[ 3.477481] i2c i2c-1: Added multiplexed i2c bus 7
[ 3.484482] si570 8-005d: registered, current frequency 300000000 Hz
[ 3.490876] i2c i2c-1: Added multiplexed i2c bus 8
[ 3.497864] si570 9-005d: registered, current frequency 156250000 Hz
[ 3.504259] i2c i2c-1: Added multiplexed i2c bus 9
[ 3.509294] si5324 10-0069: si5328 probed
[ 3.573205] si5324 10-0069: si5328 probe successful
[ 3.578127] i2c i2c-1: Added multiplexed i2c bus 10
[ 3.583153] i2c i2c-1: Added multiplexed i2c bus 11
[ 3.588180] i2c i2c-1: Added multiplexed i2c bus 12
[ 3.593203] i2c i2c-1: Added multiplexed i2c bus 13
[ 3.598079] pca954x 1-0074: registered 8 multiplexed busses for I2C
switch pca9548
[ 3.605818] pca954x 1-0075: supply vdd not found, using dummy regulator
[ 3.612774] i2c i2c-1: Added multiplexed i2c bus 14
[ 3.617806] i2c i2c-1: Added multiplexed i2c bus 15
[ 3.622839] i2c i2c-1: Added multiplexed i2c bus 16
[ 3.627867] i2c i2c-1: Added multiplexed i2c bus 17
[ 3.632897] i2c i2c-1: Added multiplexed i2c bus 18
[ 3.637932] i2c i2c-1: Added multiplexed i2c bus 19
[ 3.642966] i2c i2c-1: Added multiplexed i2c bus 20
[ 3.648002] i2c i2c-1: Added multiplexed i2c bus 21
[ 3.652883] pca954x 1-0075: registered 8 multiplexed busses for I2C
switch pca9548
[ 3.660483] cdns-i2c ff030000.i2c: 400 kHz mmio ff030000 irq 53
[ 3.670593] cdns-wdt fd4d0000.watchdog: Xilinx Watchdog Timer with
timeout 60s
[ 3.678120] cdns-wdt ff150000.watchdog: Xilinx Watchdog Timer with
timeout 10s

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 247
Appendix L: PetaLinux Commands

[ 3.686179] cpufreq: cpufreq_online: CPU0: Running at unlisted initial


frequency: 1199880 KHz, changing to: 1199999 KHz
[ 3.700323] zynqmp-display fd4a0000.display: vtc bridge property not
present
[ 3.709584] xilinx-dp-snd-codec fd4a0000.display:zynqmp-dp-snd-codec0:
Xilinx DisplayPort Sound Codec probed
[ 3.719722] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm0: Xilinx DisplayPort
Sound PCM probed
[ 3.727788] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm1: Xilinx DisplayPort
Sound PCM probed
[ 3.731525] mmc0: SDHCI controller on ff170000.mmc [ff170000.mmc]
using ADMA 64-bit
[ 3.744063] xilinx-dp-snd-card fd4a0000.display:zynqmp-dp-snd-card:
Xilinx DisplayPort Sound Card probed
[ 3.754017] xlnx-drm xlnx-drm.0: bound fd4a0000.display (ops
0xffff800080fce768)
[ 3.911025] mmc0: new high speed SDHC card at address aaaa
[ 3.916873] mmcblk0: mmc0:aaaa SB16G 14.8 GiB
[ 3.925978] mmcblk0: p1 p2
[ 4.839545] zynqmp-display fd4a0000.display: [drm] Cannot find any
crtc or sizes
[ 4.847227] [drm] Initialized xlnx 1.0.0 20130509 for fd4a0000.display
on minor 0
[ 4.854734] zynqmp-display fd4a0000.display: ZynqMP DisplayPort
Subsystem driver probed
[ 4.863006] ahci-ceva fd0c0000.ahci: supply ahci not found, using
dummy regulator
[ 4.870576] ahci-ceva fd0c0000.ahci: supply phy not found, using dummy
regulator
[ 4.878057] ahci-ceva fd0c0000.ahci: supply target not found, using
dummy regulator
[ 4.896035] ahci-ceva fd0c0000.ahci: AHCI 0001.0301 32 slots 2 ports 6
Gbps 0x3 impl platform mode
[ 4.905005] ahci-ceva fd0c0000.ahci: flags: 64bit ncq sntf pm clo only
pmp fbs pio slum part ccc sds apst
[ 4.915436] scsi host0: ahci-ceva
[ 4.919057] scsi host1: ahci-ceva
[ 4.922485] ata1: SATA max UDMA/133 mmio [mem 0xfd0c0000-0xfd0c1fff]
port 0x100 irq 58
[ 4.930397] ata2: SATA max UDMA/133 mmio [mem 0xfd0c0000-0xfd0c1fff]
port 0x180 irq 58
[ 4.945418] macb ff0e0000.ethernet eth0: Cadence GEM rev 0x50070106 at
0xff0e0000 irq 50 (de:32:55:d7:f6:19)
[ 5.039867] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[ 5.045380] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned
bus number 1
[ 5.053131] xhci-hcd xhci-hcd.1.auto: hcc params 0x0238f625 hci
version 0x100 quirks 0x0000000002000810
[ 5.062555] xhci-hcd xhci-hcd.1.auto: irq 59, io mem 0xfe200000
[ 5.068584] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[ 5.074072] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned
bus number 2
[ 5.081726] xhci-hcd xhci-hcd.1.auto: Host supports USB 3.0 SuperSpeed
[ 5.088392] usb usb1: New USB device found, idVendor=1d6b,
idProduct=0002, bcdDevice= 6.06
[ 5.096661] usb usb1: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[ 5.103886] usb usb1: Product: xHCI Host Controller
[ 5.108762] usb usb1: Manufacturer: Linux 6.6.10-xilinx-v2024.1-
ga33033bade74 xhci-hcd
[ 5.116670] usb usb1: SerialNumber: xhci-hcd.1.auto
[ 5.121931] hub 1-0:1.0: USB hub found
[ 5.125695] hub 1-0:1.0: 1 port detected

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 248
Appendix L: PetaLinux Commands

[ 5.129954] usb usb2: New USB device found, idVendor=1d6b,


idProduct=0003, bcdDevice= 6.06
[ 5.138217] usb usb2: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[ 5.145439] usb usb2: Product: xHCI Host Controller
[ 5.150307] usb usb2: Manufacturer: Linux 6.6.10-xilinx-v2024.1-
ga33033bade74 xhci-hcd
[ 5.158220] usb usb2: SerialNumber: xhci-hcd.1.auto
[ 5.163381] hub 2-0:1.0: USB hub found
[ 5.167146] hub 2-0:1.0: 1 port detected
[ 5.174410] input: gpio-keys as /devices/platform/gpio-keys/input/
input0
[ 5.181494] of_cfs_init
[ 5.183964] of_cfs_init: OK
[ 5.186812] clk: Disabling unused clocks
[ 5.191714] ALSA device list:
[ 5.194670] #0: DP mon
[ 5.253800] ata1: SATA link down (SStatus 0 SControl 330)
[ 5.419522] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 330)
[ 5.426321] ata2.00: ATA-11: WDC WDS250G2B0A-00SM50, 401020WD, max
UDMA/133
[ 5.433372] ata2.00: 488397168 sectors, multi 1: LBA48 NCQ (depth 32)
[ 5.441820] ata2.00: configured for UDMA/133
[ 5.446357] scsi 1:0:0:0: Direct-Access ATA WDC WDS250G2B0A
20WD PQ: 0 ANSI: 5
[ 5.455243] sd 1:0:0:0: [sda] 488397168 512-byte logical blocks: (250
GB/233 GiB)
[ 5.462750] sd 1:0:0:0: [sda] Write Protect is off
[ 5.467593] sd 1:0:0:0: [sda] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[ 5.476705] sd 1:0:0:0: [sda] Preferred minimum I/O size 512 bytes
[ 5.483926] sda: sda1
[ 5.486458] sd 1:0:0:0: [sda] Attached SCSI disk
[ 5.491800] Freeing unused kernel memory: 2816K
[ 5.496404] Run /init as init process
[ 5.517435] systemd[1]: systemd 251.8+ running in system mode (+PAM -
AUDIT -SELINUX -APPARMOR +IMA -SMACK +SECCOMP -GCRYPT -GNUTLS -OPENSSL
+ACL +BLKID -CURL -ELFUTILS -FIDO2 -IDN2 -IDN -IPTC +KMOD -LIBCRYPTSETUP
+LIBFDISK -PCRE2 -PWQUALITY -P11KIT -QRENCODE -TPM2 -BZIP2 -LZ4 -XZ -ZLIB
+ZSTD -BPF_FRAMEWORK +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=hybrid)
[ 5.549371] systemd[1]: Detected architecture arm64.

Welcome to PetaLinux 2024.1+release-S02291836 (langdale)!

[ 5.603688] systemd[1]: Hostname set to <xilinx-zcu102-20241>.


[ 5.609667] systemd[1]: Initializing machine ID from random generator.
[ 5.639578] usb 2-1: new SuperSpeed USB device number 2 using xhci-hcd
[ 5.676675] systemd-sysv-generator[201]: SysV service '/etc/init.d/
sshd' lacks a native systemd unit file. Automatically generating a unit
file for compatibility. Please update package to include a native systemd
unit file, in order to make it more safe and robust.
[ 5.701679] systemd-sysv-generator[201]: SysV service '/etc/init.d/
nfsserver' lacks a native systemd unit file. Automatically generating a
unit file for compatibility. Please update package to include a native
systemd unit file, in order to make it more safe and robust.
[ 5.726164] systemd-sysv-generator[201]: SysV service '/etc/init.d/
inetd.busybox' lacks a native systemd unit file. Automatically generating
a unit file for compatibility. Please update package to include a native
systemd unit file, in order to make it more safe and robust.
[ 5.781581] usb 2-1: New USB device found, idVendor=054c,
idProduct=09c2, bcdDevice= 1.00
[ 5.789776] usb 2-1: New USB device strings: Mfr=1, Product=2,
SerialNumber=3

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 249
Appendix L: PetaLinux Commands

[ 5.796904] usb 2-1: Product: Storage Media


[ 5.801079] usb 2-1: Manufacturer: Sony
[ 5.804907] usb 2-1: SerialNumber: 5C07104CBD9D8D8715
[ 5.811580] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 5.818005] scsi host2: usb-storage 2-1:1.0
[ 5.945703] systemd[1]: Queued start job for default target Multi-User
System.
[ 5.951700] zynqmp-display fd4a0000.display: [drm] Cannot find any
crtc or sizes
[ 6.006649] systemd[1]: Created slice Slice /system/getty.
[ OK ] Created slice Slice /system/getty.
[ 6.029042] systemd[1]: Created slice Slice /system/modprobe.
[ OK ] Created slice Slice /system/modprobe.
[ 6.052903] systemd[1]: Created slice Slice /system/serial-getty.
[ OK ] Created slice Slice /system/serial-getty.
[ 6.076569] systemd[1]: Created slice User and Session Slice.
[ OK ] Created slice User and Session Slice.
[ 6.099784] systemd[1]: Started Dispatch Password Requests to Console
Directory Watch.
[ OK ] Started Dispatch Password …ts to Console Directory Watch.
[ 6.123719] systemd[1]: Started Forward Password Requests to Wall
Directory Watch.
[ OK ] Started Forward Password R…uests to Wall Directory Watch.
[ 6.147783] systemd[1]: Reached target Path Units.
[ OK ] Reached target Path Units.
[ 6.163637] systemd[1]: Reached target Remote File Systems.
[ OK ] Reached target Remote File Systems.
[ 6.183611] systemd[1]: Reached target Slice Units.
[ OK ] Reached target Slice Units.
[ 6.199644] systemd[1]: Reached target Swaps.
[ OK ] Reached target Swaps.
[ 6.216070] systemd[1]: Listening on RPCbind Server Activation Socket.
[ OK ] Listening on RPCbind Server Activation Socket.
[ 6.239613] systemd[1]: Reached target RPC Port Mapper.
[ OK ] Reached target RPC Port Mapper.
[ 6.259931] systemd[1]: Listening on Syslog Socket.
[ OK ] Listening on Syslog Socket.
[ 6.275797] systemd[1]: Listening on initctl Compatibility Named Pipe.
[ OK ] Listening on initctl Compatibility Named Pipe.
[ 6.300058] systemd[1]: Listening on Journal Audit Socket.
[ OK ] Listening on Journal Audit Socket.
[ 6.319860] systemd[1]: Listening on Journal Socket (/dev/log).
[ OK ] Listening on Journal Socket (/dev/log).
[ 6.343923] systemd[1]: Listening on Journal Socket.
[ OK ] Listening on Journal Socket.
[ 6.360059] systemd[1]: Listening on Network Service Netlink Socket.
[ OK ] Listening on Network Service Netlink Socket.
[ 6.383948] systemd[1]: Listening on udev Control Socket.
[ OK ] Listening on udev Control Socket.
[ 6.403827] systemd[1]: Listening on udev Kernel Socket.
[ OK ] Listening on udev Kernel Socket.
[ 6.423856] systemd[1]: Listening on User Database Manager Socket.
[ OK ] Listening on User Database Manager Socket.
[ 6.463810] systemd[1]: Mounting Huge Pages File System...
Mounting Huge Pages File System...
[ 6.482560] systemd[1]: Mounting POSIX Message Queue File System...
Mounting POSIX Message Queue File System...
[ 6.506679] systemd[1]: Mounting Kernel Debug File System...
Mounting Kernel Debug File System...
[ 6.523976] systemd[1]: Kernel Trace File System was skipped because
of a failed condition check (ConditionPathExists=/sys/kernel/tracing).
[ 6.539673] systemd[1]: Mounting Temporary Directory /tmp...
Mounting Temporary Directory /tmp...

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 250
Appendix L: PetaLinux Commands

[ 6.555877] systemd[1]: Create List of Static Device Nodes was skipped


because of a failed condition check (ConditionFileNotEmpty=/lib/modules/
6.6.10-xilinx-v2024.1-ga33033bade74/modules.devname).
[ 6.595966] systemd[1]: Starting Load Kernel Module configfs...
Starting Load Kernel Module configfs...
[ 6.614942] systemd[1]: Starting Load Kernel Module drm...
Starting Load Kernel Module drm...
[ 6.634937] systemd[1]: Starting Load Kernel Module fuse...
Starting Load Kernel Module fuse...
[ 6.655010] systemd[1]: Starting RPC Bind...
Starting RPC Bind...
[ 6.671750] systemd[1]: File System Check on Root Device was skipped
because of a failed condition check (ConditionPathIsReadWrite=!/).
[ 6.684699] systemd[1]: systemd-journald.service: unit configures an
IP firewall, but the local system does not support BPF/cgroup firewalling.
[ 6.697576] systemd[1]: (This warning is only shown for the first unit
using IP firewalling.)
[ 6.709990] systemd[1]: Starting Journal Service...
Starting Journal Service...
[ 6.724260] systemd[1]: Load Kernel Modules was skipped because all
trigger condition checks failed.
[ 6.736374] systemd[1]: Mounting NFSD configuration filesystem...
Mounting NFSD configuration filesystem...
[ 6.755105] systemd[1]: Starting Generate network units from Kernel
command line...
Starting Generate network …ts from Kernel command line...
[ 6.782981] systemd[1]: Starting Remount Root and Kernel File
Systems...
Starting Remount Root and Kernel File Systems...
[ 6.803291] systemd[1]: Starting Apply Kernel Variables...
Starting Apply Kernel Variables...
[ 6.823055] systemd[1]: Starting Coldplug All udev Devices...
Starting Coldplug All udev Devices...
[ 6.844536] systemd[1]: Started RPC Bind.
[ OK ] Started RPC Bind.
[ 6.860199] systemd[1]: Mounted Huge Pages File System.
[ OK ] Mounted Huge Pages File System.
[ 6.880108] systemd[1]: Started Journal Service.
[ OK ] Started Journal Service.
[ OK ] Mounted POSIX Message Queue File Sys[ 6.899917] scsi 2:0:0:0:
Direct-Access Sony Storage Media PMAP PQ: 0 ANSI: 6
tem.
[ OK ] Mounted Kernel Debug File System.
[ OK ] Mounted Temporary Directory /tmp.
[ OK ] Finished Load Kernel Module configfs.
[ OK ] Finished Load Kernel Module drm.
[ OK ] Finished Load Kernel Module fuse.
[ OK ] Mounted NFSD configuration filesystem.
[ OK ] Finished Generate network units from Kernel command line.
[ OK ] Finished Remount Root and Kernel File Systems.
[ OK ] Finished Apply Kernel Variables.
[ OK ] Reached target Preparation for Network.
Mounting Kernel Configuration File System...
Starting Flush Journal to Persistent Storage...
[ 7.138636] systemd-journald[214]: Received client request to flush
runtime journal.
Starting Create System Users...
[ OK ] Mounted Kernel Configuration File System.
[ OK ] Finished Flush Journal to Persistent Storage.
[ OK ] Finished Create System Users.
Starting Create Static Device Nodes in /dev...
[ OK ] Finished Create Static Device Nodes in /dev.
[ OK ] Reached target Preparation for Local File Systems.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 251
Appendix L: PetaLinux Commands

Mounting /var/volatile...
Starting Rule-based Manage…for Device Events and Files...
[ OK ] Mounted /var/volatile.
Starting Load/Save Random Seed...
[ OK ] Reached target Local File Systems.
Starting Rebuild Dynamic Linker Cache...
Starting Create Volatile Files and Directories...
[ OK ] Started Rule-based Manager for Device Events and Files.
[ OK ] Finished Rebuild Dynamic Linker Cache.
Starting Network Configuration...
[ OK ] Finished Create Volatile Files and Directories.
Starting Run pending postinsts...
Starting Rebuild Journal Catalog...
[ 7.552663] Unloading old XRT Linux kernel modules
Starting Network Name Resolution...
[ 7.569889] Loading new XRT Linux kernel modules
Starting Network Time Synchronization...
[ 7.601368] zocl: loading out-of-tree module taints kernel.
Starting Record System Boot/Shutdown in UTMP[0[ 7.625312]
[drm] Probing for xlnx,zocl
m...
[ 7.633318] zocl-drm zyxclmm_drm: error -ENXIO: IRQ index 32 not found
[ 7.640402] [drm] FPGA programming device pcap founded.
[ OK ] Finished Rebuild Journal Catalog.
[ 7.694198] [drm] PR[0] Isolation addr 0x0
[ 7.717371] [drm] Initialized zocl 2.15.0 20240303 for zyxclmm_drm on
minor 1
Starting Update is Completed...
[ OK ] Finished Record System Boot/Shutdown[ 7.895574] sd 2:0:0:0:
[sdb] 15199296 512-byte logical blocks: (7.78 GB/7.25 GiB)
in UTMP.
[ 7.937462] sd 2:0:0:0: [sdb] Write Protect is off
[ OK ] Finished Update is Completed.
[ 7.957416] sd 2:0:0:0: [sdb] No Caching mode page found
[ 7.962793] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[ 8.015646] sdb: sdb1
[ 8.019648] cfg80211: Loading compiled-in X.509 certificates for
regulatory database
[ 8.023204] sd 2:0:0:0: [sdb] Attached SCSI removable disk
[ OK ] Finished Coldplug All udev Devices.
[ 8.094505] INFO: Creating ICD entry for Xilinx Platform
[ 8.214198] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 8.230681] Loaded X.509 cert 'wens:
61c038651aabdcf94bd0ac7ff06c7248db18c600'
[ 8.238422] platform regulatory.0: Direct firmware load for
regulatory.db failed with error -2
[ 8.247134] cfg80211: failed to load regulatory.db
[ OK ] Started Network Configuration.
[ OK ] Started Network Name Resolution.
[ 8.411562] random: crng init done
[ OK ] Finished Load/Save Random Seed.
[ OK ] Started Network Time Synchronization.
[ OK ] Finished Run pending postinsts.
[ 8.654429] macb ff0e0000.ethernet eth0: PHY [ff0e0000.ethernet-
ffffffff:0c] driver [TI DP83867] (irq=POLL)
[ 8.664271] macb ff0e0000.ethernet eth0: configuring for phy/rgmii-id
link mode
[ 8.677310] pps pps0: new PPS source ptp0
[ 8.682306] macb ff0e0000.ethernet: gem-ptp-timer ptp clock registered.
[ OK ] Created slice Slice /system/systemd-fsck.
[ OK ] Reached target Network.
[ OK ] Reached target Host and Network Name Lookups.
[ OK ] Reached target Sound Card.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 252
Appendix L: PetaLinux Commands

[ OK ]
Reached target System Initialization.
[ OK ]
Started Daily Cleanup of Temporary Directories.
[ OK ]
Reached target System Time Set.
[ OK ]
Reached target Timer Units.
[ OK ]
Listening on D-Bus System Message Bus Socket.
Starting sshd.socket...
[ OK ] Listening on Load/Save RF …itch Status /dev/rfkill Watch.
[ OK ] Started NFS status monitor for NFSv2/3 locking..
Starting File System Check on /dev/sda...
[ OK ] Listening on sshd.socket.
[ OK ] Reached target Socket Units.
[ OK ] Reached target Basic System.
[ OK ] Started Kernel Logging Service.
[ OK ] Started System Logging Service.
Starting D-Bus System Message Bus...
Starting inetd.busybox.service...
Starting LSB: Kernel NFS server support...
Starting File System Check on /dev/mmcblk0p1...
Starting File System Check on /dev/mmcblk0p2...
Starting File System Check on /dev/sda1...
Starting File System Check on /dev/sdb...
Starting User Login Management...
Starting Permit User Sessions...
Starting Target Communication Framework agent...
Starting OpenSSH Key Generation...
[ OK ] Started D-Bus System Message Bus.
[ OK ] Started inetd.busybox.service.
[ OK ] Finished Permit User Sessions.
[ OK ] Started Target Communication Framework agent.
[ OK ] Started Getty on tty1.
[ OK ] Started Serial Getty on ttyPS0.
[ OK ] Reached target Login Prompts.
[FAILED] Failed to start File System Check on /dev/sdb.
See 'systemctl status [email protected]' for details.
[DEPEND] Dependency failed for /run/media/sdb.
[ OK ] Finished File System Check on /dev/mmcblk0p1.
Mounting /run/media/boot-mmcblk0p1...
[ OK ] Mounted /run/media/boot-mmcblk0p1.
[ OK ] Started User Login Management.
[ OK ] Finished File System Check on /dev/mmcblk0p2.
Mounting /run/media/root-mmcblk0p2...
[ 11.573327] EXT4-fs (mmcblk0p2): mounted filesystem 8c225517-879a-4841-
a86c-098bb72830ac r/w with ordered data mode. Quota mode: none.
[ OK ] Mounted /run/media/root-mmcblk0p2.
[ 11.870193] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state
recovery directory
[ 11.878112] NFSD: Using legacy client tracking operations.
[ 11.883625] NFSD: starting 90-second grace period (net f0000000)
Starting File System Check on /dev/sdb1...
[FAILED] Failed to start LSB: Kernel NFS server support.
See 'systemctl status nfsserver.service' for details.
[ OK ] Reached target Multi-User System.
Starting Record Runlevel Change in UTMP...
[ OK ] Finished Record Runlevel Change in UTMP.
[ OK ] Finished File System Check on /dev/sda.
Mounting /run/media/sda...
[ OK ] Mounted /run/media/sda.
[ OK ] Finished File System Check on /dev/sda1.
Mounting /run/media/sda1...
[FAILED] Failed to mount /run/media/sda1.
See 'systemctl status run-media-sda1.mount' for details.
[ OK ] Finished File System Check on /dev/sdb1.
Mounting /run/media/sdb1...

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 253
Appendix L: PetaLinux Commands

[ OK ] Mounted /run/media/sdb1.
[ 12.777762] macb ff0e0000.ethernet eth0: Link is Up - 1Gbps/Full -
flow control tx
**************************************************************************
******************
The PetaLinux source code and images provided/generated are for
demonstration purposes only.
**************************************************************************
******************
PetaLinux 2024.1+release-S02291836 xilinx-zcu102-20241 ttyPS0

xilinx-zcu102-20241 login: petalinux


You are required to change your password immediately (administrator
enforced).
New password:
Retype new password:
[ 33.357740] audit: type=1006 audit(1709447040.451:2): pid=899 uid=0
old-auid=4294967295 auid=1000 tty=(none) old-ses=4294967295 ses=1 res=1
[ 33.370300] audit: type=1300 audit(1709447040.451:2): arch=c00000b7
syscall=64 success=yes exit=4 a0=8 a1=ffffff9bf470 a2=4 a3=1 items=0
ppid=1 pid=899 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0
fsgid=0 tty=(none) ses=1 comm="(systemd)" exe="/lib/systemd/systemd"
key=(null)
[ 33.395886] audit: type=1327 audit(1709447040.451:2):
proctitle="(systemd)"
[ 33.403210] systemd[899]: memfd_create() called without MFD_EXEC or
MFD_NOEXEC_SEAL set
xilinx-zcu102-20241:~$

○ For MicroBlaze processors, the previous commands download the bitstream to the target
board, and boot the kernel image on the target board.
○ For Zynq 7000 devices, they download the bitstream and FSBL to the target board, and
boot the U-Boot and the kernel on the target board.
○ For Zynq UltraScale+ MPSoC, they download the bitstream, PMU firmware, and FSBL, and
boot the kernel with help of linux-boot.elf to set kernel start and DTB addresses.
○ For AMD Versal™ adaptive SoC, they download the BOOT.BIN (which contains the PDI,
PLM firmware, PSM firmware, U-Boot, and DTB) and boot the kernel (Image) with the help
of U-Boot script (boot.scr).

petalinux-boot qemu
The petalinux-boot qemu command boots the MicroBlaze™ CPU, AMD Zynq™
UltraScale+™ MPSoC, AMD Versal™ adaptive SoC, or Zynq 7000 devices with a PetaLinux image
using the QEMU emulator.

Note: For Versal adaptive SoC, you require BOOT.BIN to boot on QEMU. Check petalinux-package on how
to create BOOT.BIN for Versal adaptive SoC.

petalinux-boot qemu Options


The following table contains details of options specific to the QEMU boot workflow:

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 254
Appendix L: PetaLinux Commands

Table 52: petalinux-boot qemu Options

Otion Functional Description Value Range Default Value


--prebuilt Boot a prebuilt image. This is optional. • 2 (U-Boot) None
• 3 (Linux kernel)
--u-boot This option can be use to download specified User-specified <plnx-proj-root>/
U-Boot binary along with dependent files to images/linux/u-
boot into the U-Boot. It selects an U-Boot ELF boot.elf
image from <plnx-proj-root>/images/
linux/. This is optional.
--kernel This option can be use to download specified User-specified • zImage for AMD
kernel binary along with dependent files to Zynq™ 7000
boot kernel. This option picks the kernel image devices
from <plnx-proj-root>/images/linux/.
This is optional. • Image for AMD
Zynq™
UltraScale+™
MPSoC, and AMD
Versal™ adaptive
SoC
• image.elf for
MicroBlaze™ CPU
The default image is in
<plnx-proj-root>/
images/linux.
--qemu-args Extra arguments to QEMU command. This is None None
optional.
--tftp Path to tftp boot directory User-specified None
--pmu-qemu-args Extra arguments for PMU instance of QEMU. User-specified None
This is optional.
--rootfs The cpio rootfile system to use for QEMU boot. User-specified <plnx-proj-root>/
SupportsZynq, Zynq UltraScale+ MPSoC, and images/linux/
MicroBlaze . rootfs.cpio.gz.u-boot
--qemu-no-gdb To disable GDB through QEMU boot. None None

petalinux-boot qemu Examples


The following examples demonstrate the correct usage of the petalinux-boot qemu
command.

• Load and boot a prebuilt U-Boot elf using QEMU.


petalinux-boot --qemu --prebuilt 2
[NOTE] Argument: "--qemu" has been deprecated. It is recommended to start
using new python command line Argument.
[NOTE] Use: petalinux-boot qemu [OPTIONS]
[INFO] Set QEMU tftp to "/tftpboot"
[INFO] qemu-system-microblazeel -M microblaze-fdt -serial mon:stdio -
serial /dev/null -display none -device loader,file=/wrk/
everest_fcv_nobkup/kavyasre/_logs_/_zcu102_/_latest_/xilinx-zcu102-2024.1/
pre-built/linux/images/pmufw.elf -hw-dtb /wrk/everest_fcv_nobkup/kavyasre/
_logs_/_zcu102_/_latest_/xilinx-zcu102-2024.1/pre-built/linux/images/
zynqmp-qemu-multiarch-pmu.dtb -kernel /wrk/everest_fcv_nobkup/kavyasre/
_logs_/_zcu102_/_latest_/xilinx-zcu102-2024.1/pre-built/linux/images/
pmu_rom_qemu_sha3.elf -machine-path /tmp/tmpvnd3vwl0 -device
loader,addr=0xfd1a0074,data=0x1011003,data-len=4 -device

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 255
Appendix L: PetaLinux Commands

loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 &
[INFO] qemu-system-aarch64 -M arm-generic-fdt -serial mon:stdio -
serial /dev/null -display none -device loader,file=/wrk/
everest_fcv_nobkup/kavyasre/_logs_/_zcu102_/_latest_/xilinx-zcu102-2024.1/
pre-built/linux/images/bl31.elf,cpu-num=0 -global xlnx,zynqmp-boot.cpu-
num=0 -global xlnx,zynqmp-boot.use-pmufw=true -global xlnx,zynqmp-
boot.drive=pmu-cfg -blockdev node-name=pmu-cfg,filename=/wrk/
everest_fcv_nobkup/kavyasre/_logs_/_zcu102_/_latest_/xilinx-zcu102-2024.1/
pre-built/linux/images/pmu-conf.bin,driver=file -hw-dtb /wrk/
everest_fcv_nobkup/kavyasre/_logs_/_zcu102_/_latest_/xilinx-zcu102-2024.1/
pre-built/linux/images/zynqmp-qemu-multiarch-arm.dtb -device
loader,file=/wrk/everest_fcv_nobkup/kavyasre/_logs_/_zcu102_/_latest_/
xilinx-zcu102-2024.1/pre-built/linux/images/u-boot.elf -device
loader,file=/wrk/everest_fcv_nobkup/kavyasre/_logs_/_zcu102_/_latest_/
xilinx-zcu102-2024.1/pre-built/linux/images/
system.dtb,addr=0x100000,force-raw=on -gdb tcp:localhost:9000 -net nic -
net nic -net nic -net nic,netdev=eth3 -netdev user,id=eth3,tftp=/tftpboot
-machine-path /tmp/tmpvnd3vwl0 -m 4G
qemu-system-microblazeel: Failed to connect to '/tmp/tmpvnd3vwl0/qemu-
rport-_pmu@0': No such file or directory
qemu-system-microblazeel: info: QEMU waiting for connection on:
disconnected:unix:/tmp/tmpvnd3vwl0/qemu-rport-_pmu@0,server=on
qemu-system-aarch64: warning: hub 0 is not connected to host network
QEMU 8.1.0 monitor - type 'help' for more information
(qemu) PMU Firmware 2024.1 Feb 28 2024 16:59:36
PMU_ROM Version: xpbr-v8.1.0-0

U-Boot 2024.01 (Feb 28 2024 - 15:26:19 +0000)

CPU: ZynqMP
Silicon: v3
Chip: unknown
Model: ZynqMP ZCU102 Rev1.0
Board: Xilinx ZynqMP
DRAM: 2 GiB (effective 4 GiB)
PMUFW: v1.1
EL Level: EL2
Secure Boot: not authenticated, not encrypted
Core: 71 devices, 31 uclasses, devicetree: board
Warning: Device tree includes old 'u-boot,dm-' tags: please fix by
2023.07!
NAND: 0 MiB
MMC: mmc@ff170000: 0
Loading Environment from nowhere... OK
In: serial
Out: serial,vidconsole
Err: serial,vidconsole
Bootmode: JTAG_MODE
Reset reason:
Net:
ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id

Warning: ethernet@ff0e0000 (eth0) using random MAC address -


ba:e1:3f:a8:0a:0b
eth0: ethernet@ff0e0000
scanning bus for devices...
SATA link 0 timeout.
SATA link 1 timeout.
AHCI 0001.0000 32 slots 2 ports 1.5 Gbps 0x3 impl SATA mode
flags: 64bit ncq only
starting USB...
Bus usb@fe200000: Register 8000402 NbrPorts 8

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 256
Appendix L: PetaLinux Commands

Starting the controller


USB XHCI 1.00
scanning bus usb@fe200000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
JTAG: Trying to boot script at 20000000
## Executing script at 20000000
Wrong image format for "source" command
JTAG: SCRIPT FAILED: continuing...
BOOTP broadcast 1
DHCP client bound to address 10.0.2.15 (2 ms)
*** Warning: no boot file name; using '0A00020F.img'
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename '0A00020F.img'.
Load address: 0x8000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
missing environment variable: pxeuuid
Retrieving file: pxelinux.cfg/01-ba-e1-3f-a8-0a-0b
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/01-ba-e1-3f-a8-0a-0b'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0A00020F
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/0A00020F'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0A00020
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/0A00020'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0A0002
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/0A0002'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0A000
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/0A000'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0A00
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 257
Appendix L: PetaLinux Commands

Filename 'pxelinux.cfg/0A00'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0A0
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/0A0'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0A
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/0A'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/0'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/default-arm-zynqmp-zynqmp
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/default-arm-zynqmp-zynqmp'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/default-arm-zynqmp
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/default-arm-zynqmp'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/default-arm
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/default-arm'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/default
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/default'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Config file not found
BOOTP broadcast 1

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 258
Appendix L: PetaLinux Commands

DHCP client bound to address 10.0.2.15 (1 ms)


Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'boot.scr.uimg'.
Load address: 0x20000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
BOOTP broadcast 1
DHCP client bound to address 10.0.2.15 (0 ms)
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'boot.scr.uimg'.
Load address: 0x18000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
JTAG: Trying to boot script at 20000000
## Executing script at 20000000
Wrong image format for "source" command
JTAG: SCRIPT FAILED: continuing...
MMC: no card present
MMC Device 1 not found
no mmc device at slot 1
SF: Detected n25q512a with page size 512 Bytes, erase size 128 KiB, total
128 MiB
device 0 offset 0x3e80000, size 0x80000
SF: 524288 bytes @ 0x3e80000 Read: OK
QSPI: Trying to boot script at 20000000
## Executing script at 20000000
Wrong image format for "source" command
QSPI: SCRIPT FAILED: continuing...

no devices available
NAND: SCRIPT FAILED: continuing...

Device 0: unknown device

Device 1: unknown device


scanning bus for devices...

Device 0: unknown device


BOOTP broadcast 1
DHCP client bound to address 10.0.2.15 (0 ms)
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'boot.scr.uimg'.
Load address: 0x8000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
missing environment variable: pxeuuid
Retrieving file: pxelinux.cfg/01-ba-e1-3f-a8-0a-0b
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/01-ba-e1-3f-a8-0a-0b'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0A00020F
Using ethernet@ff0e0000 device

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 259
Appendix L: PetaLinux Commands

TFTP from server 10.0.2.2; our IP address is 10.0.2.15


Filename 'pxelinux.cfg/0A00020F'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0A00020
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/0A00020'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0A0002
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/0A0002'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0A000
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/0A000'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0A00
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/0A00'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0A0
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/0A0'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0A
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/0A'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/0
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/0'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/default-arm-zynqmp-zynqmp

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 260
Appendix L: PetaLinux Commands

Using ethernet@ff0e0000 device


TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/default-arm-zynqmp-zynqmp'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/default-arm-zynqmp
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/default-arm-zynqmp'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/default-arm
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/default-arm'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Retrieving file: pxelinux.cfg/default
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'pxelinux.cfg/default'.
Load address: 0x10000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Config file not found
BOOTP broadcast 1
DHCP client bound to address 10.0.2.15 (0 ms)
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'boot.scr.uimg'.
Load address: 0x20000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
BOOTP broadcast 1
DHCP client bound to address 10.0.2.15 (0 ms)
Using ethernet@ff0e0000 device
TFTP from server 10.0.2.2; our IP address is 10.0.2.15
Filename 'boot.scr.uimg'.
Load address: 0x18000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
ZynqMP>

• Load and boot a prebuilt U-Boot elf using QEMU in root mode.
petalinux-boot --qemu --root --prebuilt 2

• Specify the cpio rootfile systemf for QEMU boot. Supports Zynq, Zynq UltraScale+ MPSoC,
and MicroBlaze.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 261
Appendix L: PetaLinux Commands

• Boot customized rootfs image with kernel using QEMU:


petalinux-boot --qemu --kernel --rootfs images/linux/rootfs.cpio.gz.u-
boot
[NOTE] Argument: "--qemu" has been deprecated. It is recommended to start
using new python command line Argument.
[NOTE] Use: petalinux-boot qemu [OPTIONS]
[INFO] Set QEMU tftp to "/tftpboot"
[INFO] qemu-system-microblazeel -M microblaze-fdt -serial mon:stdio -
serial /dev/null -display none -device loader,file=/wrk/
everest_fcv_nobkup/xilinx-zcu102-2024.1/images/linux/pmufw.elf -hw-
dtb /wrk/everest_fcv_nobkup/xilinx-zcu102-2024.1/images/linux/zynqmp-qemu-
multiarch-pmu.dtb -kernel /wrk/everest_fcv_nobkup/_logs_/_zcu102_/
_latest_/xilinx-zcu102-2024.1/images/linux/pmu_rom_qemu_sha3.elf -machine-
path /tmp/tmpipcytkdm -device loader,addr=0xfd1a0074,data=0x1011003,data-
len=4 -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 &
Image resized.
qemu-system-microblazeel: Failed to connect to '/tmp/tmpipcytkdm/qemu-
rport-_pmu@0': No such file or directory
qemu-system-microblazeel: info: QEMU waiting for connection on:
disconnected:unix:/tmp/tmpipcytkdm/qemu-rport-_pmu@0,server=on
[INFO] qemu-system-aarch64 -M arm-generic-fdt -serial mon:stdio -
serial /dev/null -display none -device loader,file=/wrk/
everest_fcv_nobkup/xilinx-zcu102-2024.1/images/linux/bl31.elf,cpu-num=0 -
global xlnx,zynqmp-boot.cpu-num=0 -global xlnx,zynqmp-boot.use-
pmufw=true -global xlnx,zynqmp-boot.drive=pmu-cfg -blockdev node-
name=pmu-cfg,filename=/wrk/everest_fcv_nobkup/kavyasre/_logs_/_zcu102_/
_latest_/xilinx-zcu102-2024.1/images/linux/pmu-conf.bin,driver=file -
drive if=sd,format=raw,index=1,file=/wrk/everest_fcv_nobkup/kavyasre/
_logs_/_zcu102_/_latest_/xilinx-zcu102-2024.1/images/linux/rootfs.ext4 -
hw-dtb /wrk/everest_fcv_nobkup//xilinx-zcu102-2024.1/images/linux/zynqmp-
qemu-multiarch-arm.dtb -device loader,file=/wrk/everest_fcv_nobkup/
kavyasre/_logs_/_zcu102_/_latest_/xilinx-zcu102-2024.1/images/linux/
Image,addr=0x200000,force-raw=on -device loader,file=/wrk/
everest_fcv_nobkup/kavyasre/_logs_/_zcu102_/_latest_/xilinx-zcu102-2024.1/
images/linux/system.dtb,addr=0x100000,force-raw=on -device
loader,file=/wrk/everest_fcv_nobkup/xilinx-zcu102-2024.1/images/linux/u-
boot.elf -device loader,file=/wrk/everest_fcv_nobkup/xilinx-zcu102-2024.1/
images/linux/boot.scr,addr=0x20000000,force-raw=on -device
loader,file=/wrk/everest_fcv_nobkup/kavyasre/_logs_/_zcu102_/_latest_/
xilinx-zcu102-2024.1/images/linux/rootfs.cpio.gz.u-
boot,addr=0x4000000,force-raw=on -gdb tcp:localhost:9000 -net nic -net
nic -net nic -net nic,netdev=eth3 -netdev user,id=eth3,tftp=/tftpboot -
machine-path /tmp/tmpipcytkdm -m 4G
qemu-system-aarch64: warning: hub 0 is not connected to host network
QEMU 8.1.0 monitor - type 'help' for more information
(qemu) PMU Firmware 2024.1 Feb 28 2024 16:59:36
PMU_ROM Version: xpbr-v8.1.0-0

U-Boot 2024.01 (Feb 28 2024 - 15:26:19 +0000)

CPU: ZynqMP
Silicon: v3
Chip: unknown
Model: ZynqMP ZCU102 Rev1.0
Board: Xilinx ZynqMP
DRAM: 2 GiB (effective 4 GiB)
PMUFW: v1.1
EL Level: EL2
Secure Boot: not authenticated, not encrypted
Core: 71 devices, 31 uclasses, devicetree: board
Warning: Device tree includes old 'u-boot,dm-' tags: please fix by

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 262
Appendix L: PetaLinux Commands

2023.07!
NAND: 0 MiB
MMC: mmc@ff170000: 0
Loading Environment from nowhere... OK
In: serial
Out: serial,vidconsole
Err: serial,vidconsole
Bootmode: JTAG_MODE
Reset reason:
Net:
ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id

Warning: ethernet@ff0e0000 (eth0) using random MAC address -


7a:ab:e8:be:15:22
eth0: ethernet@ff0e0000
scanning bus for devices...
SATA link 0 timeout.
SATA link 1 timeout.
AHCI 0001.0000 32 slots 2 ports 1.5 Gbps 0x3 impl SATA mode
flags: 64bit ncq only
starting USB...
Bus usb@fe200000: Register 8000402 NbrPorts 8
Starting the controller
USB XHCI 1.00
scanning bus usb@fe200000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
JTAG: Trying to boot script at 20000000
## Executing script at 20000000
Trying to load boot images from jtag
## Loading init Ramdisk from Legacy Image at 04000000 ...
Image Name: petalinux-image-minimal-xilinx-z
Created: 2011-04-05 23:00:00 UTC
Image Type: AArch64 Linux RAMDisk Image (uncompressed)
Data Size: 32030528 Bytes = 30.5 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 00100000
Booting using the fdt blob at 0x100000
Working FDT set to 100000
Loading Ramdisk to 75d5b000, end 77be6f40 ... OK
Loading Device Tree to 0000000075d4a000, end 0000000075d5af56 ... OK
Working FDT set to 75d4a000

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]


[ 0.000000] Linux version 6.6.10-xilinx-v2024.1-ga33033bade74 (oe-
user@oe-host) (aarch64-xilinx-linux-gcc (GCC) 12.2.0, GNU ld (GNU
Binutils) 2.39.0.20220819) #1 SMP Fri Feb 23 11:02:20 UTC 2024
[ 0.000000] KASLR disabled due to lack of seed
[ 0.000000] Machine model: ZynqMP ZCU102 Rev1.0
[ 0.000000] earlycon: cdns0 at MMIO 0x00000000ff000000 (options
'115200n8')
[ 0.000000] printk: bootconsole [cdns0] enabled
[ 0.000000] efi: UEFI not found.
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x0000000000000000-0x00000000ffffffff]
[ 0.000000] Normal [mem 0x0000000100000000-0x000000087fffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x000000007fefffff]

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 263
Appendix L: PetaLinux Commands

[ 0.000000] node 0: [mem 0x0000000800000000-0x000000087fffffff]


[ 0.000000] Initmem setup node 0 [mem
0x0000000000000000-0x000000087fffffff]
[ 0.000000] On node 0, zone Normal: 256 pages in unavailable ranges
[ 0.000000] cma: Reserved 256 MiB at 0x0000000065c00000 on node -1
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.1 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] psci: SMC Calling Convention v1.4
[ 0.000000] percpu: Embedded 19 pages/cpu s37864 r8192 d31768 u77824
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: detected: ARM erratum 845719
[ 0.000000] alternatives: applying boot alternatives
[ 0.000000] Kernel command line: earlycon console=ttyPS0,115200
root=/dev/ram0 rw init_fatal_sh=1
[ 0.000000] Unknown kernel command line parameters "init_fatal_sh=1",
will be passed to user space.
[ 0.000000] Dentry cache hash table entries: 524288 (order: 10,
4194304 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152
bytes, linear)
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages:
1031940
[ 0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap
free:off
[ 0.000000] software IO TLB: area num 4.
[ 0.000000] software IO TLB: mapped [mem
0x000000007bf00000-0x000000007ff00000] (64MB)
[ 0.000000] Memory: 3728820K/4193280K available (15232K kernel code,
1044K rwdata, 4456K rodata, 2816K init, 445K bss, 202316K reserved,
262144K cma-reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=16 to
nr_cpu_ids=4.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is
25 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16,
nr_cpu_ids=4
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] GIC: Adjusting CPU interface base to 0x00000000f902f000
[ 0.000000] Root IRQ handler: gic_handle_irq
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on
contention.
[ 0.000000] arch_timer: cp15 timer(s) running at 65.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0x1ffffffffffffff
max_cycles: 0xefdb196da, max_idle_ns: 440795204367 ns
[ 0.000073] sched_clock: 57 bits at 65MHz, resolution 15ns, wraps
every 2199023255550ns
[ 0.009093] Console: colour dummy device 80x25
[ 0.010774] Calibrating delay loop (skipped), value calculated using
timer frequency.. 130.00 BogoMIPS (lpj=260000)
[ 0.011265] pid_max: default: 32768 minimum: 301
[ 0.014269] Mount-cache hash table entries: 8192 (order: 4, 65536
bytes, linear)
[ 0.014787] Mountpoint-cache hash table entries: 8192 (order: 4, 65536
bytes, linear)
[ 0.043467] cacheinfo: Unable to detect cache hierarchy for CPU 0
[ 0.053244] rcu: Hierarchical SRCU implementation.
[ 0.053450] rcu: Max phase no-delay instances is 1000.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 264
Appendix L: PetaLinux Commands

[ 0.056689] EFI services will not be available.


[ 0.059667] smp: Bringing up secondary CPUs ...
[ 0.067769] Detected VIPT I-cache on CPU1
[ 0.068999] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[ 0.076411] Detected VIPT I-cache on CPU2
[ 0.077000] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[ 0.081777] Detected VIPT I-cache on CPU3
[ 0.082323] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[ 0.083010] smp: Brought up 1 node, 4 CPUs
[ 0.085596] SMP: Total of 4 processors activated.
[ 0.086208] CPU features: detected: 32-bit EL0 Support
[ 0.086641] CPU features: detected: CRC32 instructions
[ 0.089517] CPU: All CPU(s) started at EL2
[ 0.089912] alternatives: applying system-wide alternatives
[ 0.112543] devtmpfs: initialized
[ 0.136227] clocksource: jiffies: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.136986] futex hash table entries: 1024 (order: 4, 65536 bytes,
linear)
[ 0.143896] pinctrl core: initialized pinctrl subsystem
[ 0.149685] DMI not present or invalid.
[ 0.156281] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[ 0.167039] DMA: preallocated 512 KiB GFP_KERNEL pool for atomic
allocations
[ 0.168304] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA32 pool for
atomic allocations
[ 0.169290] audit: initializing netlink subsys (disabled)
[ 0.171708] audit: type=2000 audit(0.156:1): state=initialized
audit_enabled=0 res=1
[ 0.175862] hw-breakpoint: found 6 breakpoint and 4 watchpoint
registers.
[ 0.177545] ASID allocator initialised with 65536 entries
[ 0.179591] Serial: AMBA PL011 UART driver
[ 0.226371] Modules: 26720 pages in range for non-PLT usage
[ 0.226404] Modules: 518240 pages in range for PLT usage
[ 0.231448] HugeTLB: registered 1.00 GiB page size, pre-allocated 0
pages
[ 0.232270] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page
[ 0.232686] HugeTLB: registered 32.0 MiB page size, pre-allocated 0
pages
[ 0.233227] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page
[ 0.233749] HugeTLB: registered 2.00 MiB page size, pre-allocated 0
pages
[ 0.234238] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page
[ 0.234783] HugeTLB: registered 64.0 KiB page size, pre-allocated 0
pages
[ 0.235279] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page
[ 0.308253] raid6: neonx8 gen() 3689 MB/s
[ 0.377575] raid6: neonx4 gen() 3108 MB/s
[ 0.449939] raid6: neonx2 gen() 2285 MB/s
[ 0.519230] raid6: neonx1 gen() 1360 MB/s
[ 0.588539] raid6: int64x8 gen() 1781 MB/s
[ 0.657864] raid6: int64x4 gen() 2288 MB/s
[ 0.727157] raid6: int64x2 gen() 1987 MB/s
[ 0.796402] raid6: int64x1 gen() 370 MB/s
[ 0.796715] raid6: using algorithm neonx8 gen() 3689 MB/s
[ 0.865691] raid6: .... xor() 1115 MB/s, rmw enabled
[ 0.866089] raid6: using neon recovery algorithm
[ 0.870127] iommu: Default domain type: Translated
[ 0.870518] iommu: DMA domain TLB invalidation policy: strict mode
[ 0.872685] SCSI subsystem initialized
[ 0.874732] usbcore: registered new interface driver usbfs
[ 0.875418] usbcore: registered new interface driver hub

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 265
Appendix L: PetaLinux Commands

[ 0.875934] usbcore: registered new device driver usb


[ 0.876895] mc: Linux media interface: v0.10
[ 0.877534] videodev: Linux video capture interface: v2.00
[ 0.878218] pps_core: LinuxPPS API ver. 1 registered
[ 0.878631] pps_core: Software ver. 5.3.6 - Copyright 2005-2007
Rodolfo Giometti <[email protected]>
[ 0.879481] PTP clock support registered
[ 0.879949] EDAC MC: Ver: 3.0.0
[ 0.883179] zynqmp-ipi-mbox mailbox@ff9905c0: Registered ZynqMP IPI
mbox with TX/RX channels.
[ 0.886355] FPGA manager framework
[ 0.887939] Advanced Linux Sound Architecture Driver Initialized.
[ 0.898259] Bluetooth: Core ver 2.22
[ 0.898890] NET: Registered PF_BLUETOOTH protocol family
[ 0.899263] Bluetooth: HCI device and connection manager initialized
[ 0.900044] Bluetooth: HCI socket layer initialized
[ 0.900448] Bluetooth: L2CAP socket layer initialized
[ 0.901050] Bluetooth: SCO socket layer initialized
[ 0.908343] clocksource: Switched to clocksource arch_sys_counter
[ 0.910155] VFS: Disk quotas dquot_6.6.0
[ 0.910533] VFS: Dquot-cache hash table entries: 512 (order 0, 4096
bytes)
[ 0.945846] NET: Registered PF_INET protocol family
[ 0.948489] IP idents hash table entries: 65536 (order: 7, 524288
bytes, linear)
[ 0.956679] tcp_listen_portaddr_hash hash table entries: 2048 (order:
3, 32768 bytes, linear)
[ 0.957373] Table-perturb hash table entries: 65536 (order: 6, 262144
bytes, linear)
[ 0.958057] TCP established hash table entries: 32768 (order: 6,
262144 bytes, linear)
[ 0.959141] TCP bind hash table entries: 32768 (order: 8, 1048576
bytes, linear)
[ 0.961592] TCP: Hash tables configured (established 32768 bind 32768)
[ 0.963486] UDP hash table entries: 2048 (order: 4, 65536 bytes,
linear)
[ 0.964548] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes,
linear)
[ 0.966276] NET: Registered PF_UNIX/PF_LOCAL protocol family
[ 0.970264] RPC: Registered named UNIX socket transport module.
[ 0.970664] RPC: Registered udp transport module.
[ 0.971029] RPC: Registered tcp transport module.
[ 0.971349] RPC: Registered tcp-with-tls transport module.
[ 0.971756] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.972522] PCI: CLS 0 bytes, default 64
[ 0.977506] Trying to unpack rootfs image as initramfs...
[ 0.981587] Initialise system trusted keyrings
[ 0.983921] workingset: timestamp_bits=46 max_order=20 bucket_order=0
[ 0.989980] NFS: Registering the id_resolver key type
[ 0.990717] Key type id_resolver registered
[ 0.990987] Key type id_legacy registered
[ 0.991500] nfs4filelayout_init: NFSv4 File Layout Driver
Registering...
[ 0.992003] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver
Registering...
[ 0.994431] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat,
Inc.
[ 1.054444] NET: Registered PF_ALG protocol family
[ 1.054985] xor: measuring software checksum speed
[ 1.061012] 8regs : 1904 MB/sec
[ 1.063793] 32regs : 4111 MB/sec
[ 1.067795] arm64_neon : 3002 MB/sec
[ 1.068050] xor: using function: 32regs (4111 MB/sec)

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 266
Appendix L: PetaLinux Commands

[ 1.068563] Key type asymmetric registered


[ 1.068865] Asymmetric key parser 'x509' registered
[ 1.069414] Block layer SCSI generic (bsg) driver version 0.4 loaded
(major 244)
[ 1.070042] io scheduler mq-deadline registered
[ 1.070368] io scheduler kyber registered
[ 1.070895] io scheduler bfq registered
[ 1.079099] irq-xilinx: mismatch in kind-of-intr param
[ 1.079432] irq-xilinx: /pl-bus/interrupt-controller@80020000:
num_irq=32, edge=0x1
[ 1.284010] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 1.294105] Serial: AMBA driver
[ 1.334199] brd: module loaded
[ 1.351360] loop: module loaded
[ 1.369618] tun: Universal TUN/TAP device driver, 1.6
[ 1.370712] CAN device driver interface
[ 1.373779] usbcore: registered new interface driver asix
[ 1.374204] usbcore: registered new interface driver ax88179_178a
[ 1.374660] usbcore: registered new interface driver cdc_ether
[ 1.375078] usbcore: registered new interface driver net1080
[ 1.375633] usbcore: registered new interface driver cdc_subset
[ 1.376059] usbcore: registered new interface driver zaurus
[ 1.376763] usbcore: registered new interface driver cdc_ncm
[ 1.377192] usbcore: registered new interface driver r8153_ecm
[ 1.378814] VFIO - User Level meta-driver version: 0.3
[ 1.382450] usbcore: registered new interface driver uas
[ 1.382946] usbcore: registered new interface driver usb-storage
[ 1.393426] rtc_zynqmp ffa60000.rtc: registered as rtc0
[ 1.394417] rtc_zynqmp ffa60000.rtc: setting system clock to
2024-03-03T06:27:29 UTC (1709447249)
[ 1.395647] i2c_dev: i2c /dev entries driver
[ 1.404861] usbcore: registered new interface driver uvcvideo
[ 1.410264] Bluetooth: HCI UART driver ver 2.3
[ 1.410649] Bluetooth: HCI UART protocol H4 registered
[ 1.410961] Bluetooth: HCI UART protocol BCSP registered
[ 1.411383] Bluetooth: HCI UART protocol LL registered
[ 1.411727] Bluetooth: HCI UART protocol ATH3K registered
[ 1.412423] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 1.412983] Bluetooth: HCI UART protocol Intel registered
[ 1.413413] Bluetooth: HCI UART protocol QCA registered
[ 1.413816] usbcore: registered new interface driver bcm203x
[ 1.414232] usbcore: registered new interface driver bpa10x
[ 1.414618] usbcore: registered new interface driver bfusb
[ 1.415066] usbcore: registered new interface driver btusb
[ 1.415589] usbcore: registered new interface driver ath3k
[ 1.416763] EDAC MC: ECC not enabled
[ 1.422343] sdhci: Secure Digital Host Controller Interface driver
[ 1.422696] sdhci: Copyright(c) Pierre Ossman
[ 1.422983] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.426805] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.427827] SMCCC: SOC_ID: ID = jep106:0049:0003 Revision = 0x04600093
[ 1.429938] zynqmp_firmware_probe Platform Management API v1.1
[ 1.431841] zynqmp_firmware_probe Trustzone version v1.0
[ 1.766922] securefw securefw: securefw probed
[ 1.769695] zynqmp-aes zynqmp-aes.0: will run requests pump with
realtime priority
[ 1.774927] usbcore: registered new interface driver usbhid
[ 1.775294] usbhid: USB HID core driver
[ 1.795283] xilinx-ams ffa50000.ams: error -ETIMEDOUT: failed to
initialize AMS
[ 1.795949] xilinx-ams: probe of ffa50000.ams failed with error -110
[ 1.802313] ARM CCI_400_r1 PMU driver probed
[ 1.806651] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 267
Appendix L: PetaLinux Commands

counters available
[ 1.814360] fpga_manager fpga0: Xilinx ZynqMP FPGA Manager registered
[ 1.821086] usbcore: registered new interface driver snd-usb-audio
[ 1.825375] pktgen: Packet Generator for packet performance testing.
Version: 2.75
[ 1.834591] Initializing XFRM netlink socket
[ 1.835432] NET: Registered PF_INET6 protocol family
[ 1.845767] Segment Routing with IPv6
[ 1.846224] In-situ OAM (IOAM) with IPv6
[ 1.847511] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 1.851114] NET: Registered PF_PACKET protocol family
[ 1.851573] NET: Registered PF_KEY protocol family
[ 1.852423] can: controller area network core
[ 1.853105] NET: Registered PF_CAN protocol family
[ 1.853472] can: raw protocol
[ 1.853876] can: broadcast manager protocol
[ 1.854284] can: netlink gateway - max_hops=1
[ 1.855379] Bluetooth: RFCOMM TTY layer initialized
[ 1.856700] Bluetooth: RFCOMM socket layer initialized
[ 1.857096] Bluetooth: RFCOMM ver 1.11
[ 1.857400] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 1.857809] Bluetooth: BNEP filters: protocol multicast
[ 1.858232] Bluetooth: BNEP socket layer initialized
[ 1.858629] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 1.859022] Bluetooth: HIDP socket layer initialized
[ 1.860390] 8021q: 802.1Q VLAN Support v1.8
[ 1.861832] 9pnet: Installing 9P2000 support
[ 1.862332] Key type dns_resolver registered
[ 1.879374] registered taskstats version 1
[ 1.879679] Loading compiled-in X.509 certificates
[ 1.927140] Btrfs loaded, zoned=no, fsverity=no
[ 1.930626] alg: No test for xilinx-zynqmp-rsa (zynqmp-rsa)
[ 3.072684] Freeing initrd memory: 31276K
[ 3.545030] ff000000.serial: ttyPS0 at MMIO 0xff000000 (irq = 23,
base_baud = 2169921) is a xuartps
[ 3.547482] printk: console [ttyPS0] enabled
[ 3.547482] printk: console [ttyPS0] enabled
[ 3.548566] printk: bootconsole [cdns0] disabled
[ 3.548566] printk: bootconsole [cdns0] disabled
[ 3.559152] ff010000.serial: ttyPS1 at MMIO 0xff010000 (irq = 24,
base_baud = 2169921) is a xuartps
[ 3.561981] of-fpga-region fpga-full: FPGA Region probed
[ 3.590351] nwl-pcie fd0e0000.pcie: host bridge /axi/pcie@fd0e0000
ranges:
[ 3.591605] nwl-pcie fd0e0000.pcie: MEM
0x00e0000000..0x00efffffff -> 0x00e0000000
[ 3.592709] nwl-pcie fd0e0000.pcie: MEM
0x0600000000..0x07ffffffff -> 0x0600000000
[ 3.595798] nwl-pcie fd0e0000.pcie: Link is UP
[ 3.603415] nwl-pcie fd0e0000.pcie: PCI host bridge to bus 0000:00
[ 3.604420] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 3.605111] pci_bus 0000:00: root bus resource [mem
0xe0000000-0xefffffff]
[ 3.605641] pci_bus 0000:00: root bus resource [mem
0x600000000-0x7ffffffff pref]
[ 3.634766] xilinx-zynqmp-dpdma fd4c0000.dma-controller: Xilinx DPDMA
engine is probed
[ 3.644712] spi-nor spi0.0: found n25q512a, expected m25p80
[ 3.651174] spi-nor spi0.0: n25q512a (131072 Kbytes)
[ 3.653182] 3 fixed-partitions partitions found on MTD device spi0.0
[ 3.653766] Creating 3 MTD partitions on "spi0.0":
[ 3.654202] 0x000000000000-0x000001e00000 : "qspi-boot"
[ 3.660746] 0x000001e00000-0x000001e40000 : "qspi-bootenv"

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 268
Appendix L: PetaLinux Commands

[ 3.663527] 0x000001e40000-0x000004240000 : "qspi-kernel"


[ 3.720577] macb ff0e0000.ethernet: GEM doesn't support hardware ptp.
[ 3.786596] xilinx-axipmon ffa00000.perf-monitor: Probed Xilinx APM
[ 3.788789] xilinx-axipmon fd0b0000.perf-monitor: Probed Xilinx APM
[ 3.790328] xilinx-axipmon fd490000.perf-monitor: Probed Xilinx APM
[ 3.791765] xilinx-axipmon ffa10000.perf-monitor: Probed Xilinx APM
[ 3.802418] i2c i2c-0: using pinctrl states for GPIO recovery
[ 3.809787] i2c i2c-0: using generic GPIOs for recovery
[ 3.819026] pca953x 0-0020: supply vcc not found, using dummy regulator
[ 3.821009] pca953x 0-0020: using no AI
[ 3.827811] pca953x 0-0021: supply vcc not found, using dummy regulator
[ 3.828708] pca953x 0-0021: using no AI
[ 3.831581] pca954x 0-0075: supply vdd not found, using dummy regulator
[ 3.855646] i2c i2c-0: Added multiplexed i2c bus 2
[ 3.871934] i2c i2c-0: Added multiplexed i2c bus 3
[ 3.879973] max20751 4-0072: Failed to identify chip capabilities
[ 3.884195] max20751 4-0073: Failed to identify chip capabilities
[ 3.884988] i2c i2c-0: Added multiplexed i2c bus 4
[ 3.886019] i2c i2c-0: Added multiplexed i2c bus 5
[ 3.886581] pca954x 0-0075: registered 4 multiplexed busses for I2C
mux pca9544
[ 3.887471] cdns-i2c ff020000.i2c: 400 kHz mmio ff020000 irq 51
[ 3.897005] i2c i2c-1: using pinctrl states for GPIO recovery
[ 3.902506] i2c i2c-1: using generic GPIOs for recovery
[ 3.909841] pca954x 1-0074: supply vdd not found, using dummy regulator
[ 3.912370] at24 6-0054: supply vcc not found, using dummy regulator
[ 3.915208] at24 6-0054: 1024 byte 24c08 EEPROM, writable, 1 bytes/
write
[ 3.915905] i2c i2c-1: Added multiplexed i2c bus 6
[ 3.918876] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.919574] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.920052] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.920769] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.921282] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.921826] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.922415] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.922939] si5341 7-0036: no regulator set, defaulting vdd_sel to
2.5V for out
[ 3.926419] si5341 7-0036: Chip: 5341 Grade: 0 Rev: 0
[ 4.020798] i2c i2c-1: Added multiplexed i2c bus 7
[ 4.032443] si570 8-005d: registered, current frequency 300000000 Hz
[ 4.033213] i2c i2c-1: Added multiplexed i2c bus 8
[ 4.042245] si570 9-005d: registered, current frequency 156250000 Hz
[ 4.043015] i2c i2c-1: Added multiplexed i2c bus 9
[ 4.044878] si5324 10-0069: si5328 probed
[ 4.124648] si5324 10-0069: si5328 probe successful
[ 4.125483] i2c i2c-1: Added multiplexed i2c bus 10
[ 4.126800] i2c i2c-1: Added multiplexed i2c bus 11
[ 4.127946] i2c i2c-1: Added multiplexed i2c bus 12
[ 4.129329] i2c i2c-1: Added multiplexed i2c bus 13
[ 4.129774] pca954x 1-0074: registered 8 multiplexed busses for I2C
switch pca9548
[ 4.131107] pca954x 1-0075: supply vdd not found, using dummy regulator
[ 4.133222] i2c i2c-1: Added multiplexed i2c bus 14
[ 4.134386] i2c i2c-1: Added multiplexed i2c bus 15
[ 4.135522] i2c i2c-1: Added multiplexed i2c bus 16

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 269
Appendix L: PetaLinux Commands

[ 4.136886] i2c i2c-1: Added multiplexed i2c bus 17


[ 4.138056] i2c i2c-1: Added multiplexed i2c bus 18
[ 4.139187] i2c i2c-1: Added multiplexed i2c bus 19
[ 4.140705] i2c i2c-1: Added multiplexed i2c bus 20
[ 4.141881] i2c i2c-1: Added multiplexed i2c bus 21
[ 4.142254] pca954x 1-0075: registered 8 multiplexed busses for I2C
switch pca9548
[ 4.143025] cdns-i2c ff030000.i2c: 400 kHz mmio ff030000 irq 52
[ 4.160778] cdns-wdt fd4d0000.watchdog: Xilinx Watchdog Timer with
timeout 60s
[ 4.162627] cdns-wdt ff150000.watchdog: Xilinx Watchdog Timer with
timeout 10s
[ 4.171837] cpufreq: cpufreq_online: CPU0: Running at unlisted initial
frequency: 277750 KHz, changing to: 299999 KHz
[ 4.188738] zynqmp-display fd4a0000.display: vtc bridge property not
present
[ 4.262774] xilinx-dp-snd-codec fd4a0000.display:zynqmp-dp-snd-codec0:
Xilinx DisplayPort Sound Codec probed
[ 4.265931] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm0: Xilinx DisplayPort
Sound PCM probed
[ 4.267584] xilinx-dp-snd-pcm zynqmp_dp_snd_pcm1: Xilinx DisplayPort
Sound PCM probed
[ 4.290181] xilinx-dp-snd-card fd4a0000.display:zynqmp-dp-snd-card:
Xilinx DisplayPort Sound Card probed
[ 4.298911] xlnx-drm xlnx-drm.0: bound fd4a0000.display (ops
0xffff800080fce768)
[ 4.318953] mmc0: SDHCI controller on ff170000.mmc [ff170000.mmc]
using ADMA 64-bit
[ 4.366908] mmc0: new high speed SD card at address 4567
[ 4.370509] mmcblk0: mmc0:4567 QEMU! 256 MiB
[ 4.463373] Console: switching to colour frame buffer device 160x50
[ 4.494907] zynqmp-display fd4a0000.display: [drm] fb0: xlnxdrmfb
frame buffer device
[ 4.498672] [drm] Initialized xlnx 1.0.0 20130509 for fd4a0000.display
on minor 0
[ 4.499473] zynqmp-display fd4a0000.display: ZynqMP DisplayPort
Subsystem driver probed
[ 4.502293] ahci-ceva fd0c0000.ahci: supply ahci not found, using
dummy regulator
[ 4.503064] ahci-ceva fd0c0000.ahci: supply phy not found, using dummy
regulator
[ 4.504408] ahci-ceva fd0c0000.ahci: supply target not found, using
dummy regulator
[ 4.509945] ahci-ceva fd0c0000.ahci: AHCI 0001.0000 32 slots 2 ports
1.5 Gbps 0x3 impl platform mode
[ 4.510670] ahci-ceva fd0c0000.ahci: flags: 64bit ncq only
[ 4.517222] scsi host0: ahci-ceva
[ 4.519851] scsi host1: ahci-ceva
[ 4.520805] ata1: SATA max UDMA/133 mmio [mem 0xfd0c0000-0xfd0c1fff]
port 0x100 irq 57
[ 4.521385] ata2: SATA max UDMA/133 mmio [mem 0xfd0c0000-0xfd0c1fff]
port 0x180 irq 57
[ 4.562350] macb ff0e0000.ethernet: GEM doesn't support hardware ptp.
[ 4.585696] macb ff0e0000.ethernet eth0: Cadence GEM rev 0x40070106 at
0xff0e0000 irq 49 (7a:ab:e8:be:15:22)
[ 4.801189] dwc3 fe200000.usb: UDC doesn't support Gen 1
[ 4.806343] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[ 4.807220] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned
bus number 1
[ 4.812375] xhci-hcd xhci-hcd.1.auto: hcc params 0x00087001 hci
version 0x100 quirks 0x0000000000000810
[ 4.813376] xhci-hcd xhci-hcd.1.auto: irq 58, io mem 0xfe200000
[ 4.815774] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 270
Appendix L: PetaLinux Commands

[ 4.816482] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned


bus number 2
[ 4.817098] xhci-hcd xhci-hcd.1.auto: Host supports USB 3.0 SuperSpeed
[ 4.822676] usb usb1: New USB device found, idVendor=1d6b,
idProduct=0002, bcdDevice= 6.06
[ 4.823282] usb usb1: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[ 4.823842] usb usb1: Product: xHCI Host Controller
[ 4.824360] usb usb1: Manufacturer: Linux 6.6.10-xilinx-v2024.1-
ga33033bade74 xhci-hcd
[ 4.824997] usb usb1: SerialNumber: xhci-hcd.1.auto
[ 4.830107] hub 1-0:1.0: USB hub found
[ 4.831203] hub 1-0:1.0: 4 ports detected
[ 4.835582] usb usb2: We don't know the algorithms for LPM for this
host, disabling LPM.
[ 4.836881] usb usb2: New USB device found, idVendor=1d6b,
idProduct=0003, bcdDevice= 6.06
[ 4.837539] usb usb2: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[ 4.838115] usb usb2: Product: xHCI Host Controller
[ 4.838456] usb usb2: Manufacturer: Linux 6.6.10-xilinx-v2024.1-
ga33033bade74 xhci-hcd
[ 4.839024] usb usb2: SerialNumber: xhci-hcd.1.auto
[ 4.840591] hub 2-0:1.0: USB hub found
[ 4.841205] hub 2-0:1.0: 4 ports detected
[ 4.841693] ata2: SATA link down (SStatus 0 SControl 300)
[ 4.843157] ata1: SATA link down (SStatus 0 SControl 300)
[ 4.855038] input: gpio-keys as /devices/platform/gpio-keys/input/
input0
[ 4.858747] of_cfs_init
[ 4.859300] of_cfs_init: OK
[ 4.860532] clk: Disabling unused clocks
[ 4.913447] ALSA device list:
[ 4.913880] #0: DP mon
[ 5.037061] Freeing unused kernel memory: 2816K
[ 5.045827] Run /init as init process
[ 5.167418] systemd[1]: systemd 251.8+ running in system mode (+PAM -
AUDIT -SELINUX -APPARMOR +IMA -SMACK +SECCOMP -GCRYPT -GNUTLS -OPENSSL
+ACL +BLKID -CURL -ELFUTILS -FIDO2 -IDN2 -IDN -IPTC +KMOD -LIBCRYPTSETUP
+LIBFDISK -PCRE2 -PWQUALITY -P11KIT -QRENCODE -TPM2 -BZIP2 -LZ4 -XZ -ZLIB
+ZSTD -BPF_FRAMEWORK +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=hybrid)
[ 5.170418] systemd[1]: Detected architecture arm64.

Welcome to PetaLinux 2024.1+release-S02291836 (langdale)!

[ 5.245887] systemd[1]: Hostname set to <xilinx-zcu102-20241>.


[ 5.247679] systemd[1]: Initializing machine ID from random generator.
[ 5.538654] systemd-sysv-generator[197]: SysV service '/etc/init.d/
sshd' lacks a native systemd unit file. Automatically generating a unit
file for compatibility. Please update package to include a native systemd
unit file, in order to make it more safe and robust.
[ 5.546315] systemd-sysv-generator[197]: SysV service '/etc/init.d/
nfsserver' lacks a native systemd unit file. Automatically generating a
unit file for compatibility. Please update package to include a native
systemd unit file, in order to make it more safe and robust.
[ 5.549985] systemd-sysv-generator[197]: SysV service '/etc/init.d/
inetd.busybox' lacks a native systemd unit file. Automatically generating
a unit file for compatibility. Please update package to include a native
systemd unit file, in order to make it more safe and robust.
[ 6.168734] systemd[1]: Queued start job for default target Multi-User
System.
[ 6.330120] systemd[1]: Created slice Slice /system/getty.
[ OK ] Created slice Slice /system/getty.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 271
Appendix L: PetaLinux Commands

[ 6.339265] systemd[1]: Created slice Slice /system/modprobe.


[ OK ] Created slice Slice /system/modprobe.
[ 6.345222] systemd[1]: Created slice Slice /system/serial-getty.
[ OK ] Created slice Slice /system/serial-getty.
[ 6.350835] systemd[1]: Created slice User and Session Slice.
[ OK ] Created slice User and Session Slice.
[ 6.354937] systemd[1]: Started Dispatch Password Requests to Console
Directory Watch.
[ OK ] Started Dispatch Password …ts to Console Directory Watch.
[ 6.359096] systemd[1]: Started Forward Password Requests to Wall
Directory Watch.
[ OK ] Started Forward Password R…uests to Wall Directory Watch.
[ 6.361975] systemd[1]: Reached target Path Units.
[ OK ] Reached target Path Units.
[ 6.363658] systemd[1]: Reached target Remote File Systems.
[ OK ] Reached target Remote File Systems.
[ 6.365567] systemd[1]: Reached target Slice Units.
[ OK ] Reached target Slice Units.
[ 6.367431] systemd[1]: Reached target Swaps.
[ OK ] Reached target Swaps.
[ 6.377962] systemd[1]: Listening on RPCbind Server Activation Socket.
[ OK ] Listening on RPCbind Server Activation Socket.
[ 6.380054] systemd[1]: Reached target RPC Port Mapper.
[ OK ] Reached target RPC Port Mapper.
[ 6.383482] systemd[1]: Listening on Syslog Socket.
[ OK ] Listening on Syslog Socket.
[ 6.386642] systemd[1]: Listening on initctl Compatibility Named Pipe.
[ OK ] Listening on initctl Compatibility Named Pipe.
[ 6.391194] systemd[1]: Listening on Journal Audit Socket.
[ OK ] Listening on Journal Audit Socket.
[ 6.394471] systemd[1]: Listening on Journal Socket (/dev/log).
[ OK ] Listening on Journal Socket (/dev/log).
[ 6.397747] systemd[1]: Listening on Journal Socket.
[ OK ] Listening on Journal Socket.
[ 6.401619] systemd[1]: Listening on Network Service Netlink Socket.
[ OK ] Listening on Network Service Netlink Socket.
[ 6.405110] systemd[1]: Listening on udev Control Socket.
[ OK ] Listening on udev Control Socket.
[ 6.407882] systemd[1]: Listening on udev Kernel Socket.
[ OK ] Listening on udev Kernel Socket.
[ 6.410860] systemd[1]: Listening on User Database Manager Socket.
[ OK ] Listening on User Database Manager Socket.
[ 6.455055] systemd[1]: Mounting Huge Pages File System...
Mounting Huge Pages File System...
[ 6.471137] systemd[1]: Mounting POSIX Message Queue File System...
Mounting POSIX Message Queue File System...
[ 6.490135] systemd[1]: Mounting Kernel Debug File System...
Mounting Kernel Debug File System...
[ 6.494443] systemd[1]: Kernel Trace File System was skipped because
of a failed condition check (ConditionPathExists=/sys/kernel/tracing).
[ 6.510109] systemd[1]: Mounting Temporary Directory /tmp...
Mounting Temporary Directory /tmp...
[ 6.514799] systemd[1]: Create List of Static Device Nodes was skipped
because of a failed condition check (ConditionFileNotEmpty=/lib/modules/
6.6.10-xilinx-v2024.1-ga33033bade74/modules.devname).
[ 6.533722] systemd[1]: Starting Load Kernel Module configfs...
Starting Load Kernel Module configfs...
[ 6.551634] systemd[1]: Starting Load Kernel Module drm...
Starting Load Kernel Module drm...
[ 6.569737] systemd[1]: Starting Load Kernel Module fuse...
Starting Load Kernel Module fuse...
[ 6.592730] systemd[1]: Starting RPC Bind...
Starting RPC Bind...

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 272
Appendix L: PetaLinux Commands

[ 6.595922] systemd[1]: File System Check on Root Device was skipped


because of a failed condition check (ConditionPathIsReadWrite=!/).
[ 6.599999] systemd[1]: systemd-journald.service: unit configures an
IP firewall, but the local system does not support BPF/cgroup firewalling.
[ 6.601138] systemd[1]: (This warning is only shown for the first unit
using IP firewalling.)
[ 6.622305] systemd[1]: Starting Journal Service...
Starting Journal Service...
[ 6.627958] systemd[1]: Load Kernel Modules was skipped because all
trigger condition checks failed.
[ 6.641348] systemd[1]: Mounting NFSD configuration filesystem...
Mounting NFSD configuration filesystem...
[ 6.661359] systemd[1]: Starting Generate network units from Kernel
command line...
Starting Generate network …ts from Kernel command line...
[ 6.679891] systemd[1]: Starting Remount Root and Kernel File
Systems...
Starting Remount Root and Kernel File Systems...
[ 6.695042] systemd[1]: Starting Apply Kernel Variables...
Starting Apply Kernel Variables...
[ 6.711333] systemd[1]: Starting Coldplug All udev Devices...
Starting Coldplug All udev Devices...
[ 6.742711] systemd[1]: Started RPC Bind.
[ OK ] Started RPC Bind.
[ 6.750515] systemd[1]: Mounted Huge Pages File System.
[ OK ] Mounted Huge Pages File System.
[ 6.754628] systemd[1]: Mounted POSIX Message Queue File System.
[ OK ] Mounted POSIX Message Queue File System.
[ 6.759304] systemd[1]: Mounted Kernel Debug File System.
[ OK ] Mounted Kernel Debug File System.
[ 6.763840] systemd[1]: Mounted Temporary Directory /tmp.
[ OK ] Mounted Temporary Directory /tmp.
[ 6.773165] systemd[1]: [email protected]: Deactivated
successfully.
[ 6.780646] systemd[1]: Finished Load Kernel Module configfs.
[ OK ] Finished Load Kernel Module configfs.
[ 6.791298] systemd[1]: [email protected]: Deactivated successfully.
[ 6.801734] systemd[1]: Finished Load Kernel Module drm.
[ OK ] Finished Load Kernel Module drm.
[ 6.810220] systemd[1]: [email protected]: Deactivated
successfully.
[ 6.813974] systemd[1]: Finished Load Kernel Module fuse.
[ OK ] Finished Load Kernel Module fuse.
[ 6.823510] systemd[1]: Mounted NFSD configuration filesystem.
[ OK ] Mounted NFSD configuration filesystem.
[ 6.836737] systemd[1]: Finished Generate network units from Kernel
command line.
[ OK ] Finished Generate network units from Kernel command line.
[ 6.850850] systemd[1]: Finished Apply Kernel Variables.
[ OK ] Finished Apply Kernel Variables.
[ 6.856718] systemd[1]: Finished Remount Root and Kernel File Systems.
[ OK ] Finished Remount Root and Kernel File Systems.
[ 6.861908] systemd[1]: Reached target Preparation for Network.
[ OK ] Reached target Preparation for Network.
[ 6.866159] systemd[1]: FUSE Control File System was skipped because
of a failed condition check (ConditionPathExists=/sys/fs/fuse/
connections).
[ 6.897806] systemd[1]: Mounting Kernel Configuration File System...
Mounting Kernel Configuration File System...
[ 6.902761] systemd[1]: Rebuild Hardware Database was skipped because
all trigger condition checks failed.
[ 6.904894] systemd[1]: Platform Persistent Storage Archival was
skipped because of a failed condition check

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 273
Appendix L: PetaLinux Commands

(ConditionDirectoryNotEmpty=/sys/fs/pstore).
[ 6.919371] systemd[1]: Starting Create System Users...
Starting Create System Users...
[ 6.932749] systemd[1]: Mounted Kernel Configuration File System.
[ OK ] Mounted Kernel Configuration File System.
[ 6.998137] systemd[1]: Finished Create System Users.
[ OK ] Finished Create System Users.
[ 7.030533] systemd[1]: Starting Create Static Device Nodes in /dev...
Starting Create Static Device Nodes in /dev...
[ 7.096340] systemd[1]: Finished Create Static Device Nodes in /dev.
[ OK ] Finished Create Static Device Nodes in /dev.
[ 7.099360] systemd[1]: Reached target Preparation for Local File
Systems.
[ OK ] Reached target Preparation for Local File Systems.
[ 7.138912] systemd[1]: Starting Rule-based Manager for Device Events
and Files...
Starting Rule-based Manage…for Device Events and Files...
[ 7.207203] systemd[1]: Started Journal Service.
[ OK ] Started Journal Service.
Starting Flush Journal to Persistent Storage...
[ 7.314674] systemd-journald[207]: Received client request to flush
runtime journal.
[ OK ] Finished Flush Journal to Persistent Storage.
[ OK ] Started Rule-based Manager for Device Events and Files.
Starting Network Configuration...
[ 7.749524] cfg80211: Loading compiled-in X.509 certificates for
regulatory database
Mounting /var/volatile...
[ 7.829719] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 7.830955] Loaded X.509 cert 'wens:
61c038651aabdcf94bd0ac7ff06c7248db18c600'
[ 7.834412] platform regulatory.0: Direct firmware load for
regulatory.db failed with error -2
[ 7.835334] cfg80211: failed to load regulatory.db
[ OK ] Mounted /var/volatile.
Starting Load/Save Random Seed...
[ OK ] Reached target Local File Systems.
Starting Rebuild Dynamic Linker Cache...
Starting Create Volatile Files and Directories...
[ OK ] Started Network Configuration.
[ OK ] Finished Rebuild Dynamic Linker Cache.
[ OK ] Finished Create Volatile Files and Directories.
Starting Run pending postinsts...
Starting Rebuild Journal Catalog...
Starting Network Name Resolution...
[ 8.439941] Unloading old XRT Linux kernel modules
Starting Network Time Synchronization...
Starting Record System Boot/Shutdown in UTMP...
[ 8.514064] Loading new XRT Linux kernel modules
[ 8.557065] zocl: loading out-of-tree module taints kernel.
[ 8.578353] [drm] Probing for xlnx,zocl
[ 8.594024] zocl-drm zyxclmm_drm: error -ENXIO: IRQ index 32 not found
[ 8.596668] [drm] FPGA programming device pcap founded.
[ 8.597239] [drm] PR[0] Isolation addr 0x0
[ 8.609837] [drm] Initialized zocl 2.15.0 20240303 for zyxclmm_drm on
minor 1
[ OK ] Finished Rebuild Journal Catalog.
Starting Update is Completed...
[ 8.846014] INFO: Creating ICD entry for Xilinx Platform
[ OK ] Finished Record System Boot/Shutdown in UTMP.
[ OK ] Finished Update is Completed.
[ 9.209176] random: crng init done
[ OK ] Finished Load/Save Random Seed.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 274
Appendix L: PetaLinux Commands

[ OK ]Finished Run pending postinsts.


[ OK ]Started Network Time Synchronization.
[ OK ]Reached target System Time Set.
[ OK ]Started Network Name Resolution.
[ OK ]Reached target Network.
[ OK ]Reached target Host and Network Name Lookups.
[ OK ]Started NFS status monitor for NFSv2/3 locking..
[ OK ]Finished Coldplug All udev Devices.
[ OK ]Reached target System Initialization.
[ OK ]Started Daily Cleanup of Temporary Directories.
[ OK ]Reached target Timer Units.
[ OK ]Listening on D-Bus System Message Bus Socket.
Starting sshd.socket...
[ OK ] Listening on sshd.socket.
[ 13.273702] macb ff0e0000.ethernet eth0: PHY [ff0e0000.ethernet-
ffffffff:0c] driver [TI DP83867] (irq=POLL)
[ 13.274781] macb ff0e0000.ethernet eth0: configuring for phy/rgmii-id
link mode
[ 13.300793] macb ff0e0000.ethernet eth0: Link is Up - 1Gbps/Full -
flow control tx
[ OK ] Reached target Socket Units.
[ OK ] Reached target Basic System.
[ OK ] Reached target Sound Card.
[ OK ] Listening on Load/Save RF …itch Status /dev/rfkill Watch.
[ OK ] Started Kernel Logging Service.
[ OK ] Started System Logging Service.
Starting D-Bus System Message Bus...
Starting inetd.busybox.service...
Starting LSB: Kernel NFS server support...
Starting User Login Management...
Starting Permit User Sessions...
Starting Target Communication Framework agent...
Starting OpenSSH Key Generation...
[ OK ] Started D-Bus System Message Bus.
[ OK ] Started inetd.busybox.service.
[ OK ] Finished Permit User Sessions.
[ OK ] Started Target Communication Framework agent.
[ OK ] Started Getty on tty1.
[ OK ] Started Serial Getty on ttyPS0.
[ OK ] Reached target Login Prompts.
[ OK ] Created slice Slice /system/systemd-fsck.
[ OK ] Found device /dev/mmcblk0.
Starting File System Check on /dev/mmcblk0...
[ OK ] Finished File System Check on /dev/mmcblk0.
[ OK ] Started User Login Management.
Mounting /run/media/mmcblk0...
[ 19.278211] EXT4-fs (mmcblk0): mounted filesystem
12f97fb1-20f5-42b9-8353-d38f2b48caba r/w with ordered data mode. Quota
mode: none.
[ OK ] Mounted /run/media/mmcblk0.
[ 19.334491] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state
recovery directory
[ 19.335365] NFSD: Using legacy client tracking operations.
[ 19.335720] NFSD: starting 90-second grace period (net f0000000)
[FAILED] Failed to start LSB: Kernel NFS server support.
See 'systemctl status nfsserver.service' for details.
[ OK ] Reached target Multi-User System.
Starting Record Runlevel Change in UTMP...
[ OK ] Finished Record Runlevel Change in UTMP.
[ OK ] Finished OpenSSH Key Generation.

**************************************************************************
******************

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 275
Appendix L: PetaLinux Commands

The PetaLinux source code and images provided/generated are for


demonstration purposes only.
**************************************************************************
******************
PetaLinux 2024.1+release-S02291836 xilinx-zcu102-20241 ttyPS0

xilinx-zcu102-20241 login: petalinux


You are required to change your password immediately (administrator
enforced).
New password:
Retype new password:
[ 34.854753] audit: type=1006 audit(1709447282.955:2): pid=652 uid=0
old-auid=4294967295 auid=1000 tty=(none) old-ses=4294967295 ses=1 res=1
[ 34.855446] audit: type=1300 audit(1709447282.955:2): arch=c00000b7
syscall=64 success=yes exit=4 a0=8 a1=fffff369d650 a2=4 a3=1 items=0
ppid=1 pid=652 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0
fsgid=0 tty=(none) ses=1 comm="(systemd)" exe="/lib/systemd/systemd"
key=(null)
[ 34.856979] audit: type=1327 audit(1709447282.955:2):
proctitle="(systemd)"
[ 34.969548] systemd[652]: memfd_create() called without MFD_EXEC or
MFD_NOEXEC_SEAL set
xilinx-zcu102-20241:~$

• Specify this option to disable GDB through QEMU boot

petalinux-package
The petalinux-package tool packages a PetaLinux project into a format suitable for
deployment. The tool provides several workflows whose operations vary depending on the target
package format. The supported formats/workflows are boot, bsp, sysroot, wicand pre-
built. The petalinux-package tool is executed using the package type name to specify a
specific workflow in the format petalinux-package PACKAGETYPE.

• The boot package type creates a file (.BIN or .MCS) that allows the target device to boot.
• The bsp package type creates a .bsp file which includes the entire contents of the target
PetaLinux project. This option allows you to export and re-use your bsp.
• The pre-built package type creates a new directory within the target PetaLinux project
called "pre-built" and contains prebuilt content that is useful for booting directly on a physical
board. This package type is commonly used as a precursor for creating a bsp package type.
• The wic Packages the SD bootable image.
• The sysroot package type installs the sysroot for the AMD Vitis™ software platform. It can
specify the installer path and also install directory path.

You are required to install AMD Vivado™ Design Suite on the same machine as PetaLinux to use
petalinux-boot for the MCS format for MicroBlaze™ processor. By default, the petalinux-
package tool loads default files from the <plnx-proj-root>/images/linux/ directory.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 276
Appendix L: PetaLinux Commands

petalinux-package Command Line Options


The following table details the command line options that are common to all of the petalinux-
package workflows.

Table 53: petalinux-package Command Line Options

Option Functional Description Value Range Default Value


-p, --project PetaLinux project directory path. This is optional. User-specified Current Directory
PROJECT
-h, --help Display usage information. This is optional. None None

petalinux-package boot
The petalinux-package boot command generates a bootable image that can be used
directly with AMD Versal™ adaptive SoC, AMD Zynq™ UltraScale+™ MPSoC and Zynq 7000
devices, and also with MicroBlaze™-based FPGA designs. For devices in the Zynq series, bootable
format is BOOT.BIN which can be booted from an SD card. For MicroBlaze-based designs, the
default format is an MCS PROM file suitable for programming using AMD Vivado™ Design Suite
or other PROM programmer.

For devices in the Zynq series, this workflow is a wrapper around the bootgen utility provided
with the Vitis software platform. For MicroBlaze-based FPGA designs, this workflow is a wrapper
around the corresponding Vivado Tcl commands and generates an MCS formatted programming
file. This MCS file can be programmed directly to a target board and booted.

petalinux-package boot Command Options


The following table details the options that are valid when creating a bootable image with the
petalinux-package boot command:

Table 54: petalinux-package boot Command Options

Option Functional Description Value Range Default Value


--format FORMAT Image file format to generate. This is • BIN BIN
optional.
• MCS
• DOWNLOAD.BIT

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 277
Appendix L: PetaLinux Commands

Table 54: petalinux-package boot Command Options (cont'd)

Option Functional Description Value Range Default Value


--fsbl FSBL Path on disk to FSBL elf binary. This is User-specified • zynqmp_fsb
required. To skip loading FSBL, use -- l.elf for
fsbl no or --fsbl none. This is AMD Zynq™
optional. UltraScale+™
MPSoC
• zynq_fsbl.
elf for
Zynq 7000
device
• fs-
boot.elf for
MicroBlaze™
processor
The default
image is in
<plnx-proj-
root>/images/
linux.
--force Overwrite existing files on disk. This is None None
optional.
--fpga BITSTREAM1 Path on disk to bitstream file. This is User-specified <plnx-proj-
optional.To skip loading BITSTREAM , use - root>/images/
-fpga no or - -fpga none linux/
system.bit
--atf TF-A-IMG Path on disk to Arm® trusted firmware elf User-specified <plnx-proj-
binary. This is optional. To skip loading TF- root>/images/
A, use --atf no or --atf none linux/
bl31.elf
--u-boot UBOOT-IMG Path on disk to U-Boot binary. This is User-specified • u-boot.elf
optional. for Zynq
device
• u-boot-
s.bin for
MicroBlaze
CPUs
The default
image is in
<plnx-proj-
root>/images/
linux
--kernel KERNEL-IMG Path on disk to Linux kernel image. This is User-specified <plnx-proj-
optional. root>/images/
linux/
image.ub
--boot-script BOOT- Path to the boot.scr file location. This is User-specified <plnx-proj-
SCRIPT optional. root>/images/
linux/
boot.scr
--qemu-rootfs ROOTFS- Path to the rootfs file location to create User specified <plnx-proj-
CPIO-FILE qemu_boot.img (cpio.gz.u-boot). Only root>/images/
valid for the Versal adaptive SoC to linux/
generate the QEMU SD image. rootfs.cpio.g
z.u-boot

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 278
Appendix L: PetaLinux Commands

Table 54: petalinux-package boot Command Options (cont'd)

Option Functional Description Value Range Default Value


--pmufw PMUFW-ELF Optional and applicable only for AMD User-specified <plnx-proj-
Zynq™ UltraScale+™ MPSoC. By default, root>/images/
prebuilt PMU firmware image is packed. linux/
Use this option to either specify a path for pmufw.elf
PMU firmware image or to skip packing of
PMU firmware. To skip packing PMU
firmware, use --pmufw no.
--plm PLM-ELF Optional and applicable only for AMD User-specified <plnx-proj-
Versal™ adaptive SoC. By default, prebuilt root>/images/
PLM image is packed. Use this option to linux/plm.elf
either specify a path for PLM image or to
skip packing of PLM. To skip packing PLM,
use --plm no.
--psmfw PSMFW-ELF Optional and applicable only for Versal User-specified <plnx-proj-
adaptive SoC. By default, prebuilt PSM root>/images/
firmware image is packed. Use this option linux/
to either specify a path for PSM firmware psmfw.elf
image or to skip packing of PSM firmware.
To skip packing PSM firmware, use --
psmfw no.
--addcdo CDOFILE Path on disk to add .cdo file pack into User-specified None
BOOT.BIN.
--add DATAFILE Path on disk to arbitrary data to include. User-specified None
This is optional.
--offset OFFSET Offset at which to load the prior data file. User-specified None
Only the .elf files are parsed. This is
optional.
--load <LOADADDR> Load address for specified data file. The User-specified None
RAM address where to load the specified
data file.
Example: [ partition_type=raw,
load=0x01000 ] <image>
--mmi MMIFILE Bitstream MMI file, valid for MicroBlaze User-specified MMI in directory
CPUs only. It is used to generate the with FPGA
download.bit with boot loader in the bitstream
block RAM. Default is the MMI file in the
same directory as the FPGA bitstream. This
is optional
--flash-size SIZE Flash size in MB. Must be a power-of-2. User-specified Auto-detect from
Valid for MicroBlaze processor only. Not system
needed for parallel flash types. Ensure you configuration. If
pass digit value to this option. Do not it is not specified,
include MB in the value. This is optional. the default value
is 16.
--flash-intf Valid for MicroBlaze processor only. This is • SERIALx1 Auto-detect
INTERFACE optional.
• SPIx1
• SPIx2
• SPIx4
• BPIx8
• BPIx16
• SMAPx8
• SMAPx16
• SMAPx32

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 279
Appendix L: PetaLinux Commands

Table 54: petalinux-package boot Command Options (cont'd)

Option Functional Description Value Range Default Value


-o, --output Path on disk to write output image. This is User-specified None
OUTPUTFILE optional.
--cpu DESTINATION CPU Zynq UltraScale+ MPSoC only. The • a53-0 None
destination CPU of the previous data file.
This is optional. • a53-1
• a53-2
• a53-3
--file-attribute DATA Zynq 7000, AMD Zynq™ UltraScale+™ User-specified None
File ATTR MPSoC, and Versal adaptive SoC only. Data
file file-attribute. This is optional.
Example:
petalinux-package --boot --u-boot
--kernel images/linux/Image --
offset 0x01e40000 --file-
attribute partition_owner=uboot
--add images/linux/system.dtb --
offset 0x3AD1200 --file-attribute
partition_owner=uboot --fpga
--bif-attribute Zynq 7000, AMD Zynq™ UltraScale+™ User-specified None
ATTRIBUTE MPSoC, and Versal adaptive SoC only.
Example:
petalinux-package --boot --bif-
attribute fsbl_config --bif-
attribute-value a53_x64 --u-boot
--bif-attribute-value Zynq 7000, AMD Zynq™ UltraScale+™ User-specified None
VALUE MPSoC, and Versal adaptive SoC only. The
value of the attribute specified by --bif-
attribute argument. This is optional.
Example:
petalinux-package --boot --bif-
attribute fsbl_config --bif-
attribute-value a53_x64 --u-boot
--fsblconfig AMD Zynq™ UltraScale+™ MPSoC only. BIF User-specified None
BIF_FSBL_CONFIG FSBL config value.
Example:
petalinux-package --boot --
fsblconfig a53_x64 --u-boot

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 280
Appendix L: PetaLinux Commands

Table 54: petalinux-package boot Command Options (cont'd)

Option Functional Description Value Range Default Value


--bif BIF FILE Zynq 7000 devices, Zynq UltraScale+ User-specified None
MPSoC, and Versal adaptive SoC. BIF file.
For Zynq 7000 devices and Zynq UltraScale
+ MPSoC, it overrides the following
settings:
• –fsbl
• –fpga
• –u-boot
• –add
• –fsblconfig
• –file-attribute
• –bif-attribute
• –bif-attribute-value
For Versal adaptive SoC, it overrides the
following settings:
• -fpga
• -u-boot
• -add
• -file-attribute
• -bif-attribute
• -bit-attribute-value
This is optional.
--boot-device BOOT- Zynq 7000, Zynq UltraScale+ MPSoC, and • sd Default value is
DEV Versal adaptive SoC. The boot device is the one selected
updated in bootargs to boot. This is • flash from the system
optional. select menu of
boot image
settings.
--bootgen-extra-args Zynq 7000, Zynq UltraScale+ MPSoC, and User-specified None
ARGS Versal adaptive SoC only. Extra arguments
to be passed while invoking bootgen
command. This is optional.
Notes:
1. When the FPGA manager option is enabled in petalinux-config, the --fpga option cannot be used. Bitstream is
not included in the BOOT.BIN.

petalinux-package boot Examples


The following examples demonstrate the correct usage of the petalinux-package boot
command.

• Create a BOOT.BIN file for an AMD Versal™ device.


petalinux-package boot --format BIN --plm --psmfw --u-boot --dtb -o
<PATH-TO-OUTPUT-WITH-FILE-NAME>

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 281
Appendix L: PetaLinux Commands

It generates BOOT.BIN, BOOT_bh.bin, and qemu_boot.img in images/linux directory.


The default DTB load address is 0x1000. For more information, see Bootgen User Guide
(UG1283).
petalinux-package boot --plm <PLM_ELF> --psmfw <PSMFW_ELF> --u-boot --dtb
--load <load_address>

It generates a BOOT.BIN with a specified load address for DTB.


Note: The files versal-qemu-multiarch-pmc.dtb and versal-qemu-multiarch-ps.dtb are
QEMU DTBs required to boot multi-arch QEMU. Use system.dtb for --dtb option, generated in
image/linux/ directory or simply use --dtb option.

• Create a BOOT.BIN file for an AMD Zynq™ device (including Zynq 7000 and AMD Zynq™
UltraScale+™ MPSoC).
petalinux-package boot --format BIN --fsbl <PATH-TO-FSBL> --u-boot -o
<PATH-TO-OUTPUT-WITH-FILE-NAME>

• Create a BOOT.BIN file for a Zynq device that includes a PL bitstream and FITimage.
petalinux-package boot --format BIN --fsbl <PATH-TO-FSBL> --u-boot --fpga
<PATH-TO-BITSTREAM> --kernel -o <PATH-TO-OUTPUT>

• Create a x8 SMAP PROM MCS file for a MicroBlaze™ CPU design.


petalinux-package boot --format MCS --fsbl <PATH-TO-FSBL> --u-boot --fpga
<PATH-TO-BITSTREAM> --flash-size <SIZE> --flash-intf SMAPx8 -o
<PATH-TO-OUTPUT-WITH-FILE-NAME>

• Create a BOOT.BIN file for a Zynq UltraScale+ MPSoC that includes PMU firmware.
petalinux-package boot --u-boot --kernel --pmufw <PATH_TO_PMUFW>

• Create bitstream file download.bit for a MicroBlaze CPU design.


petalinux-package boot --format DOWNLOAD.BIT --fpga <BITSTREAM> --fsbl
<FSBOOT_ELF>

petalinux-package bsp
The petalinux-package bsp command compiles all contents of the specified PetaLinux
project directory into a BSP file with the provided file name. This .bsp file can be distributed and
later used as a source for creating a new PetaLinux project. This command is generally used as
the last step in producing a project image that can be distributed to other users. All AMD
reference BSPs for PetaLinux are packaged using this workflow.

petalinux-package bsp Command Options


The following table details the options that are valid when packaging a PetaLinux BSP file with
the petalinux-package bsp command.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 282
Appendix L: PetaLinux Commands

Table 55: petalinux-package bsp Command Options

Option Functional Description Value Range Default Value


-o, --output BSPNAME Path on disk to store the BSP file. File name is User-specified None
of the form BSPNAME.bsp. This is required.
-p,--project PROJECT PetaLinux project directory path. In the BSP User-specified None
context, multiple project areas can be
referenced and included in the output BSP file.
This is optional.
--force Overwrite existing files on disk. This is None None
optional.
--clean Clean the hardware implementation results to None None
reduce package size. This is optional.
--hwsource HWPROJECT Path to an AMD Vivado™ design tools project None None
to include in the BSP file. AMD Vivado™
hardware project is added to the hardware
directory of the output BSP. This is optional.
--exclude-from-file Excludes the files mentioned in EXCLUDE_FILE User-specified None
EXCLUDE_FILE from BSP.

petalinux-package bsp Command Examples


The following examples demonstrate the right usage of the petalinux-package bsp
command.

• Clean the project and generate the BSP installation image (.bsp file).
petalinux-package bsp --clean -o <PATH-TO-BSP> -p <PATH-TO-PROJECT>

• Generate the BSP installation image that includes a reference hardware definition.
petalinux-package bsp -p <PATH-TO-PROJECT> --hwsource <PATH-TO-HW-
EXPORT> -o <PATH-TO-BSP>

• Generate the BSP installation image from a neutral location.


petalinux-package bsp -p <PATH-TO-PROJECT> -o <PATH-TO-BSP>

• Generate the BSP installation image excluding some files.


petalinux-package bsp -p <path_to_project> -o <path_to_bsp> --exclude-
from-file <EXCLUDE_FILE>

petalinux-package prebuilt
The petalinux-package prebuilt command creates a new directory named “pre-built”
inside the directory hierarchy of the specified PetaLinux project. This directory contains the
required files to facilitate booting a board immediately without completely rebuilding the project.
This workflow is intended for those who later create a PetaLinux BSP file for distribution using
the petalinux-package bsp workflow. All AMD reference PetaLinux BSPs contain a prebuilt
directory.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 283
Appendix L: PetaLinux Commands

petalinux-package prebuilt Command Options


The following table details the options that are valid when including prebuilt data in the project
with the petalinux-package prebuilt workflow.

Table 56: petalinux-package prebuilt Command Options

Options Functional Description Value Range Default Value


-p,--project PROJECT PetaLinux project directory path. User-specified Current Directory
This is optional.
--force Overwrite existing files on disk. This None None
is optional.

--fpga BITSTREAM Include the BITSTREAM file in the User-specified <project>/images/linux/*.bit


prebuilt directory. This is optional.
-a,--add src:dest Add the file/directory specified by User-specified The default dest path is
src to the directory specified by dest <project>/prebuilt/linux
in the prebuilt directory. This is
optional and can be used multiple
times.

petalinux-package prebuilt Command Examples


The following examples demonstrate proper usage of the petalinux-package prebuilt
command.

• Include a specific bitstream in the prebuilt area.


petalinux-package prebuilt --fpga <BITSTREAM>

• Include a specific data file in the prebuilt area. For example, add a custom readme to the
prebuilt directory.
petalinux-package prebuilt -a <Path to readme>:images/<custom readme>

petalinux-package sysroot
The petalinux-package sysroot command installs an SDK to a specified directory in
publish mode. This directory can be used as sysroot for application development.

petalinux-package sysroot Command Options


The following table details the options that are valid when installing an SDK with the
petalinux-package sysroot workflow. The SDK must be published previously using the
petalinux-build sdk command.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 284
Appendix L: PetaLinux Commands

Table 57: petalinux-package sysroot Command Options

Options Functional Description Value Range Default Value


-p,--project PROJECT PetaLinux project directory path. This is User-specified Current Directory
optional.
-s, --sdk SDK SDK path on disk to SDK .sh file. This is None <plnx-proj-root>/
optional. images/linux/sdk.sh
-d, --dir DIRECTORY Directory path on disk to install SDK. This is None <plnx-proj-root>/
optional. images/linux/sdk

petalinux-package sysroot Command Examples


The following examples demonstrate the proper usage of the petalinux-package sysroot
command.

• Install default SDK to default directory.


petalinux-package sysroot

• Install specified SDK to default directory.


petalinux-package sysroot -s <PATH-TO-SDK>

• Install specified SDK to specified directory.


petalinux-package sysroot -s <PATH-to-SDK> -d <PATH-TO-INSTALL-DIR>

petalinux-package wic
The following command generates partitioned images from the images/linux directory. Image
generation is driven by partitioning commands in the kickstart file (.wks). The default .wks file is
FAT32 with 2 GB and EXT4 with 4 GB. The default kickstart file is ect-proot>/build/
rootfs.wks after the petalinux-package wic command is executed.

petalinux-package wic

petalinux-package wic Command Options


Table 58: petalinux-package --wic Command Options

Options Functional Description Value Range Default Value


-w, --wks <WKS_FILE> Specify the wic file to be None None
used to create partitions of
SD card.
-o, --outdir Specify the output directory None Default: <proot>/images/
<OUTPUT_DIR> to create petalinux- linux.
sdimage.wic.
-i, --images-dir Specify the images directory None Default: <proot>/images/
<IMAGES_DIR> the boot files were located. linux.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 285
Appendix L: PetaLinux Commands

Table 58: petalinux-package --wic Command Options (cont'd)

Options Functional Description Value Range Default Value


-c, --rootfs-file Specify the compressed root None Default: <proot>/images/
<ROOTFS_FILE> filesystem file that is linux/rootfs.tar.gz
extracted into the /rootfs Supports only the tar.gz
directory. format.
-b, --bootfiles Specify boot files which None Default boot files:
<BOOT_FILES> should be copied into /boot For Zynq 7000 devices:
directory. BOOT.BIN, uImage, boot.scr.
For Zynq UltraScale+ MPSoC:
BOOT.BIN,Image, boot.scr,
and ramdisk.cpio.gz
For Versal adaptive SoC:
BOOT.BIN, Image, boot.scr,
and ramdisk.cpio.gz.u-boot
-e, --extra-bootfiles Specify extra boot files which None None
<EXTRA_FILES> should be copied into /boot
directory. Make sure these
are part of images directory.

petalinux-package wic Command Examples

Packaging the WIC Image using Default Images

The following command generates the wic image, petalinux-sdimage.wic, in the images/
linux folder with the default images from the images/linux directory.

petalinux-package wic

Packaging the WIC Image in a Specific Folder

The following command generates the wic image, petalinux-sdimage.wic, in the


wicimage/ folder.

petalinux-package wic --outdir wicimage/

Packaging the WIC Image with Specified Images Path

The following command packs all bootfiles from the custom-imagespath/ directory.

petalinux-package wic --images-dir custom-imagespath/

Packaging Custom Bootfiles into the /boot Directory

• To copy boot.bin userfile1 userfile2 files from the <plnx-proj-root>/


images/linux directory to the /boot of media, use the following command:
petalinux-package wic --bootfiles "boot.bin userfile1 userfile2"

This generates the wic image with specified files copied into the /boot directory.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 286
Appendix L: PetaLinux Commands

Note: Ensure that these files are part of the images directory.

• To copy the uImage file named kernel to the /boot directory, use the following command:
petalinux-package wic --extra-bootfiles "uImage:kernel"

• To copy the default bootfiles and specified bootfiles by user files into the /boot directory, use
the following command:
petalinux-package wic --bootfiles "userfiles/*"

• To copy all the files in the userfiles/ directory to the /boot/user_boot directory, use
the following command:
petalinux-package wic --extra-bootfiles "userfiles/*:user_boot"

Note: Ensure that these files are part of the images directory.

Packaging Custom Root File System

The following command unpacks your custom-rootfs.tar.gz file and copies it to the /
rootfs directory.

petalinux-package wic --rootfs-file custom-rootfs.tar.gz

Customizing WIC Partitions

PetaLinux uses the kickstart (.wks) file to define the partitions to create the WIC image. When
the petalinux-package --wic command is executed, the default .wks file is placed in
<plnx-proj-root>/build/wic/rootfs.wks. This can be modified and provided as input
to create the WIC images as per the requirement. Following is the default rootfs.wks file:

part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --


label boot --active --align 4 --size 800
part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align
4 --size 2400

You can refer to https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#ref-


kickstart for each argument specified in the wks file.

Once you have the updated .wks file, use the following command to create WIC image:

petalinux-package wic --wks <path to the wks file>

petalinux-util
The petalinux-util tool provides various support services to the other PetaLinux workflows.
The tool itself provides several workflows depending on the support function needed.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 287
Appendix L: PetaLinux Commands

petalinux-util gdb
The petalinux-util gdb command is a wrapper around the standard GNU GDB debugger
and simply launches the GDB debugger in the current terminal. Executing petalinux-util
gdb --help at the terminal prompt provides verbose GDB options that can be used.

For GDB GUI-based debugging, use the AMD Vitis™ software platform. For more information
regarding GDB, see Vitis Unified Software Platform Documentation: Embedded Software
Development (UG1400).

petalinux-util gdb command Examples


The following example demonstrates proper usage of the petalinux-util gdb command. To
launch the GNU GDB debugger, use the following command:

petalinux-util gdb

petalinux-util dfu-util
The petalinux-util dfu-util command is a wrapper around the standard dfu-util, and
launches dfu-util in the current terminal. Executing petalinux-util dfu-util --help
at the terminal prompt provides verbose dfu-util options that can be used.

petalinux-util dfu-util Command Examples


The following example demonstrates proper usage of the petalinux-util dfu-util
command. To launch the dfu-util, use the following command:

petalinux-util dfu-util

petalinux-util xsdb-connect
The petalinux-util xsdb-connect command provides XSDB connection to QEMU. This is
for AMD Zynq™ UltraScale+™ MPSoC and Zynq 7000 devices only.

For more information regarding XSDB, see Vitis Unified Software Platform Documentation:
Embedded Software Development (UG1400).

petalinux-util xsdb-connect Options


The following table details the options that are valid when using the petalinux-util xsdb-
connect command.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 288
Appendix L: PetaLinux Commands

Table 59: petalinux-util xsdb-connect Options

Option Functional Description Value Range Default Value


--xsdb-connect Host and the port XSDB should connect to. This User-specified None
HOST:PORT should be the host and port that QEMU has
opened for GDB connections. It can be found in
the QEMU command line arguments from: --gdb
tcp: <QEMU_HOST>: <QEMU_PORT>. This is
required.

petalinux-util find-xsa-bitstream
The petalinux-util find-xsa-bitstream gives the name of bitstream packed in the XSA
file.

petalinux-util find-xsa-bitstream Options


The following table details the options that are valid when using the petalinux-util find-
xsa-bitstream command.

Table 60: petalinux-util find-xsa-bitstream Options

Option Functional Description Value Range Default Value


--xsa-file <XSA> Argument to specify the XSA file to use. This None system.xsa file in the
is optional. <project>/project-
spec/hw-description
directory

petalinux-util find-xsa-bitstream Examples


The following examples demonstrate proper usage of the petalinux-util find-xsa-
bitstream command.

• To find the default bitstream of a project


petalinux-util find-xsa-bitstream

• To find the bitstream of a xsa


petalinux-util find-xsa-bitstream --xsa-file <path to xsa file>

petalinux-upgrade
To upgrade the workspace, use the petalinux-upgrade command.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 289
Appendix L: PetaLinux Commands

petalinux-upgrade Options
Table 61: petalinux-upgrade Options

Options Functional description Value Range Default Range


-h --help Displays usage information. None None
-f --file Local path to target system software User-specified. None
components.
-u --url URL to target system software User-specified. None
components.
-w, --wget-args Passes additional wget arguments Additional wget options. None
to the command.
-p|--platform Specifies the architecture name to aarch64: sources for Zynq None
upgrade. UltraScale+ MPSoC and Versal
arm: sources for Zynq devices
microblaze: sources for
microblaze devices

petalinux-devtool
The petalinux-devtool is a utility that uses the Yocto devtool to enable you to build, test,
and package software. The following table details the available options for the petalinux-
devtool command.

petalinux-devtool Command Line Options


Table 62: petalinux-devtool Command Line Options

Option Functional Description


add Add a new recipe
modify Modify the source for an existing recipe
upgrade Upgrade an existing recipe
status Show workspace status
search Search available recipes
latest-version Report the latest version of an existing recipe
check-upgrade-status Report upgradability for multiple (or all) recipes
build Build a recipe
rename Rename a recipe file in the workspace
edit-recipe Edit a recipe file
find-recipe Find a recipe file
configure-help Get help on configure script options
update-recipe Apply changes from external source tree to recipe

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 290
Appendix L: PetaLinux Commands

Table 62: petalinux-devtool Command Line Options (cont'd)

Option Functional Description


reset Remove a recipe from your workspace
finish Finish working on a recipe in your workspace
deploy-target Deploy recipe output files to live target machine
undeploy-target Undeploy recipe output files in live target machine
build-image Build image including workspace recipe packages
create-workspace Set up workspace in an alternative location
configure Runs configure command
export Export workspace into a tar archive
extract Extract the source for an existing recipe
sync Synchronize the source tree for an existing recipe
import Import exported tar archive into workspace
menuconfig Alter build-time configuration for a recipe

petalinux-devtool Examples
Adding a New Recipe to the Workspace Layer

To add a new recipe to the workspace layer, use the petalinux-devtool add command. For
petalinux-devtool add bbexample https://github.com/whbruce/
bbexample.git This command fetches the source from the specified URL and creates the
recipe bbexample in the Devtool Workspace directory.

petalinux-devtool add

petalinux-devtool add bbexample https://github.com/whbruce/bbexample.git


[INFO] Getting Platform info from HW file
[INFO] Silentconfig project
[INFO] Silentconfig rootfs
[INFO] Generating configuration files
[INFO] Generating workspace directory
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup//xilinx-
zcu102-2024.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:37673, PID:
3253581
INFO: Specified workspace already set up, leaving as-is
[INFO] devtool add bbexample https://github.com/whbruce/bbexample.git
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup//xilinx-
zcu102-2024.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:34627, PID:
3253652
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup//xilinx-
zcu102-2024.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:33017, PID:
3253673
INFO: Fetching git://github.com/whbruce/
bbexample.git;protocol=https;branch=master...
Loading cache: 100% |
############################################################################

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 291
Appendix L: PetaLinux Commands

#######################| Time: 0:00:04


Loaded 6400 entries from dependency cache.
Parsing recipes: 100% |
############################################################################
#####################| Time: 0:00:02
Parsing of 4477 .bb files complete (4453 cached, 24 parsed). 6426 targets,
381 skipped, 2 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
NOTE: Fetching uninative binary shim file:///wrk/everest_fcv_nobkup/
kavyasre/_logs_/_zcu102_/_latest_/xilinx-zcu102-2024.1/components/yocto/
downloads/uninative/
5fab9a5c97fc73a21134e5a81f74498cbaecda75d56aab971c934e0b803bcc00/x86_64-
nativesdk-
libc-3.8.1.tar.xz;sha256sum=5fab9a5c97fc73a21134e5a81f74498cbaecda75d56aab97
1c934e0b803bcc00 (will check PREMIRRORS first)
Initialising tasks: 100% |
############################################################################
##################| Time: 0:00:01
Sstate summary: Wanted 0 Local 0 Mirrors 0 Missed 0 Current 0 (0% match, 0%
complete)
NOTE: No setscene tasks
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 2 tasks of which 0 didn't need to be rerun
and all succeeded.
INFO: Using default source tree path /wrk/everest_fcv_nobkup//xilinx-
zcu102-2024.1/components/yocto/workspace/sources/bbexample
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)...
NOTE: Reconnecting to bitbake server...
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)...
NOTE: Retrying server connection (#1)...
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup//xilinx-
zcu102-2024.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:45519, PID:
3254607
INFO: Recipe /wrk/everest_fcv_nobkup//xilinx-zcu102-2024.1/components/yocto/
workspace/recipes/bbexample/bbexample_git.bb has been automatically
created; further editing may be required to make it fully functional

Getting the Status of the Recipes in Your Workspace

Use the petalinux-devtool status command to list the recipes currently in your
workspace. Information includes the paths to their respective external source trees.

petalinux-devtool status

petalinux-devtool status
[INFO] Getting Platform info from HW file
[INFO] Silentconfig project
[INFO] Silentconfig rootfs
[INFO] Generating configuration files
[INFO] Generating workspace directory
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup/xilinx-
zcu102-2024.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:36071, PID:
3255120
INFO: Specified workspace already set up, leaving as-is
[INFO] devtool status
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup/xilinx-

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 292
Appendix L: PetaLinux Commands

zcu102-2024.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:45787, PID:


3255187
bbexample: /wrk/everest_fcv_nobkup/xilinx-zcu102-2024.1/components/yocto/
workspace/sources/bbexample (/wrk/everest_fcv_nobkup/kavyasre/_logs_/
_zcu102_/_latest_/xilinx-zcu102-2024.1/components/yocto/workspace/recipes/
bbexample/bbexample_git.bb)

Modifying an Existing Recipe

Use the petalinux-devtool modify command to begin modifying the source of an existing
recipe. This command extracts the source for a recipe to the Devtool Workspace directory,
checks out a branch for development, and applies the patches, if any, from the recipe as commits
on top.

Use the following command to modify the linux-xlnx recipe:

petalinux-devtool modify linux-xlnx

petalinux-devtool modify linux-xlnx


[INFO] Getting Platform info from HW file
[INFO] Silentconfig project
[INFO] Silentconfig rootfs
[INFO] Generating configuration files
[INFO] Generating workspace directory
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup//xilinx-
zcu102-2024.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:33661, PID:
3255405
INFO: Specified workspace already set up, leaving as-is
[INFO] devtool modify linux-xlnx
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup//xilinx-
zcu102-2024.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:43587, PID:
3255470
NOTE: Reconnecting to bitbake server...
NOTE: Previous bitbake instance shutting down?, waiting to retry...
NOTE: Retrying server connection (#1)...
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup//xilinx-
zcu102-2024.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:39219, PID:
3255502
Loading cache: 100% |
############################################################################
#######################| Time: 0:00:01
Loaded 6400 entries from dependency cache.
Parsing recipes: 100% |
############################################################################
#####################| Time: 0:00:03
Parsing of 4477 .bb files complete (4453 cached, 24 parsed). 6426 targets,
381 skipped, 2 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |
############################################################################
##################| Time: 0:00:03
Sstate summary: Wanted 74 Local 0 Mirrors 1 Missed 73 Current 72 (1% match,
50% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 656 tasks of which 656 didn't need to be

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 293
Appendix L: PetaLinux Commands

rerun and all succeeded.


INFO: Copying kernel config to workspace
INFO: Recipe linux-xlnx now set up to build from /wrk/everest_fcv_nobkup//
xilinx-zcu102-2024.1/components/yocto/workspace/sources/linux-xlnx

Building the Recipe

Use the petalinux-devtool build command to build your recipe. This command is
equivalent to the bitbake -c populate_sysroot command. You must supply the root
name of the recipe (that is, do not provide versions, paths, or extensions), as shown:

petalinux-devtool build linux-xlnx

petalinux-devtool build linux-xlnx


[INFO] Getting Platform info from HW file
[INFO] Silentconfig project
[INFO] Silentconfig rootfs
[INFO] Generating configuration files
[INFO] Generating workspace directory
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup//xilinx-
zcu102-2024.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:40835, PID:
3258488
INFO: Specified workspace already set up, leaving as-is
[INFO] devtool build linux-xlnx
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup//xilinx-
zcu102-2024.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:39871, PID:
3258553
NOTE: Reconnecting to bitbake server...
NOTE: Previous bitbake instance shutting down?, waiting to retry...
NOTE: Retrying server connection (#1)...
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup//xilinx-
zcu102-2024.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:38281, PID:
3258580
Loading cache: 100% |
############################################################################
#######################| Time: 0:00:02
Loaded 6400 entries from dependency cache.
Parsing recipes: 100% |
############################################################################
#####################| Time: 0:01:40
Parsing of 4477 .bb files complete (4452 cached, 25 parsed). 6426 targets,
381 skipped, 2 masked, 0 errors.
Removing 1 recipes from the xilinx_zcu102 sysroot: 100% |
###############################################################| Time:
0:00:00
NOTE: Started PRServer with DBfile: /wrk/everest_fcv_nobkup//xilinx-
zcu102-2024.1/build/cache/prserv.sqlite3, Address: 127.0.0.1:44009, PID:
3412224
Loading cache: 100% |
############################################################################
#######################| Time: 0:00:05
Loaded 6400 entries from dependency cache.
Parsing recipes: 100% |
############################################################################
#####################| Time: 0:01:15
Parsing of 4477 .bb files complete (4452 cached, 25 parsed). 6426 targets,
381 skipped, 2 masked, 0 errors.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 294
Appendix L: PetaLinux Commands

NOTE: Resolving any missing task queue dependencies


Initialising tasks: 100% |
############################################################################
##################| Time: 0:00:06
Checking sstate mirror object availability: 100% |
######################################################################|
Time: 0:01:53
Sstate summary: Wanted 424 Local 18 Mirrors 5 Missed 401 Current 897 (5%
match, 69% complete)
Removing 4 stale sstate objects for arch xilinx_zcu102: 100% |
##########################################################| Time: 0:00:00
NOTE: Executing Tasks
NOTE: linux-xlnx: compiling from external source tree /wrk/
everest_fcv_nobkup//xilinx-zcu102-2024.1/components/yocto/workspace/sources/
linux-xlnx
NOTE: Tasks Summary: Attempted 3639 tasks of which 3581 didn't need to be
rerun and all succeeded.

Building Your Image

Use the petalinux-devtool build-image command to build an image using the devtool
flow. This includes the recipes which are the workspace directory. When running this command
you must specify the image name to be built.

petalinux-devtool build-image petalinux-image-minimal

Figure 40: petalinux-devtool build-image

Resetting the Recipe

Use the petalinux-devtool reset command to remove the recipe and its configurations
from Devtool Workspace directory. This command does not add/append changes in the Devtool
Workspace to any layers, you need to update the recipe append file before running the reset
command.

petalinux-devtool reset linux-xlnx

Figure 41: petalinux-devtool reset

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 295
Appendix L: PetaLinux Commands

Note: You can find a list of examples at https://www.yoctoproject.org/docs/latest/ref-manual/ref-


manual.html#ref-devtool-reference

https://docs.yoctoproject.org/ref-manual/devtool-reference.html

. Make sure to use petalinux-devtool in place of devtool in the examples.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 296
Appendix M: Additional Resources and Legal Notices

Appendix M

Additional Resources and Legal


Notices

Finding Additional Documentation


Technical Information Portal

The AMD Technical Information Portal is an online tool that provides robust search and
navigation for documentation using your web browser. To access the Technical Information
Portal, go to https://docs.amd.com.

Documentation Navigator

Documentation Navigator (DocNav) is an installed tool that provides access to AMD Adaptive
Computing documents, videos, and support resources, which you can filter and search to find
information. To open DocNav:

• From the AMD Vivado™ IDE, select Help → Documentation and Tutorials.
• On Windows, click the Start button and select Xilinx Design Tools → DocNav.
• At the Linux command prompt, enter docnav.

Note: For more information on DocNav, refer to the Documentation Navigator User Guide (UG968).

Design Hubs

AMD Design Hubs provide links to documentation organized by design tasks and other topics,
which you can use to learn key concepts and address frequently asked questions. To access the
Design Hubs:

• In DocNav, click the Design Hubs View tab.


• Go to the Design Hubs web page.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 297
Appendix M: Additional Resources and Legal Notices

Support Resources
For support resources such as Answers, Documentation, Downloads, and Forums, see Support.

Revision History
The following table shows the revision history for this document.
Section Revision Summary
05/30/2024 Version 2024.1
General Updates Updated code, logs and screen-shots.
Installation Requirements Added new information.
Appendix K: Deprecated BSP Support Added new topic.

References
These documents provide supplemental material useful with this guide:

1. PetaLinux Documentation (www.xilinx.com/petalinux)


2. Answer Record 55776
3. Zynq UltraScale+ MPSoC: Software Developers Guide (UG1137)
4. Versal Adaptive SoC System Software Developers Guide (UG1304)
5. Bootgen User Guide (UG1283)
6. Xilinx Quick Emulator User Guide (QEMU) (UG1169)
7. Libmetal and OpenAMP for Zynq Devices User Guide (UG1186)
8. www.wiki.xilinx.com/Linux
9. PetaLinux Yocto Tips
10. Yocto Project Technical FAQ
11. Vitis Unified Software Platform Documentation: Embedded Software Development (UG1400)

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 298
Appendix M: Additional Resources and Legal Notices

Please Read: Important Legal Notices


The information presented in this document is for informational purposes only and may contain
technical inaccuracies, omissions, and typographical errors. The information contained herein is
subject to change and may be rendered inaccurate for many reasons, including but not limited to
product and roadmap changes, component and motherboard version changes, new model and/or
product releases, product differences between differing manufacturers, software changes, BIOS
flashes, firmware upgrades, or the like. Any computer system has risks of security vulnerabilities
that cannot be completely prevented or mitigated. AMD assumes no obligation to update or
otherwise correct or revise this information. However, AMD reserves the right to revise this
information and to make changes from time to time to the content hereof without obligation of
AMD to notify any person of such revisions or changes. THIS INFORMATION IS PROVIDED "AS
IS." AMD MAKES NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE
CONTENTS HEREOF AND ASSUMES NO RESPONSIBILITY FOR ANY INACCURACIES,
ERRORS, OR OMISSIONS THAT MAY APPEAR IN THIS INFORMATION. AMD SPECIFICALLY
DISCLAIMS ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, OR
FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT WILL AMD BE LIABLE TO ANY
PERSON FOR ANY RELIANCE, DIRECT, INDIRECT, SPECIAL, OR OTHER CONSEQUENTIAL
DAMAGES ARISING FROM THE USE OF ANY INFORMATION CONTAINED HEREIN, EVEN IF
AMD IS EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

AUTOMOTIVE APPLICATIONS DISCLAIMER

AUTOMOTIVE PRODUCTS (IDENTIFIED AS "XA" IN THE PART NUMBER) ARE NOT


WARRANTED FOR USE IN THE DEPLOYMENT OF AIRBAGS OR FOR USE IN APPLICATIONS
THAT AFFECT CONTROL OF A VEHICLE ("SAFETY APPLICATION") UNLESS THERE IS A
SAFETY CONCEPT OR REDUNDANCY FEATURE CONSISTENT WITH THE ISO 26262
AUTOMOTIVE SAFETY STANDARD ("SAFETY DESIGN"). CUSTOMER SHALL, PRIOR TO USING
OR DISTRIBUTING ANY SYSTEMS THAT INCORPORATE PRODUCTS, THOROUGHLY TEST
SUCH SYSTEMS FOR SAFETY PURPOSES. USE OF PRODUCTS IN A SAFETY APPLICATION
WITHOUT A SAFETY DESIGN IS FULLY AT THE RISK OF CUSTOMER, SUBJECT ONLY TO
APPLICABLE LAWS AND REGULATIONS GOVERNING LIMITATIONS ON PRODUCT
LIABILITY.

Copyright

© Copyright 2014-2024 Advanced Micro Devices, Inc. AMD, the AMD Arrow logo, UltraScale+,
Vivado, Versal, Vitis, Zynq, and combinations thereof are trademarks of Advanced Micro Devices,
Inc. OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos.
PCI, PCIe, and PCI Express are trademarks of PCI-SIG and used under license. AMBA, AMBA
Designer, Arm, ARM1176JZ-S, CoreSight, Cortex, PrimeCell, Mali, and MPCore are trademarks of
Arm Limited in the US and/or elsewhere. Other product names used in this publication are for
identification purposes only and may be trademarks of their respective companies.

UG1144 (v2024.1) May 30, 2024


Send Feedback
PetaLinux Tools Documentation Reference Guide 299

You might also like