Building Linux For The Zynq ZC702 Eval Kit Using Yocto


Xilinx provides device and board information for the Zynq SoC for Yocto through the repository meta-xilinx. This includes board information for the ZC702 Evaluation Kit.

This tutorial has been tested on Ubuntu 16.04 64bit, running inside a VMware virtual machine on a Windows host. Exact procedure and commands might have to be changed slightly for other configurations.

More information on building and booting Linux on the Zyqn ZC702 using Yocto can be found at the Xilinx pages and

Download/Setup Yocto

If you want to get more familiar with Yocto, check out the Yocto Quick Start guide.

Firstly, install all the dependencies needed by Yocto:

Then we need to get a Yocto release. We will use the pocky release for this tutorial:

 Now enter the poky directory:

Switch to the morty branch:

Configuring Yocto For The ZC702 Eval Kit

Now that Yocto has been setup, we need to configure it for the Xilinx ZC702 Evaluation Kit.

To start this step, we need to clone the meta-xilinx repository into the Yocto source directory (e.g. poky/).

This should clone the repo into ~/poky/meta-xilinx/.

We then need to make sure the branch of meta-xilinx is the same as the branch of poky.

Then go back to the poky directory, and initialise the build environment:

You should now automatically be in the ~/poky/build directory. Tell bitbake about the new meta-xilinx layer:

Add the following line to the conf/local.conf file:

We then start the build with:

Go have lunch! This build is going to take a while…

Screenshot while building embedded Linux for the ZC702 Eval Kit board using Yocto.

Booting Via SD Card

The ZC702 can be configured to boot a Yocto Linux distribution from the SD card. The following instructions show how:

Setting Up A Bootable SD Card

Use dd to erase the first sector (replace X with the number of the SD card):

~$ dd if=/dev/zero of=/dev/sdX bs=1024 count=1 

Now let’s partition the SD card using the interactive fdisk command:

Follow the following procedure, entering commands such as n, a and t where shown (the rest is fdisk output).

Now set the bootable flag for the first partition, and set the partition IDs:

Check the new partition table is correct, and then write the changes:

Create file systems on the new partitions (this would cause VirtualBox to crash, but seemed to work fine using VMWare Workstation):

Mount the partitions, sdX1 being the first partition (boot), and sdX2 being the second partition (where the root filesystem will be placed).

Copying Build Output Onto SD Card

You will want to copy over the following files from poky/build/tmp/deploy/<image>/ onto the first partition (boot partition) of the SD card. 

We now will extract the root filesystem onto the second partition:

NOTE: If you now insert this SD into windows, you should be able to see the files on the first (boot) partition, but not those on the second partition.

uEnv.txt should contain information similar to the following:

Booting From SD Card

Insert the SD card onto the ZC702 dev board. Make sure the DIP switches (SW16) on the ZC702 board are set as follows:

  • 1 -> LOW
  • 2 -> LOW
  • 3 -> HIGH
  • 4 -> HIGH
  • 5 -> LOW

Connect a cable from the mini-USB port on the dev. board (labelled J17 or “USB UART”) to your computer. Open a terminal on the COM port with the following settings:

  • Baud rate = 115000
  • Num. data bits = 8
  • Parity = None
  • Num. stop bits = 1
  • Flow control = None

Now turn on the power switch to the dev. board. Hopefully, you should see it boot up!

The terminal output during the start of a Linux boot built using Yocty, and running on the Xilinx ZC702 dev. board.

You should be able to log in as user root, with no password.

Booting Via TFTP

You can also use TFTP to transfer and boot compiled images from your desktop computer to the embedded device. The embedded device must have an internet/intranet connection to do so (e.g. Ethernet).

You must remember that U-Boot is required to be already present on the embedded device to support TFTP (you obviously need TFTP drivers to perform the communication, and this is what U-Boot provides). You can use TFTP to download the Linux kernel image, root filesystem and device tree.

The above command assumes you have set up tftp on your server and then copied the Yocto build output into your tftpboot folder (e.g. /tftpboot/). Even better, you can make /tftpboot a symlink to your build directory:

You can then run this command by simply typing:


In my experience, it usually takes about 30s from the time you type boot to the time to get to the Linux login screen, which includes downloading the files via TFTP and then booting the Linux image (for a 100MiB or so filesystem).

Booting Via Flash

Yocto produces a boot.bin file when building a Linux image for the ZC-702 (using the meta-xilinx layer), but this doesn’t seem to be directly suitable for QSPI flash boot. 

Create A FSBL Using Xilinx SDK

Load up the SDK. Select New->Application Project.

Creating a “New Application” in the Xilinx SDK.

Enter a name:

Give the Zynq FSBL project a name and make sure the right platform/processor is selected.

Click Next. Select FSBL.

Select “Zynq FSBL” as the template for the application.

The Xilinx SDK should now create all the necessary files and run the build once.

This should create a FSBL as a .elf file in the Debug build directory.

Xilinx also has instructions for creating a Zynq FSBL at

Create bootimage.bif

Manually create a bootimage.bif ( bif is an acronym for Bootable Image Format) file using a text editor. It is pretty simple, and just needs to contain the following code:

This file is used as a configuration file for bootgen (see below).

Create Flash Image Using bootgen

bootgen is a command-line application provided by the Xilinx SDK. It is used to stitch together the many files needed for an embedded OS to boot properly into one image file. For myself, it was located at /opt/Xilinx/SDK/2017.1/bin/.

Use the following command:

This creates a BOOT.bin file from the bootimage.bif and the sources listed in the bootimage.bif file.

More information about bootgen can be found in Appendix A – Using Bootgen (page 55) of

Program The Flash

You can program the flash connected to the Zynq on the ZC-702 using Xilinx’s xsdb and  program_flash utilities.

Firstly, make sure the micro-USB cable to the JTAG device on the ZC-702 (U23) is connected to your Linux OS (see the Installing xsdb And JTAG Drivers page for more info).

The, connect to the target using xsdb:

Then use the program_flash utility to write the BOOT.bin  file generated above to the flash:

More information on the Program Flash Utility can be found in the Embedded System Tools Reference Manual (UG1043).

Running In The Simulator (QEMU)

This assumes you have poky already downloaded onto your computer (see above). Create a new build directory for the QEMU build.

Note how an argument was provided to oe-init-build-env this time ( build-qemu). This tells oe-init-build-env to initialise a build directory called build-qemu/ instead of the default, which is just build/ (we will keep build/ for the Linux build that runs on the real hardware).

Start the Linux build:

Now run QEMU, passing in the location of the just-built QEMU configuration file.

The final stages of a Yocto Linux (built for the Xilinx ZC702 dev. board) boot running in QEMU.

You should be able to log onto the Linux system with the username root, no password required.

Help! I Get A “No Recipes Available For…” Error

Is your error similar to:

This can happen if you forgot to checkout the correct branch of meta-xilinx. Remember, when you use the command git clone, it will checkout the master branch. You then need to checkout the branch which matches the branch of poky you are using (this was morty  when I did it), e.g.

Other Resources explains how to make a bootable SD card using Linux.

Posted: April 18th, 2017 at 8:31 am
Last Updated on: January 11th, 2018 at 9:55 am