Creating a Bare-metal System - Creating a Bare-metal System - 2026.1 English - UG1702

Vitis Reference Guide (UG1702)

Document ID
UG1702
Release Date
2026-06-23
Version
2026.1 English
Building a bare-metal system requires a deviation from the standard System Project. The branch in the process takes place after linking the system ( Linking the System in the Data Center Acceleration using Vitis (UG1700)). The bare-metal system requires a new process branching after generating the .xsa file from the v++ --link command. See the following for the detailed steps.
  1. Create a bare-metal software platform from the .xsa linking process for the hardware build target.

    1. Select the File > New Component > Platform command in the Vitis unified IDE. This opens the Create Platform Component wizard as shown.

    2. Specify a Component name and click Next to proceed. Select Hardware Design on the Flow page and specify the binary_container_1.xsa from the System Project to create the new platform.

    3. After you select the XSA, the Vitis IDE reads the file, determines the Operating system and Processor for the domain defined by the XSA.

    4. Click Next to go to the Summary page and click Finish to create the platform project.
      Tip: The bare-metal platform is valid for either hardware emulation or hardware builds depending on the fixed XSA selected for the platform.
    5. Click the Build command to build the new platform. A copy of the platform writes to the export folder of the project. You can view it in the Explorer view for the project.

      The exported platform has the platform.xpfm meta-data file, the ./hw and ./sw folders for platform's elements.



    The Vitis tool automatically adds the new platform to your platform repository and makes it available to use in projects. You can add the file location to your $PLATFORM_REPO_PATHS environment variable so the platform is available to Vitis Unified IDE and command-line tools.

    Important: The bare-metal platform is only used for building the bare-metal PS application. It is not used in any other places in the flow.
  2. Create a new embedded software application component.
    1. Select the File > New Component > Application command in the Vitis IDE.
    2. Specify a Component name in the New Application Project wizard. Click Next.
    3. Select the baremetal-platform you created in the last step and click Next.
    4. Review the Domain page and click Next to proceed.
    5. Review the Summary page and click Finish to create the application component.
    6. Add the source files and build the application as described in Creating an Application Component.

      Write the PS application source code specifically for the bare‑metal project by using the provided drivers to access the hardware system.

      For AI Engine designs, also add the bare‑metal AI Engine control file (aie_control.cpp) generated by aiecompiler and located in ./Work/ps/c_rts.

    7. This step is only if you have AIE. Edit the UserConfig.cmake file of the application component located in the Settings folder in the Vitis Components Explorer. Edit the Include paths under Directories to include the following:

      $XILINX_VITIS/aietools/include
      <aie_component>/src
    8. After updating the UserConfig.cmake file, you can build the application component.

  3. Package the System Project with the new PS application added to the SD card files.
    1. With the ELF file produced for the bare-metal PS application, you are ready to package the System Project and application component for the bare-metal platform. You must run the package process to generate the final bootable image (PDI), and write the SD card content for booting the device and running the application, as described in Packaging with Vitis and EDF in the Embedded Design Development Using Vitis (UG1701).
    2. Add the following to the Packaging config as described in Defining the Package Configuration:
      [package]
      ps_elf=../../baremetal_app/Debug/<baremetal_app>.elf,a72-0
      sd_file=<baremetal_app>.elf
      
      Note: To enable debugging for both the AI Engine component and the bare-metal PS application, do not add the --package.ps_elf option. To debug only the AI Engine component, then add the option as described.
    3. After updating the package.cfg file, run the Build Package command on the System Project.

      Running Build Package adds the ELF file you created in Step 2 for the bare-metal application component. The process assigns the file to a processor core (--package.ps_elf), and packages the System Project files and boot system. In the original Linux-based System Project, you added a PS application into the System Project to build and debug it as part of the system. In this step, you are building the PS application as part of a separate bare-metal project. You are then adding the project as a boot file to the package process in the original System Project. The result is a System Project build for the platform hardware, and a PS application that runs in the baremetal domain.

Now that you have built the bare-metal system, you can continue to run or debug the application.
Important: You cannot debug the hardware emulation build for bare-metal projects in the Vitis unified IDE.