Creating Linux Boot Files for QSPI Flash on ZYNQ

In this article, we learned how to customize Linux using PetaLinux and created a boot file for the SD card. This issue introduces how to configure PetaLinux to generate a Linux image file that boots from QSPI Flash.

Copying the PetaLinux Project

If we want to keep the PetaLinux project that boots from the SD card but do not want to create a new one, we can copy the old project.

  • In the project directory, press Ctrl + H to show hidden files, and copy project-spec, .petalinux, and config.project to a new directory as a new PetaLinux project.
Creating Linux Boot Files for QSPI Flash on ZYNQ
  • Then copy the bit files from the images/linux directory to the new project directory for synthesizing the BOOT with PL configuration.
Creating Linux Boot Files for QSPI Flash on ZYNQ

Reconfiguring and Compiling PetaLinux

  • Enter the new project and right-click to open the terminal.
Creating Linux Boot Files for QSPI Flash on ZYNQ
  • Configure the Vivado and PetaLinux environment variables.
source /opt/pkg/petalinux/settings.sh
source /opt/Xilinx/Vivado/2017.4/settings64.sh
Creating Linux Boot Files for QSPI Flash on ZYNQ
  • Use the petalinux-config command to configure the PetaLinux project.
petalinux-config
Creating Linux Boot Files for QSPI Flash on ZYNQ
  • Enter the PetaLinux configuration interface.
Creating Linux Boot Files for QSPI Flash on ZYNQ
  • In the Subsystem AUTO Hardware Settings ---> Advanced bootable images storage Settings ---> boot image settings ---> image storage media option, select primary flash.
Creating Linux Boot Files for QSPI Flash on ZYNQ
  • In the Subsystem AUTO Hardware Settings ---> Advanced bootable images storage Settings ---> kernel image settings ---> image storage media option, select primary flash.
Creating Linux Boot Files for QSPI Flash on ZYNQ
  • In Subsystem AUTO Hardware Settings → Flash Settings, you can modify the partition of QSPI flash. The default settings are generally usable, but if your file size exceeds the default partition size, you will need to adjust it yourself.
Creating Linux Boot Files for QSPI Flash on ZYNQ
  • In Image Packaging Configuration ---> Root filesystem type, select INITRAMFS to use a RAM type root filesystem, which makes it easier to package and write to QSPI Flash.
Creating Linux Boot Files for QSPI Flash on ZYNQ
  • In Firmware Version Configuration, you can modify information such as Host name.
Creating Linux Boot Files for QSPI Flash on ZYNQ
  • Save the configuration and exit the PetaLinux project configuration interface.
Creating Linux Boot Files for QSPI Flash on ZYNQ
  • Use the petalinux-build command to compile the project.
Creating Linux Boot Files for QSPI Flash on ZYNQ
  • Use the following command to synthesize BOOT, with the difference from the previous tutorial being the addition of the --kernel option, which packages the kernel into the BOOT.BIN file.
petalinux-package --boot --fsbl ./images/linux/zynq_fsbl.elf --fpga ./images/linux/platform.bit --u-boot --kernel --force
Creating Linux Boot Files for QSPI Flash on ZYNQ
  • Successfully generated the BOOT.BIN file, which is the Linux boot file that we can write to QSPI Flash.
Creating Linux Boot Files for QSPI Flash on ZYNQ

The End

Creating Linux Boot Files for QSPI Flash on ZYNQ

Share, bookmark, like, and follow!

Creating Linux Boot Files for QSPI Flash on ZYNQ

Leave a Comment