type
status
date
slug
summary
tags
category
icon
password
This demo is based on PetaLinux 2024.1 release.
- Download 2024.1 PetaLinux Tools Installer & ZCU102 BSP: https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools/2024-1.html
- Switch to bash:
- Set
$SHELL
to/bin/bash
:
- Disable dash as the default system shell (/bin/sh):
- Select: <No>
- Install PetaLinux Tools Installer:
- Installer will be installed to:
./install
- Source PetaLinux environments:
- Create project from ZCU102 BSP:
- The project will be created to:
./xilinx-zcu102-2024.1
- Build OpenAMP dtb:
- Select configs:
- DTG Settings → Enable openamp dtsi
- Yocto Settings → Parallel thread execution → Set number of bb threads (BB_NUMBER_THREADS)
- E.g.
8
- PetaLinux project config is located at:
./project-spec/configs/config
- Enable OpenAMP and its examples in rootfs:
- Select the configs:
- Filesystem Packages → misc → openamp-fw-echo-testd
- Filesystem Packages → misc → openamp-fw-mat-muld
- Filesystem Packages → misc → openamp-fw-rpc-demo
- Petalinux Package Groups → packagegroup-petalinux-openamp → packagegroup-petalinux-openamp
- Enable Linux Kernel debug info:
- Select the configs:
- Kernel hacking → Kernel debugging
- Kernel hacking → Compile-time checks and compiler options → Debug information → Rely on the toolchain’s implicit default DWARF version
- General setup →Compiler optimization level → Optimize for size (-Os)
- Device Drivers → Character devices → /dev/mem virtual device support
- If we want to build
zynqmp_r5_remoteproc
driver into kernel, instead of kernel module: - Select the configs:
- Device Drivers → Remoteproc drivers → Support for Remote Processor subsystem → ZynqMP R5 remoteproc support, choose:
y
- Build the project:
- Boot QEMU with Linux kernel and rootfs we just built:
- When
--kernel
is specified, PetaLinux will try to load all the images from<plnx-proj-root>/images/linux/
: - For Zynq UltraScale+ MPSoC:
- TF-A image:
<plnx-proj-root>/images/linux/bl31.elf
- U-Boot:
<plnx-proj-root>/images/linux/u-boot.elf
- Linux kernel image:
<plnx-proj-root>/images/linux/Image
- Initrd/Initramfs image:
<plnx-proj-root>/images/linux/ramdisk.cpio.gz.u-boot
- Rootfs (as SD card image):
<plnx-proj-root>/images/linux/rootfs.ext4
- DTB:
<plnx-proj-root>/images/linux/system.dtb
- HW DTB:
<plnx-proj-root>/images/linux/zynqmp-qemu-multiarch-arm.dtb
- … etc
- P.S. The TF-A boots the loaded kernel image, with PMU firmware running in the background.
- After booting to Linux shell:
- Default login:
- Username: petalinux
- Password: <Set a password during the first login>
- If we didn’t build
zynqmp_r5_remoteproc
driver into kernel, we need to make surezynqmp_r5_remoteproc
kernel module is installed: - If not,
modprobe
to install it: rpmsg_ctrl
,rpmsg_char
kernel modules will be installed automatically when starting remoteproc.- Change remoteproc file permissions:
- Follow the tutorials to run OpenAMP demos:
- echo_test:
- matrix multiply:
- proxy_app:
- Firmware is located in
/lib/firmware
: - P.S. We need to use
sudo
to run the test application, e.g.
- Remote debug Linux kernel:
- QEMU source: https://github.com/Xilinx/qemu/tree/xlnx_rel_v2024.1
- Linux kernel source: https://github.com/Xilinx/linux-xlnx/tree/xlnx_rebase_v6.6_LTS
- zynqmp_r5_remoteproc:
drivers/remoteproc/zynqmp_r5_remoteproc.c
- rpmsg_ctrl:
drivers/rpmsg/rpmsg_ctrl.c
- rpmsg_char:
drivers/rpmsg/rpmsg_char.c