By Adam Taylor

Having correctly installed the SDK on our virtual machine, we need to look at how we can create our own application using Linux. This often requires a new definition of the Zynq SoC’s hardware.

The first thing we need to do is ensure that we have downloaded and installed the Vivado Design Suite and SDK onto our virtual machine. We will need these applications to create the Zynq SoC hardware definition and to develop the software environment as well.

Once these have been created we can do the following:

1. Create the Zynq hardware we require, ensuring that we have the following:

UART (Required)

SD Card Configuration (Optional)

Ethernet (Optional)

TTC (Triple Timer Counter, Required)

2. Export the hardware to SDK and then open SDK, allowing us to create the followin

Add in the EDK user repository under your Petalinux installation. This is located under tools -> repositories within SDK and under the components directory within your Petalinux installation

Create an FSBL (First Stage Boot Loader) using the stand alone BSP. If you are unsure how to do this, part six of this series addresses this.

Create a BSP (board support package) for the Petalinux application we wish to develop, remembering to select the Petalinux drop down from the OS tab as shown below. Again for those unfamiliar, part two of this series details how to create a BSP.

Having created the BSP, we need to configure it to use the std_in and std_out on our selected UART (ps7_uart_0 in this case) and to execute its code from the main memory (ps7_ddr_0 in this case also).

So far we have been using tools we are familiar with and have been running through similar steps that have been used before—for instance, when we added in μC/OS-III for the Zynq SoC. However, now we can begin to use the Petalinux SDK.

The first step within SDK is to create a new project we can do this using the command:

$petalinux-create --type project --template zynq -- name week55

This will create a project for us within the top level of our Petalinux directory:

The next step is to ensure that we capture the settings of our hardware system using the previously created BSP. To do this, we navigate to the BSP directory and point back to the project we just created using the command:

$petalinx-config -- get-hw-description –p /home/adam/petalinux-v2014.2/final/week55

The resultant files—which include the device tree, a new xparameters.h, and a config.mk file—are located within the directory <project>/subsystems/linux/hw-description.

The final steps of the build then require us to navigate back to our working directory within this directory. We can:

Configure the top level system using the command $petalinux-config for instance if we are booting from a SD card

Configure the kernel using the command $petalinux-config –c kernel

Configure the rootfs using the command $petalinux-config –c rootfs

Once we are happy with the optional customizations using the above commands, we need to build the system. This is as simple as issuing a $petalinux-build command.

We create the boot image using the command:

$petalinux-package –boot – fsbl<path toimage> –fpga<path to bit file> --uboot

We can then boot our system and test it, although it would be a good idea to first simulate it using QEMU.

Please see the previous entries in this MicroZed series by Adam Taylor:

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

Adam Taylor’s MicroZed Chronicles Part 53: Linux and SMP

Adam Taylor’s MicroZed Chronicles Part 52: One year and 151,000 views later. Big, Big Bonus PDF!

Adam Taylor’s MicroZed Chronicles Part 51: Interrupts and AMP

Adam Taylor’s MicroZed Chronicles Part 50: AMP and the Zynq SoC’s OCM (On-Chip Memory)

Adam Taylor’s MicroZed Chronicles Part 49: Using the Zynq SoC’s On-Chip Memory for AMP Communications

Adam Taylor’s MicroZed Chronicles Part 48: Bare-Metal AMP (Asymmetric Multiprocessing)

Adam Taylor’s MicroZed Chronicles Part 47: AMP—Asymmetric Multiprocessing on the Zynq SoC

Adam Taylor’s MicroZed Chronicles Part 46: Using both of the Zynq SoC’s ARM Cortex-A9 Cores

Adam Taylor’s MicroZed Chronicles Part 44: MicroZed Operating Systems—FreeRTOS

Adam Taylor’s MicroZed Chronicles Part 43: XADC Alarms and Interrupts

Adam Taylor’s MicroZed Chronicles MicroZed Part 42: MicroZed Operating Systems Part 4

Adam Taylor’s MicroZed Chronicles MicroZed Part 41: MicroZed Operating Systems Part 3

Adam Taylor’s MicroZed Chronicles MicroZed Part 40: MicroZed Operating Systems Part Two

Adam Taylor’s MicroZed Chronicles MicroZed Part 39: MicroZed Operating Systems Part One

Adam Taylor’s MicroZed Chronicles MicroZed Part 38 – Answering a question on Interrupts

Adam Taylor’s MicroZed Chronicles Part 37: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 8

Adam Taylor’s MicroZed Chronicles Part 36: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 7

Adam Taylor’s MicroZed Chronicles Part 35: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 6

Adam Taylor’s MicroZed Chronicles Part 34: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 5

Adam Taylor’s MicroZed Chronicles Part 33: Driving Adafruit RGB NeoPixel LED arrays with the Zynq SoC

Adam Taylor’s MicroZed Chronicles Part 32: Driving Adafruit RGB NeoPixel LED arrays

Adam Taylor’s MicroZed Chronicles Part 31: Systems of Modules, Driving RGB NeoPixel LED arrays

Adam Taylor’s MicroZed Chronicles Part 30: The MicroZed I/O Carrier Card

Zynq DMA Part Two – Adam Taylor’s MicroZed Chronicles Part 29

The Zynq PS/PL, Part Eight: Zynq DMA – Adam Taylor’s MicroZed Chronicles Part 28

The Zynq PS/PL, Part Seven: Adam Taylor’s MicroZed Chronicles Part 27

The Zynq PS/PL, Part Six: Adam Taylor’s MicroZed Chronicles Part 26

The Zynq PS/PL, Part Five: Adam Taylor’s MicroZed Chronicles Part 25

The Zynq PS/PL, Part Four: Adam Taylor’s MicroZed Chronicles Part 24

The Zynq PS/PL, Part Three: Adam Taylor’s MicroZed Chronicles Part 23

The Zynq PS/PL, Part Two: Adam Taylor’s MicroZed Chronicles Part 22

The Zynq PS/PL, Part One: Adam Taylor’s MicroZed Chronicles Part 21

Introduction to the Zynq Triple Timer Counter Part Four: Adam Taylor’s MicroZed Chronicles Part 20

Introduction to the Zynq Triple Timer Counter Part Three: Adam Taylor’s MicroZed Chronicles Part 19

Introduction to the Zynq Triple Timer Counter Part Two: Adam Taylor’s MicroZed Chronicles Part 18

Introduction to the Zynq Triple Timer Counter Part One: Adam Taylor’s MicroZed Chronicles Part 17

The Zynq SoC’s Private Watchdog: Adam Taylor’s MicroZed Chronicles Part 16

Implementing the Zynq SoC’s Private Timer: Adam Taylor’s MicroZed Chronicles Part 15

MicroZed Timers, Clocks and Watchdogs: Adam Taylor’s MicroZed Chronicles Part 14

More About MicroZed Interrupts: Adam Taylor’s MicroZed Chronicles Part 13

MicroZed Interrupts: Adam Taylor’s MicroZed Chronicles Part 12

Using the MicroZed Button for Input: Adam Taylor’s MicroZed Chronicles Part 11

Driving the Zynq SoC's GPIO: Adam Taylor’s MicroZed Chronicles Part 10

Meet the Zynq MIO: Adam Taylor’s MicroZed Chronicles Part 9

MicroZed XADC Software: Adam Taylor’s MicroZed Chronicles Part 8

Getting the XADC Running on the MicroZed: Adam Taylor’s MicroZed Chronicles Part 7

A Boot Loader for MicroZed. Adam Taylor’s MicroZed Chronicles, Part 6

Figuring out the MicroZed Boot Loader – Adam Taylor’s MicroZed Chronicles, Part 5

Running your programs on the MicroZed – Adam Taylor’s MicroZed Chronicles, Part 4

Zynq and MicroZed say “Hello World”-- Adam Taylor’s MicroZed Chronicles, Part 3

Adam Taylor’s MicroZed Chronicles: Setting the SW Scene

Bringing up the Avnet MicroZed with Vivado