Running Petalinux based linux system on Zedboard via jtag and SD card

Summary: This short tutorial demonstrates how to run and test the first petalinux based customized linux system on Zedboard via jtag and SD card.

Implementation: This tutorial is the continuation of the first lecture. It thus assumes that the reader has already created, configured and built a petalinux based customized linux system by using petalinux-create, petalinux-config, and petalinux-build commands, respectively. After building the linux system, it can be run and tested on Zedboard via JTAG. To this end, turn on and set the configuration jumpers of the zedboard into JTAG boot mode (see the figure given below).

Then, run the following command from the project directory of petalinux:

  • petalinux-boot –jtag –prebuilt 3   

The command downloads the newly built linux solution into zedboard. Lastly, connect the serial  port of zedboard with the PC and configure its baud rate to 115200. The serial port allows us to do further actions after the linux system is up.

Second part of the tutorial explains the steps necessary to run the linux system on zedboard via SD card as follows.

  • Generate Boot Image which usually contains a first stage bootloader image, FPGA bitstream (optional) and U-Boot. The syntax of the command used to generate the boot image is following:
    • petalinux-package –boot –fsbl <FSBL image> –fpga <FPGA bitstream> –u-boot
  • Prepare SD card for the linux system
    • Insert and unmount all the partitions of the SD card of size 8 Ghz by using umout command:
      • sudo umount /media/<location of mount>
    • Delete the existing partitions and create two new partitions with the first partition of size 1GHz and remaining size for the other partition.
      • sudo fdisk /dev/<name of the directory>
    • After having two partitions, Format the former by using FAT and the later by using ext4. The syntax of the commands is following
      • mkfs.vfat -F 32 -n BOOT /dev/<first partition>
      • mkfs.ext4 -L rootfs /dev/<second partition>  
  • Copy the the necessary files into first partition of SD card
    • cp images/linux/BOOT.BIN /media/<first partition>
    • cp images/linux/image.ub /media/<first partition>
  • Copy the the necessary files into second partition of SD card
      • cp images/linux/rootfs.cpio /media/<second partion>
  • Insert the SD card into SD card slot of zedboard and Configure it into  SD card boot mode (see figure given below).

Lastly, connect the serial  port of zedboard with the PC and configure its baud rate to 115200. The serial port allows us to do further actions after the linux system is up.

The video given below also explains all the steps needed to run and test first Petalinux based linux solution on Zedboard via jtag and SDcard.