Bare-metal Application with Vitis
Create a software platform, understand the BSP and control an AXI GPIO with low-level and high-level drivers.
From XSA to C code
The engineer uses Vitis to configure and build software for a Zynq processor. The first step is to import the hardware platform from the XSA file produced by Vivado.
Bare-metal means that the program runs directly on the processor without a complete operating system such as Linux. In Vitis, the standalone domain provides a small runtime, a BSP and drivers, but it does not provide Linux processes, services or a scheduler.
To apply these concepts, this course provides an application called the UART LED console. It receives commands from a serial terminal through the UART protocol and controls an AXI GPIO connected to the LEDs. This program is the running example in the following sections.
A Vitis application uses three main elements.
| Element | Content |
|---|---|
| Platform | Hardware description imported from the XSA |
| Domain | Target processor, operating system and BSP |
| Application | C or C++ sources, linker script and build options |
The workflow consists of creating a platform, selecting a standalone domain, adding the application and running it on the board. The user sends commands through UART while AXI GPIO drives the LEDs.
Cross compilation
The compiler runs on the development computer. The generated program runs on an ARM processor on the board. This operation is cross compilation.
The ELF executable contains machine code, data and debug information. From Vitis, the engineer can request that it be loaded through JTAG, a hardware debug link, into initialized memory. Autonomous boot later requires a boot image stored on the board.
The BSP
The Board Support Package connects software to the hardware described by Vivado. It contains headers, libraries and drivers for the platform.
xparameters.h provides device identifiers and peripheral addresses. Names come from the Block Design. They change when an instance is renamed or the platform changes.