Utilities for System Packaging

Creating a Boot Image

Xilinx® FPGAs and system-on-chip (SoC) devices typically have multiple hardware and software binaries used to boot them to function as designed and expected. These binaries can include FPGA bitstreams, firmware images, bootloaders, operating systems, and user-chosen applications that can be loaded in both non-secure and secure methods.

Bootgen is a Xilinx tool that lets you stitch binary files together and generate device boot images. Bootgen defines multiple properties, attributes and parameters that are input while creating boot images for use in a Xilinx device.

  1. Select the application project in Explorer view.
  2. Right-click the application and select Create Boot Image to open the Create Boot Image wizard.
  3. Specify the boot loader and the partitions.

  4. Click Create Image to create the image and generate the BOOT.bin in the <Application_project_name>/_ide/bootimage folder.

For more information about the Bootgen utility, refer to the Bootgen User Guide (UG1283).

Program Flash

Program Flash is a Vitis software platform used to program the flash memories in the design. Various types of flash are supported for programming.

  • For non Zynq devices – Parallel Flash (BPI) and Serial Flash (SPI) from various makes such as Micron and Spansion.
  • For Zynq devices – QSPI, NAND, and NOR. QSPI can used in different configurations such as QSPI SINGLE, QSPI DUAL PARALLEL, and QSPI DUAL STACKED.
  • For Versal devices – QSPI, emmc, and OSPI. QSPI can used in different configurations such as QSPI SINGLE, QSPI DUAL PARALLEL, and QSPI DUAL STACKED.

The options available on the Program Flash Memory page are as follows:

Project
Select the system project you plan to use.
Connection
Select the connection to hardware server.
Device
Select a device. Auto Detect selects the first device on the chain, by default.
Image File
Select the file to write to the flash memory.
  • Zynq devices:
    • Supported file formats for qspi flash types are BIN or MCS formats.
    • Supported file formats for nor and nand types are only BIN format.
  • Non Zynq devices:
    • Supported types for flash parts in non Zynq devices are BIT, ELF, SREC, MCS, BIN.
Offset
Specify the offset relative to the Flash Base Address, where the file should be programmed.
Note: Offset is not required for MCS files.
Init File
Provide the initialization file path.
Flash Type
Select a flash type.
  • Zynq devices:
    • qspi_single
    • qspi_dual_parallel
    • qspi_dual_stacked
    • nand_8
    • nand_16
    • nor
    • emmc
      Note: emmc flash type is applicable for Zynq UltraScale+ MPSoC and Versal devices only.
  • Non Zynq devices:
    • The flash type drop down list is populated based on the FPGA detected in the connection. If the connection to hardware server does not exist, an error message stating "Could not retrieve Flash Part information. Please check hardware server connection" is displayed on the page. Based on the device detected, the dialog populates all the flash parts supported for the device.
Note: Appropriate part can be selected based on design. For Xilinx boards, the part name can found from the respective boards’ user guide.
Convert ELF to Bootable SREC format and program
The ELF file provided as the image file is converted into SREC format and programmed. This is a typical use case in non zynq devices. The SREC bootloader can be built and used to read the SREC converted ELF from flash, load it into RAM and boot.
Blank check after erase
The blank check is performed to verify if the erase operation was properly done. The contents are read back and check if the region erased is blank.
Verify after Flash
The verify operation is cross check the flash programming operation. The flash contents are read back and cross checked against the programmed data.

Creating a Bootable Image and Program the Flash

An example XSCT session that demonstrates creating two applications (FSBL and Hello World) is shown in the following snippet. It also allows you to create a bootable image using the applications along with bitstream and program the image on to the flash.

Note: Assuming the board to be ZCU702, -flash_type qspi_single is used as an option in program_flash.
setws /tmp/wrk/workspace
app create -name a9_hello -hw /tmp/wrk/system.xsa -os standalone -proc
ps7_cortexa9_0 -template {Zynq FSBL}
app create -name a9_fsbl -hw /tmp/wrk/system.xsa -os standalone -proc
ps7_cortexa9_0 -template {Hello World}
app build -name a9_hello
app build -name a9_fsbl
exec bootgen -arch zynq -image output.bif -w -o /tmp/wrk/BOOT.bin
exec program_flash -f /tmp/wrk/BOOT.bin -flash_type qspi_single -
blank_check -verify -cable type xilinx_tcf url tcp:localhost:3121

Flash Programming

Program Flash is a Vitis™ software platform tool used to program the flash memories in the design. The types of flash supported by the Vitis software platform for programming are:
  • For non-Zynq® family devices: Parallel Flash (BPI) and Serial Flash (SPI) from Micron and Spansion.
  • For Zynq family devices: Quad SPI, NAND, and NOR. QSPI can be used in different configurations such as QSPI single, QSPI dual parallel, QSPI dual stacked.

To program the flash memories, follow these steps:

  1. Connect to the board using the target connections button

  2. Select the application in which you created the boot image.
  3. Select Xilinx > Program Flash.
  4. Fill the required information: flash image file, offset, and flash type.
  5. Select the appropriate target connection.
  6. Select the flash type.
  7. Click Flash to start the program flash operation. After the operation is complete and you can see the status of the flash programming, check it in the Vitis software platform log.