- Build the bare-metal platform.
Building bare-metal applications requires a bare-metal domain in the platform. The base platform
xilinx_vck190_base_202320_1does not have a bare-metal domain, which means you must create a custom platform from the base platform. You must create a custom platform because the PS application needs bare-metal drivers for the PL kernels in the design.Starting with the xsa file generated by the
v++linking process as described in Linking the System use the following shell script:generate-platform.sh -name vck190_baremetal -hw <filename>.xsa \ -domain psv_cortexa72_0:standalonewhere:
-
-name vck190_baremetal: Specifies a name for the new platform. In this example the platform will be written to: ./vck190_baremetal/export/vck190_baremetal -
-hw <filename>.xsa: Specifies the name of the input xsa file generated during thev++ --linkcommand.Note: The .xsa file must be for the hardware target as generated by thev++ --linkcommand. -
-domain psv_cortexa72_0:standalone: Specifies the processor domain and operating system to create in the new platform.
You can add the new platform to your platform repository by adding the file location to your
$PLATFORM_REPO_PATHSenvironment variable. This makes it accessible to the Vitis unified IDE for instance, or allows you to specify the platform in command-lines by simply referring to the name rather than the whole path.Important: The generated platform will be used only for building the bare-metal PS application and is not used any other places across the flow. -
- Compile and link the PS application as described in Compiling and Linking Host Code for Bare-Metal in AI Engine Tools and Flows User Guide (UG1076). You will specify the custom platform drivers to include in the build.
- Package the System
Finally, you must run the
v++ --packagecommand to generate the final boot-able image (PDI) for running the design on the bare-metal platform. This command produces the SD card content for booting the device and running the application, as described in Packaging the Systemv++ -p -t hw \ -f xilinx_vck190_base_202310_1 \ libadf.a project.xsa \ --package.out_dir ./sd_card \ --package.domain aiengine \ --package.defer_aie_run \ --package.boot_mode sd \ --package.ps_elf main.elf,a72-0 \ -o aie_graph.xclbinTip: For bare-metal ELF files running on PS cores, you should also add thepackage.ps_elfoption to the--packagecommand.The use of
--package.defer_aie_runis related to the way the AI Engine graph is run. If the application is loaded and launched at boot time, this option is not required. If your host application launches and controls the graph, then you need to use these options when compiling and packaging your system.The ./sd_card folder, specified by the
--out_diroption, contains the following files produced for the hardware build:|-- BOOT.BIN //BOOT.BIN file containing PDI and the application ELF |-- boot_image.bif //bootgen input file used to create BOOT.BIN `-- sd_card //SD card folder |-- aie_graph.xclbin //xclbin output file (not used) `-- BOOT.BIN //BOOT.BIN file containing PDI and the application ELFCopy the contents of the
sd_cardfolder to an SD card to create a boot device for your system.
Building a bare-metal system requires
a few additional steps from the Linux-based system flow previously described. The
specific steps required are described here.
Now you have built the bare-metal system, you
can run it or debug it.