MicroZed Chronicles: MicroZed and Back Where We Started (Part Two, Creating Hello World)

Updated: Aug 5, 2020

In the last blog, we looked at how we could start to create a MicroZed project in Vivado 2020.1 just like we did when we started the blog nearly seven years ago. In that blog, we had just created the hardware build in Vivado. In this blog however, we are going to create a simple Hello World program using Vitis.

The first thing we need to do in Vivado is to export the XSA. This is a compressed file which contains several elements, enabling Vitis to create software applications. Within an XSA file you will find information on the address map along with the IP included and of course the bit file. The bit file however is not necessary to get started with the software development.

Within Vivado we create an XSA by selecting File --> Export --> Export Hardware.

Starting with Vivado 2020.1, there is increased support when exporting the design to support either an embedded or acceleration flow application. As such, this is the first choice we will see when the dialog box appears when we want to export the hardware. We are going to create a fixed platform for this application.

Since we have implemented the design and have a bitstream available, we are now going to export a platform which includes the bitstream.

Finally, our last option is to select the location of the XSA and the name of it. For this example, I left the location and name as recommended by Vivado. This should place the XSA inside the Vivado project directory.

Once the XSA is exported, you can use an archive program such as 7Zip to open the archive and examine its contents.

Now we are ready to get started with Vitis. We can start Vitis from the Tools menu in Vivado.

The first thing it will ask is where do we want to define the workspace. This is the working directory where all the Vitis projects and setting information will be stored.

To keep my projects organized, I always keep the workspace within the project directory.

Select Create Platform Project from the Vitis welcome screen. In Vitis, a platform defines domains which contain hardware definition, board support package, and boot loaders. Platforms can be used by several applications.

In the journey to platform creation, we need to first name the project. I follow a naming convention which labels it as the project I am working on (e.g., mz_354) followed by _platform.

On the next page, we will be asked if we want to create the platform from an XSA or existing platform. We want to use the XSA created previously in Vivado.

In the opened dialog box, select the XSA from the location it was exported to in Vivado. Leave the check box ticked which will create the boot components.

This will create a new platform in Vitis which will include the board support package containing drivers for the IP in the design, along with the first stage boot loader which is required to create a bootable image.

To be able to use the platform, we need to first compile it. This builds all of the BSP and FSBL elements. To do this, click on the build icon which looks like a hammer on the tool bar.

Once the platform has been created, we can create a simple Hello World application. This can be created from the menu and by selecting File --> New --> Application Project.