Entry: Zynq design from scratch. Part 54. Sunday, September 28, 2014

Booting PetaLinux 2014.2 from an SD card

We will create a new PetaLinux image and store it on the SD card. When we power up the ZedBoard it will automatically start up.
Set jumpers for boot from SD card.

Using the pre-built image

We start by putting the pre-built image on the SD card and boot PetaLinux.

We use the petalinux-package command to generate a BOOT.bin file containing the first-stage bootloader, U-Boot and the bitstream.

-->petalinux-package --boot --fsbl .../zynq_fsbl --fpga .../download.bit --uboot

Copy files to SD card

Copy the BOOT.BIN and the image.ub files to the SD card in this order.

Power on the ZedBoard

Insert the SD card in the card slot, connect a terminal and power on the board. The boot process will start and we see the U-boot prompt. Then press any key to stop U-boot.  The default boot command in U-boot tries to boot from the system memory. We must change it to boot from the SD card instead. Here is the command to do that:

U-Boot-PetaLinux> setenv bootcmd 'run sdboot'; saveenv

Then type reset to restart the boot process. 

This time the system will boot and show the login prompt.

New board bringup

We follow the Petalinux Board Bringup Guide to create the new PetaLinux BSP. Normally there are three stages to the board bringup process:
  1. Create and/or configure a hardware platform ready for PetaLinux.
  2. Export the hardware platform configuration settings into the new software platform and complete any further software platform configuration steps.
  3. Build the first stage bootloader (FSBL), U-Boot and the linux image.
A few things have changed since we used PetaLinux 2013.10 in part41, so we will go through the whole flow once more.

Create a new PetaLinux platform

The first step is to create a new PetaLinux SDK software platform, ready for building a Linux system customized to our hardware platform. The petalinux-create command is used to achieve this:

-> petalinux-create --type project --template <CPU_TYPE> --name <PROJECT_NAME>

CPU_TYPE      (zynq or microblaze)
PROJECT_NAME  (the name of the platform we are building)

Here is the result.

Fixing software bugs

Before we can continue, we have to fix two software bugs in the PetaLinux design flow.
  1. Use an earlier version of grep (2.6.3)
  2. Add update-rc.d to the Petalinux bin directory

Here is a solution for the first problem found in the Xilinx forum.

Here is a solution for the second problem I found in the Xilinx forum.

Now we are ready to continue the board bringup task.

Import hardware description

1. Go to the directory which contains the hardware description (system_wrapper.hdf) generated from Vivado (LED_Controller.sdk).

-->cd ..../LED_Dimmer/LED_Controller.sdk

2. Import the hardware description with the command: petalinux-config --get-hw-description -p <plnx-proj-root>

The -p option points to the PetaLinux project (PetaZed) that will be updated to match the hardware platform configuration.

It launches the top system configuration menu when the command is used the first time or the tool detects there is a change in the system configuration.

3. We will exit without making any changes.

Build system image

1. Change into the directory of our PetaLinux project (PetaZed).

2. Run petalinux-build to build the system image


3. When the build has finished the following files have been written to the images/linux directory.

4. Follow the description in the beginning of this blog entry to put the image on an SD card and boot PetaLinux on the ZedBoard.


Fixing software bugs slows down the development speed.

Top   Previous   Next


Leave a Comment:


Homepage (optional)