We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Adam Taylor’s MicroZed Chronicles Part 54: Peta Linux SDK for the Zynq SoC

by Xilinx Employee ‎10-20-2014 10:23 AM - edited ‎10-21-2014 12:44 PM (72,211 Views)


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.



Image 1.jpg



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 <package> command



 Image 2.jpg



Downloading Petalinux





Image 3.jpg



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




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:



Image 4.jpg




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



 Image 5.jpg




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


We will explore Petalinux further In the next blog.

by Visitor gpsat
on ‎11-25-2014 01:27 PM

Just trying to check that these comments are moderated, as I'm unsure if my previous comment was posted/moderated/lost when I rebooted.

About the Author
  • Be sure to join the Xilinx LinkedIn group to get an update for every new Xcell Daily post! ******************** Steve Leibson is the Director of Strategic Marketing and Business Planning at Xilinx. He started as a system design engineer at HP in the early days of desktop computing, then switched to EDA at Cadnetix, and subsequently became a technical editor for EDN Magazine. He's served as Editor in Chief of EDN Magazine, Embedded Developers Journal, and Microprocessor Report. He has extensive experience in computing, microprocessors, microcontrollers, embedded systems design, design IP, EDA, and programmable logic.