Petalinux Tutorial+Demo: For Avnet Zynq Zedboard
Petalinux Tutorial+Demo: For Avnet Zynq Zedboard
Petalinux Tutorial+Demo: For Avnet Zynq Zedboard
FPGA
4. Ships with XSCT and other Xilinx tools necessary for distribution development and deployment
6. Executes complex Yocto scripts and build process through simple commands
https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html
2. Install the Board Support Package (BSP) corresponding to the Zynq 7000 SoC or the Zynq Ultrascale+ MPSoC from the same
weblink: https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html
4. BSP describes the hardware and various features supported by the hardware
5. The Petalinux Tools installation guides detail the whole procedure for installing and using Petalinux.
6. Each Petalinux version comes with its own updated installation guide
PetaLinux Installation Commands
● For this demo, we use Petalinux2018.3 as an example
To install PetaLinux Tools under ~/Petalinux2018.3, execute the following commands in your home directory :
$ mkdir -p ~/Petalinux
● Change to the installer download directory and execute the following command which will install PetaLinux tools in the Petalinux2018.3 folder
created by you :
$ ./petalinux-v2018.3-final-installer.run ~/Petalinux
● Provided all the dependencies for the installation are available in the system, the installation should be smooth process
● All PetaLinux installer dependencies can be found in that versions installation guide
● Installation guide for PetaLinux 2018.3 can be found at the following weblink :
https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_3/ug1144-petalinux-tools-reference-guide.pdf
Creating a Project
● Type the following command wherever you wish to create the PetaLinux project post-installation :
$ source <path-to-installed-PetaLinux>/settings.sh
● This imports the environment variables necessary for executing PetaLinux specific commands into
the shell environment
● Create a basic project template by typing in the following command :
$ petalinux-create --type project -s <path-to-bsp> --name <PROJECT NAME>
OR $ petalinux-create --type project --template <PLATFORM> --name <PROJECT NAME>
● -s refers to source of the BSP of the evaluation board
● --template specifies the Xilinx SoC platform which is being used(ex. Zynq)
Configuring a Project
● Configure the project as per the hardware designed in Vivado:
● It will pop-up a blue menu-config screen in which system configuration has to be done
● Many other things such as name of boot image file, baud rate for serial connection etc. can be specified here
● The petalinux-config essentially configures the files which would be eventually built by PetaLinux using petalinux-build
Configuring the Kernel
● The Linux kernel in use for the demo is the kernel provided by Xilinx
● Configuration of kernel by the user is not mandatory as a default configuration of kernel is done by PetaLinux using the BSP
● One can Configure the kernel after the petalinux-config command has done executing by typing the following command in project directory :
$ petalinux-config -c kernel
● This command also takes 5-10 minutes to execute before a menu-config screen pops up
● Here, one can configure the kernel by adding/removing features as one wants
● More features associated with kernel means a large kernel file requiring a lot of memory space
● One should also ensure that conflicting features are not activated as it affects build process ( dropbear and ssh for example)
● For this demo, for TFTP booting and NFS root filesystem we activate :
$ petalinux-build
● This command generates this step generates a device tree binary DTB file, a First Stage Bootloader(FSBL), U-Boot, the
Linux kernel FIT image, and compressed root filesystem . Finally, it generates the necessary boot images :
1. BOOT.BIN : A binary file which is responsible for loading the FPGA bitstream, the FSBL and the U-Boot.
2. Image.ub : Contains compressed kernel and device tree
● BitBake is a core component of the Yocto Project and is used by the OpenEmbedded build system to build images.
● BitBake is a generic task execution engine that allows shell and Python tasks to be run efficiently
● BitBake is a build engine that uses the recipes provided to it, to perform specific tasks.
Conclusion
1. PetaLinux Tools is easy to download and Install
4. Anyone can use it to develop a distribution for their Zynq 7000 or Zynq Ultrascale+