Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.
Getting Zynq UltraScale+ Linux running reliably takes more than following documentation—it requires understanding the build system, troubleshooting obscure errors, and knowing when to use PetaLinux versus a pure Xilinx Yocto approach. After bringing up Linux on numerous MPSoC boards, I’ve learned the hard way which steps matter and which pitfalls to avoid.
This comprehensive tutorial covers everything from PetaLinux installation through custom image creation, with practical guidance for the Yocto Zynq workflow that underlies PetaLinux. Whether you’re targeting a ZCU102 evaluation board or a custom production platform, this guide provides the foundation for reliable embedded Linux development.
Before diving into installation, it’s worth understanding your options for building Zynq UltraScale+ Linux systems.
PetaLinux vs Pure Yocto
AMD provides two primary paths for building Linux:
Approach
Best For
Complexity
Flexibility
PetaLinux
Rapid development, BSP-based projects
Lower
Moderate
Pure Yocto
Production systems, custom distributions
Higher
Maximum
PetaLinux is essentially a Yocto-based build environment with AMD-specific wrappers that simplify common tasks. Under the hood, PetaLinux uses the same Xilinx Yocto layers (meta-xilinx, meta-xilinx-tools) that you’d use in a pure Yocto build. The petalinux-* commands wrap BitBake operations with device-specific defaults.
Pure Yocto using the meta-xilinx layers provides maximum flexibility but requires deeper understanding of the build system. For production systems requiring fine-grained control, the Yocto Zynq workflow offers advantages despite its steeper learning curve.
This tutorial focuses primarily on PetaLinux while explaining the underlying Yocto concepts, enabling you to transition to pure Yocto when needed.
System Requirements and Prerequisites
PetaLinux has specific host requirements that must be met exactly—unlike Vivado which often works on unsupported configurations, PetaLinux builds frequently fail in strange ways on non-supported systems.
Supported Host Operating Systems
Version
Ubuntu
RHEL/CentOS
2024.1
22.04 LTS
8.x, 9.x
2023.2
22.04 LTS
8.x
2022.2
18.04, 20.04 LTS
7.x, 8.x
2022.1
18.04, 20.04 LTS
7.x, 8.x
Using an unsupported OS often leads to cryptic build failures that waste hours of debugging time. If your development machine runs a different distribution, use a virtual machine or container with a supported OS.
Hardware Requirements
Resource
Minimum
Recommended
RAM
8 GB
32 GB
Storage
100 GB free
200+ GB SSD
CPU Cores
4
8+
Build Time
4+ hours
1-2 hours
PetaLinux builds are highly I/O intensive. An SSD dramatically reduces build times compared to mechanical drives.
Required Dependencies
Install all dependencies before running the PetaLinux installer. For Ubuntu 22.04:
sudo dpkg-reconfigure dash # Select “No” to use bash instead of dash
Download the PetaLinux installer from the AMD website (requires free account). The installer is a large self-extracting archive (approximately 2-3 GB).
The –get-hw-description command reads the XSA and configures device tree entries, boot components, and peripheral support based on your hardware design.
Configuring the Zynq UltraScale+ Linux System
PetaLinux provides multiple configuration interfaces that ultimately modify the underlying Yocto Zynq configuration.
System-Level Configuration
petalinux-config
This opens a menuconfig interface for system-level settings:
Category
Key Settings
Linux Components Selection
Enable/disable FSBL, U-Boot, kernel
Auto Config Settings
Automatic device tree generation
Subsystem AUTO Hardware Settings
Memory, serial console, flash
DTG Settings
Device tree generation options
u-boot Configuration
Boot device, boot arguments
Image Packaging Configuration
Root filesystem type, boot image format
For Zynq UltraScale+ Linux systems, the most critical settings include:
When Zynq UltraScale+ Linux fails to boot, systematic debugging identifies the failure point:
Stage 1 – FSBL: If the board shows no signs of life, verify FSBL is loading. Check boot mode switches and ensure BOOT.BIN is on the correct media. FSBL failures often indicate XSA/hardware mismatches.
Stage 2 – U-Boot: If you see U-Boot messages but Linux doesn’t start, the kernel or device tree may be corrupted. Try loading via TFTP to isolate SD card issues:
# In U-Boot console
setenv serverip 192.168.1.100
setenv ipaddr 192.168.1.50
tftpboot 0x10000000 image.ub
bootm 0x10000000
Stage 3 – Kernel: Kernel panics typically indicate device tree problems, missing drivers, or filesystem issues. Add earlycon=cdns,0xFF000000,115200n8 to kernel command line for early debug output.
Device Tree Customization
The device tree describes hardware to the Linux kernel. For custom boards, device tree modifications are often necessary.
Understanding Device Tree Structure
The Yocto Zynq build generates device trees from multiple sources:
Source
Location
Purpose
Base DTS
Auto-generated from XSA
Hardware peripherals
Include files
meta-xilinx
Common definitions
Custom fragments
project-spec/meta-user
User modifications
Adding Custom Device Tree Entries
Create device tree fragments in project-spec/meta-user/recipes-bsp/device-tree/files/:
Understanding the meta-xilinx layer structure helps when customizing beyond PetaLinux’s abstractions.
Layer Organization
The Xilinx Yocto layers provide:
Layer
Purpose
meta-xilinx-core
Core SoC support, tune files
meta-xilinx-bsp
Evaluation board BSPs
meta-xilinx-standalone
Bare-metal toolchains
meta-xilinx-tools
XSCT integration
meta-petalinux
PetaLinux-specific recipes
Overriding Recipes
To modify an upstream recipe, create a .bbappend file in your custom layer:
# linux-xlnx_%.bbappend
FILESEXTRAPATHS:prepend := “${THISDIR}/files:”
SRC_URI += “file://custom-driver.patch”
SRC_URI += “file://custom.cfg”
KERNEL_CONFIG_FRAGMENTS += “file://custom.cfg”
This approach maintains upstream compatibility while adding customizations.
Building Specific Components
During development, rebuild individual components rather than the entire system:
# Rebuild kernel only
petalinux-build -c kernel
# Rebuild U-Boot only
petalinux-build -c u-boot
# Rebuild device tree only
petalinux-build -c device-tree
# Rebuild specific application
petalinux-build -c myapp
Advanced Configuration Topics
Network Boot with NFS Root
For rapid development iteration, boot with network filesystem:
# In petalinux-config
# Image Packaging Configuration -> Root filesystem type -> NFS
# Set NFS server details
# Subsystem AUTO Hardware Settings -> Ethernet Settings -> IP address
Configure your NFS server to export the root filesystem:
# On host machine
sudo mkdir -p /export/rootfs
sudo tar xzf rootfs.tar.gz -C /export/rootfs
# Add to /etc/exports
echo “/export/rootfs *(rw,no_root_squash,no_subtree_check)” | sudo tee -a /etc/exports
sudo exportfs -a
NFS boot eliminates SD card preparation for every change, dramatically speeding development.
Partial Reconfiguration Support
For FPGA designs using partial reconfiguration:
# Enable in kernel config
petalinux-config -c kernel
# Device Drivers -> FPGA Configuration Support -> FPGA Region
Load partial bitstreams at runtime:
# On target
fpgautil -b partial.bit.bin -o overlay.dtbo
OpenAMP for Cortex-R5 Communication
The Zynq UltraScale+ Linux kernel includes support for communicating with the Cortex-R5 real-time processor:
# Enable OpenAMP packages
petalinux-config -c rootfs
# Petalinux Package Groups -> packagegroup-petalinux-openamp
This enables remoteproc for loading R5 firmware and rpmsg for inter-processor communication.
Frequently Asked Questions
What is the difference between PetaLinux and Yocto for Zynq UltraScale+ Linux?
PetaLinux is a wrapper around Yocto that provides simplified commands (petalinux-build, petalinux-config) and default configurations for AMD devices. The Xilinx Yocto layers (meta-xilinx) that PetaLinux uses can also be used directly with standard Yocto tools (BitBake). PetaLinux is faster to start with, while pure Yocto offers more flexibility for production systems.
Can I use Ubuntu or other distributions instead of PetaLinux’s root filesystem?
Yes. Canonical provides official Ubuntu images for some AMD platforms, and you can build custom distributions using the Yocto Zynq workflow. Replace the root filesystem while keeping the same boot components (BOOT.BIN, kernel, device tree). The processing system boots the same regardless of which Linux distribution runs on top.
How long does a full PetaLinux build take?
Initial builds typically take 1-4 hours depending on system specifications. Subsequent builds are much faster (minutes) when only changing applications or configurations, as Yocto’s sstate cache preserves unchanged components. Adding more CPU cores and using SSD storage significantly reduces build times.
Why does my PetaLinux build fail with “unsupported OS” warning?
PetaLinux validates the host operating system and may refuse to build on unsupported versions. While warnings can sometimes be ignored, actual build failures usually require using a supported OS. Virtual machines or containers running supported Ubuntu or RHEL versions provide the most reliable build environment.
How do I add a custom kernel driver to my Zynq UltraScale+ Linux image?
Create a kernel module recipe in project-spec/meta-user/recipes-modules/ or enable built-in kernel drivers using petalinux-config -c kernel. For out-of-tree modules, create a recipe that compiles against the kernel headers. Include the module in rootfs configuration to ensure it’s packaged in the final image.
Building Production-Ready Systems
Transitioning from development to production requires attention to several factors beyond basic functionality.
Document all configuration changes in version control
Create BSPs for repeatable project creation
The combination of PetaLinux for rapid prototyping and pure Xilinx Yocto for production builds provides flexibility throughout the development lifecycle. Understanding both approaches enables efficient Zynq UltraScale+ Linux development regardless of project requirements. As your project matures, transitioning from PetaLinux wrappers to direct Yocto control provides the fine-grained customization that production systems demand.
Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.