Quick start guide - Digilent/petalinux-bsps GitHub Wiki

Introduction

This section provides a quick guide to

  • Test prebuilt images
  • Rebuild the PetaLinux BSP
  • Test rebuild images

Prerequisites

  • PetaLinux Tools v2015.4
  • Xilinx Vivado v2015.4
  • PetaLinux Tools and Vivado Tools must be sourced

Notes

  • Remote repo may requires Internet access

Install BSP

  • Method 1: Cloning the projects and BSPswith git

    $ git clone https://github.com/Digilent/petalinux-bsps.git

In the petalinux-bsps folder, you will see two folders:

* projects: holds the PetaLinux projects in source format. each sub-folder
  represents a project design and you can run petalinux-xxx commands
  directly within echo project directory
* releases: holds all the PetaLinux BSPs in .bsp fromat that generated base
  on projects in projects folder. To use the .bsp file, please refer to Method 2.

Important Note: You must run "petalinux-config" before building the project. The reason for this is because git does not revision control empty folders. Currently the zynq_fsbl_bsp Makefile does not work property (not triggering rebuild) if the bsp lib (ps7_cortexa9_0/lib) directory is missing.

For more detailed information, please refer to ["The petalinux-create Tool" section of PetaLinux Command Line Reference documentation] (http://www.xilinx.com/support/documentation/sw_manuals/petalinux2015_4/ug1157-petalinux-tools-command-line-guide.pdf)

Boot the pre-built images

There are couple methods to test the pre-built images provided in the BSP.

  • Boot system via JTAG:

    • Ensure the board is configured as JTAG boot mode

      ZYBO: Set JP5 to "JTAG"

    • Go to BSP directory

    • Boot with Petalinux command

      • Boot prebuilt kernel

      $ petalinux-boot --jtag --prebuilt 3

      Once the process is completed, you will see kernel booting on the console

      • Boot prebuilt u-boot

      $ petalinux-boot --jtag --prebuilt 2

      Once the process is completed, you will see u-boot booting on the console

      For more detailed information, please refer to ["Using petalinux-boot Command with Prebuilt Images" section of PetaLinux Tools Documentation] (http://www.xilinx.com/support/documentation/sw_manuals/petalinux2015_4/ug1144-petalinux-tools-reference-guide.pdf)

  • Boot system with SD/MMC card:

    • Ensure the first partition of the SD/MMC card is FAT

    • Copy the following images from <path to bsp>/pre-built/linux/images/ to SD/MMC

      • BOOT.BIN
      • image.ub
    • Ensure the board is configured as SD/MMC boot mode

      ZYBO: Set JP5 to "SD"

    • Power cycle the board

    Without interrupting the U-Boot, it should automatically boot into kernel.

    For more detailed information, please refer to ["Boot a PetaLinux Image on Hardware with SD Card" section of PetaLinux Tools Documentation] (http://www.xilinx.com/support/documentation/sw_manuals/petalinux2015_4/ug1144-petalinux-tools-reference-guide.pdf)

PetaLinux BSP configurations

This section provides the basic introduction to reconfigure the BSP. Some BSPs may take longer to finish the configuration after exit the configuration menu. This is mostly due to remote repo is used for Kernel/U-Boot.

  • overall system configurations - This menu provides the overall system configuration, such as generating zynq_fsbl, dtses, customised kernel/u-boot and etc.

    $ petalinux-config

  • Kernel configurations - This enters the Kenrel menuconfig

    $ petalinux-config -c kernel

  • U-Boot configurations - This enters the U-Boot menuconfig

    $ petalinux-config -c uboot

  • rootfs configurations - This menu allows to you to select/deselect what packages/apps/libs shall installed in the rootfs.

    $ petalinux-config -c rootfs

This could take a while as remote kernel and u-boot repo are used.

For more detailed information, please refer to ["The petalinux-config Tool" section of PetaLinux Command Line Reference documentation] (http://www.xilinx.com/support/documentation/sw_manuals/petalinux2015_4/ug1157-petalinux-tools-command-line-guide.pdf)

Important Note!!!

Currently, PetaLinux tools does not check if the remote has updated or not. In order to fetch the remote repo again or fetch the update. You must run he following command manually:

$ petalinux-build -c <COMPONENT> -x mrproper

This will remove the existing remote of the specified COMPONENT, where COMPOENT can be either "kernel" or "u-boot".

Build

Once the BSP is configured, run the following command to rebuild BSP.

$ petalinux-build

This take some time dependent on your workstation configurations

Boot

There are couple methods to test the images.

  • Boot system via JTAG:

    • Ensure the board is configured as JTAG boot mode

      ZYBO: Set JP5 to "JTAG"

    • Go to BSP directory

    • Boot with Petalinux command

      • alternative is load the existing images

      $ petalinux-boot --jtag --fpga -i <path to bsp>/images/linux/zynq_fsbl.elf

      Alternative is using the prebuilt fsbl and bitstream

      $ petalinux-boot --jtag --prebuilt 1

      • Boot u-boot

      $ petalinux-boot --jtag --u-boot

      • Boot kernel

      $ petalinux-boot --jtag --kernel

      Once the process is completed, you will see u-boot booting on the console

      For more detailed information, please refer to ["Details for the petalinux-boot --jtag Workflow" section of PetaLinux Command Line Reference] (http://www.xilinx.com/support/documentation/sw_manuals/petalinux2015_4/ug1157-petalinux-tools-command-line-guide.pdf)

  • Boot system with SD/MMC card:

    • Package the BOOT.BIN

    petalinux-package --boot --u-boot --fpga <path to bsp>/pre-built/linux/implementation/download.bit --fsbl <path to bsp>/images/linux/zynq_fsbl.elf

    • Ensure the first partition of the SD/MMC card is FAT

    • Copy the following images from <path to bsp>/images/linux/ to SD/MMC

      • BOOT.BIN
      • image.ub
    • Ensure the board is configured as SD/MMC boot mode

      ZYBO: Set JP5 to "SD"

    • Power cycle the board

    Without interrupting the U-Boot, it should automatically boot into kernel.

    For more detailed information, please refer to ["Boot a PetaLinux Image on Hardware with SD Card" section of PetaLinux Tools Documentation] (http://www.xilinx.com/support/documentation/sw_manuals/petalinux2015_4/ug1144-petalinux-tools-reference-guide.pdf)

Known issues

  1. Audio:
  • Playback might get distortion
    • Canceling playback case the future playback distortion
    • After recording
  1. HDMI:
  • Screen does not wake up from screen saver (console blank). Currently we have disable the console blank by default for FrameBuffer console. This is handled by user app console-blank.
  1. U-Boot compilation warning due to XYZ redefined: These warning are harmless and caused by macro redefined in multiple files. You can remove the warning by add undefine the redefined macro in subsystems/linux/configs/u-boot/platform-top.h. We have already add a set of "undef" in the file to avoid the warning for current configuration.
⚠️ **GitHub.com Fallback** ⚠️