By Adam Taylor

As I discussed last week, Petalinux is the official Linux distribution for the Zynq SoC. To get the most out of this distribution, we need to be able to build our own version. This requires development on a Linux system. Now, not all of us develop on these systems so creating a new machine can be expensive and time consuming. I will therefore be using a Virtual Machine to provide access to the Petalinux distribution. I have used a similar approach previously to use the CERN libre Filter design tool and it has worked well for me.

I’ll be using the Oracle VM Virtual Box machine and creating an Ubuntu installation of Linux on this virtual machine. This is very simple to achieve. First, download the VM virtual box and an Ubuntu ISO onto the hard drive of your host machine.

Once you have installed the VM Virtual box the next step is to select new on the virtual box manager and create your virtual Linux machine.

The next few steps require you to allocate non-volatile memory resources that the machine is allowed to use and to create a virtual hard drive. Following this you can then power up the machine and install Ubuntu just as you would on a new machine using the ISO you downloaded. It is that simple.

Once the installation is complete we will want to do the following within our virtual machine:

Visit the Petalinux wiki page, which has a number of very useful “getting started” guides http://www.wiki.xilinx.com/PetaLinux

Download the Petalinux SDK

Obtain a license for the Petalinux SDK

Download the MicroZed BSP from zedboard.org

Ensure that all of the libraries are installed – see the Petalinux installation guide required tools and libraries section. These can be obtained using a terminal window and the sudo apt-get install command

Downloading Petalinux

Downloading the BSP for the MicroZed

Once we have downloaded all of these files, the next step is to create a directory into which we can install our Petalinux installation. You can do this using a terminal window. Next, we change to the target working directory and run the command below to install:

sudo ./petalinux-v2013.10-final-installer.run

Having installed the Petalinux on your virtual machine, the next step is to ensure that the environment variable is set so that we can use it to build a project and ensure our Petllinux installation is good. To do this we navigate to the installed directory and issue the command below in a terminal window:

Source settings.sh

We can then verify this is correct by running the command

Echo $PETALINUX

This should return with the installed path for your Petalinux installation. Having installed Petalinux, the next step is to create a simple as built project and ensure that it functions correctly. We have two methods of doing this we can use QEMU which allows simulation of the built file.

To build the project, we use the command:

Petalinux –create –t projects –s <location of bsp download>/Avent-MicroZed-z7010-v2014.2.bsp

If successful you will see an image as below in your terminal window:

Having created the example, we can simulate it using QEMU within our virtual machine by navigating to the project directory and running the following command:

Petalinux-boot - -qemu - -prebuilt 3

Where levels 1 to 3 at the end of the prebuilt shows the level of the boot e.g.

1 = configuration of the FPGA

2 = Configuration of the FPGA + Uboot

3 = FPGA + UBoot + pre built linux image

For this example both the user name and passwords are set to “root”.

We will explore Petalinux further In the next blog.