This article is a complete flow to create a Linux image for the ZCU102 using Yocto 2017.1. This is aimed to fast-track novices to Linux, as the article details all the steps from

setting up the Virtual Machine, installing Ubuntu 16.04, installing all the libraries, and tools needed to use Yocto.

Table of Contents

Introduction

There are some files mentioned in this article. These can be found here
yocto_ubuntu.zip


  • This flow has been validated in Yocto 2018.1
  • Note: The installation of the Virtual Machine is given as a guide only. Users will need to check with their IT dept on installation guidelines.


Download the 16.04 Ubuntu ISO:

This can be obtained from here

Installing and configuring Virtualbox:

Virtualbox can be downloaded from here.

Launch Virtualbox, and select New:

In Settings -> Storage -> Optical drives. Select the disk icon and point to the ISO downloaded in the previous step.

In Settings -> Network, change to Bridged Adapter. This will send all the packets to the VM:


Install Ubuntu:

Boot, and Install Ubuntu. The user will need to choose the storage size. 100G is recommended.

Network Setup:

Once installed, go to Settings -> Network and under the Network Proxy, set the HTTP Proxy and the HTTPS Proxy.
Note: you may need to contact your IT dept for help here.

To verify if your proxy is set correctly, you can run a "wget www.xilinx.com" (or any website) from the terminal.

Shared folder Setup:

We need to be able to share files from Host to the Guest OS. So we need to add the Guest Additions.

Devices -> Insert Guest Additions ..

Reboot

Next, go to Devices -> Shared Folders, and point to your shared folder to Transient Folders.
Note the Folder Name as this will be used later.

From Terminal:

SDK 2017.1 install:

Users need to install SDK, as Yocto needs to use XSCT and BootGen

Open Firefox and go to Xilinx.com and go to the Support -> Downloads & Licensing. Click on the Embedded Development tab and install the
SDK 2017.1 web install for Linux 64


Note: To remove SDK, use the command below:


If you want to launch the SDK GUI, you will need to call the command here:


You can also add the tools to the path:


Note: you will need the libs mentioned here to compile a Microblaze app:


Install Required Packages:


Open a terminal, and use the commands below:
Note: for a list of all the packages needed, the Petalinux User guide is a good reference

GIT proxy setup:

git config --global user.email name@email.com
git config --global user.name "Name Surname"

If you are behind a firewall, then the proxy settings should be setup similar to below. However, it is recommended
that you work with your company IT dept if this is the case.

Create a git_source.sh file:

Create a git_proxy file

Users should reference this page here for help on setting this up

Source the commands below on the terminal:

Download Yocto 2017.1:


Create Flattened Image Tree:

Next, we can create a FIT (Flattened Image Tree) Image with the Kernel, devicetree, and the rootfs created in Yocto. These can be found in the deploy folder (/tmp/yocto/2018.1/zcu102-es2/deploy/images/zcu102-zynqmp).
User can copy these to a local directory. For example:

A template FIT (fitImage.its) is delivered with this tutorial, it can be copied here too (remember to change to unix)

We need to use the mkimage delivered in u-boot-tools package to build the ITB:

Boot from SD Card:

Place the BOOT.bin and image.ub onto the SD card and boot u-boot. You will then need to use the command below to boot the kernel:

Then do a recompile:

Place the updated BOOT.bin from the deploy/images/zcu102-zynqmp folder onto the SD card, and boot. Here, the kernel will autoboot.


Update Recipe to add Patch for Uboot:

Instead of manually hacking the u-boot as I did, a better way would be to create a git patch, and add this to the recipe. To do so, you need to create the patch first using git diff against the tag.
For example:

Place the BOOT.bin and image.ub onto the SD card and boot.

Booting ZCU102 on QEMU:

Go to the Local.conf and un-comment the lines below:
#XILINX_QEMUBOOT = "1"
#XILINX_QEMUBOOT_MULTI = "1"
#QB_OPT_XILINX_PMU_ROM = "/home/$USER/Yocto/pmu_rom_qemu_sha3.elf"
Note: The pmu_rom_qemu_sha3.elf used here is delivered in the ZCU102 BSP obtained from here. However, this is added to the attached zip for ease of use.
This can be copied to the Yocto folder.

Rebuild image:

To boot QEMU, use the command below:

To kill the QEMU, use the command:

Execute Baremetal Hello World on CortexA53 on QEMU:

To boot QEMU, use the command below:

To Launch SDK, use the commands below:

Create a workspace. Select Application Project. In the Hardware Platform, select New, and Browse to the HDF file in /home/$USER/shared_folder.
Create a Hello World Application from the templates, and Finish.

Launch XSCT from a terminal (xsct), and use the command below:

In SDK, under Target Connection. Drop down the QEMU TcfGdbClient Server, and either create a new connect, or edit the existing one.
set the Host to localhost, and the Port is the port obtained from connect -l is previous step:



Use the Test Connection to verify that this is setup correctly

Right Click on the Hello World application in SDK Project Explorer, and select Debug -> launch on Hardware (System Debugger on QEMU).

This will launch the debug perspective and allow the user to debug: