Table of Contents
Install Xilinx Yocto
Repo is a repository management tool that is built on top of Git. Repo unifies the many Git repositories when necessary, and automates parts of the development workflow. Repo is not meant to replace Git, only to make it easier to work with Git in the context of development.The repo command is an executable Python script that you can put anywhere in your path. In working with the source files, you will use Repo for across-network operations. For example, with a single Repo command you can download files from multiple repositories into your local working directory.
For more info about Repo, please see https://source.android.com/source/developing.html.
Here we will simply install the repo script from Google.
Repo uses a manifest which is an XML file that describes all the required repositories. It can manage all of your git repositories so they remain in sync.
Replace <current-release> with the git release tag, e.g. rel-v2018.3, rel-v2019.1
In 2019.2, there is a bug in the tcf-agent bbappend in the meta-petalinux layer. To work around it, edit the following file: sources/meta-petalinux/recipes-devtools/tcf-agent/tcf-agent_%.bbappend
Change the following line:
This is fixed in 2020.1
Configure the Xilinx Yocto Build
This section shows how to do three basic Yocto configurations.
- Generate u-boot scripts to control your kernel SD boot
- Add an initramfs
- Generate a FIT image
Generate U-boot Boot Scripts (recommended)
U-boot is built with default variables that control the boot. You may use the defaults, modify them by patching the configuration headers during the build or modify them at run-time from the hush shell. A more flexible way to control the boot is through boot scripts, boot.scr or extlinux.conf. U-boot 2019.01 defaults to distro boot (2) as the boot mechanism, which searches for things to boot. Distro boot will look for extlinux.conf, boot.scr and an EFI image in that order. This section shows how to build extlinux.conf and boot.scr.
Meta-xilinx-bsp provides the "u-boot-zynq-scr.bb" recipe to generate the boot.scr. To build boot.scr, add the Yocto variable below to your local.conf.
Configuring Yocto for extlinux will generate a extlinux.conf file to control the u-boot environment variables. Add the Yocto variables below to your local.conf if you want to build extlinux.conf. These Yocto variables give you granular control over how the u-boot variables are populated. An advantage of extlinux is that it is well known, cross-platform and ASCII text. U-boot will search for extlinux.conf in /boot/extlinux/.
Build an Initramfs (optional)
The default Yocto configuration will build images for deploying on a dual partition SD card. This optional section shows how to build with an initramfs for a single partition SD card. Edit your local.conf file and add the lines shown below. This will tell bitbake to create an initramfs image and bundle it with the kernel (2).
Generate a FIT Image (optional)
If you want to build a FIT image, add the variables shown below to your local.conf. A FIT image contains partitions for all of the images required to boot the kernel.
Yocto may build two FIT images depending on if you've enabled initramfs or not:
- fitimage-<machine>.bin (kernel and dtb)
- fitimage-<image>-<machine>.bin (kernel, dtb and initramfs)
You may run "mkimage -l <fitimage> to view the partitions
This article does not show how to configure the u-boot scripts to boot a FIT image
Build with Xilinx Yocto
Source the Yocto Environment
Setupsdk is a Xilinx script which configures the Xilinx Yocto environment. Essentially it's a wrapper for the familiar "oe-init-build-env" Yocto script.
Bitbake the Image
Finally bitbake the target image "petalinux-image-minimal". You can pass the target machine on the command line or add it to your local.conf as the default machine. When the build is completes, your images are located in "build/tmp/deploy/images/<machine>". In this example we are building for the ZCU102.
Other available machines, e.g. zcu706-zynqmp, ultra96-zynqmp, zc706-zynq7, can be found under "sources/meta-xilinx/meta-xilinx-bsp/conf/machine"
Install the Images
Finally let's install the images onto an SD card. The directory structure is slightly different depending on whether you are installing with boot.scr or extlinux.conf, so both are shown below. Cd into the deploy images directory for the machine you just built.
This section assumes the first partition of your SD card is mounted on "boot" and the second partition (if required) is mounted on "rootfs".
Install with Boot.scr
The default boot.scr expects your device tree blob to be named system.dtb
Install with Extlinux
Device Tree Blobs
There may be multiple dtb files in your machine's deploy directory:
- <machine>-system.dtb is the dtb generated by DTG. This will include device tree nodes that include PCW and PL devices.
- <kernel-dts>.dtb is the dtb generated from the dts in the kernel tree. This is good for debugging if the kernel won't boot with the PL.
- Creating a Custom Xilinx Yocto Layer
- Customizing Device Trees in Xilinx Yocto
- Adding an HDF to a Xilinx Yocto Layer
- Xilinx Yocto Builds without an Internet Connection
- Docker on Zynq Ultrascale+ (Xilinx Yocto Flow)