Bar
SpaceWire UK
Specialist providers of VHDL Intellectual Property & Design Services
BarBarBarBar
Tutorial
Missing Image!
Part 9 - Boot PetaLinux from SD Card

Introduction

This tutorial details the steps required to boot PetaLinux using a SD card.

Aims

The aims of this tutorial are as follows :-
  1. Setup environment
  2. Change present working directory
  3. Package project to produce boot image
  4. Copy files to SD Card
  5. Deploy on Zedboard via SD Card
  6. Launch terminal emulator
  7. Check the SD card boot is working

1. Setup environment

Setup Xilinx design environment for the 2021.2 toolset.
steve@Desktop:~$ xilinx
Xilinx tools available tools at /opt/Xilinx :-
1) 2021.2 - Vivado - SDK - Vitis - PetaLinux
0) Exit
Please select tools required or exit : 1

Tools are as follows :-
vivado @ /opt/Xilinx/Vivado/2021.2/bin/vivado
vitis @ /opt/Xilinx/Vitis/2021.2/bin/vitis
petalinux-build @ /opt/Xilinx/PetaLinux/2021.2/tool/tools/common/petalinux/bin/petalinux-build

2. Change present working directory

Change the present working directory to be the project directory.
steve@Desktop:~$ cd ~/projects/zedboard_linux/os/petalinux

3. Package project to produce boot image

Package the project to produce the boot image BOOT.BIN, this will include the first stage boot loader zynq_fsbl.elf, the programmable logic system.bit, the Linux boot loader u-boot.elf and the device tree blob system.dtb.
steve@Desktop:~/projects/zedboard_linux/os/petalinux$ petalinux-package --boot --force --fsbl images/linux/zynq_fsbl.elf --fpga images/linux/system.bit --uboot images/linux/u-boot.elf

4. Copy files to SD Card

Mount a FAT32 formatted SD card on the Xubuntu desktop and copy the required files onto it, then unmount the card so that it is ready for use on the Zedboard.
steve@Desktop:~/projects/zedboard_linux/os/petalinux$ cp /tftpboot/{BOOT.BIN,boot.scr,image.ub} /media/steve/petalinux

5. Deploy on Zedboard via SD Card

Power off the Zedboard, set the boot mode jumpers for SD card boot, insert the SD card and then power on the board. Missing Image!

6. Launch terminal emulator

If not already running, open up a new terminal and launch the MiniCom terminal emulator.
steve@Desktop:~$ minized

Welcome to minicom 2.7.1

OPTIONS: I18n
Compiled on Dec 23 2019, 02:06:26.
Port /dev/ttyACM0, 06:34:25

Press CTRL-A Z for help on special keys

7. Check the SD card boot is working

The SD card boot is much the same as the JTAG boot. The blue done LED should illuminate early on in the boot process indicating that the PL part of the FPGA has been programmed. PetaLinux should then boot up in the PS and ultimately provide a login prompt via the terminal emulator.