cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MicroZed Chronicles: MicroZed & Back Where we Started Part Two

xtech-blogs
Xilinx Employee
Xilinx Employee
0 0 666

Editor’s Note: This content is republished from the MicroZed Chronicles, with permission from the author and Hackster.io.

 

In the last blog we where looking at how we could start create a MicroZed project in Vivado 2020.1 just like we did when we started the blog nearly 7 years ago. In the previous blog we had just created the hardware build in Vivado, in this blog 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 which enables Vitis to create software applications. Within an XSA file you will find information on the address map, the IP included and of course the bit file. Although the bit file is not necessary to get started with the software development.

Within Vivado we create a XSA by selecting on File->Export Hardware

355_Fig1.png

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

355_Fig2.png

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

355_Fig3.png

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.  

355_Fig4.png

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

355_Fig5.png

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

355_Fig6.png

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 organised I always keep the workspace within the project directory

355_Fig7.png

From the Vitis welcome screen we want to select create platform project, in Vitis a Platform defines domains which contain hardware definition, board support package and Boot loaders. Platforms can be used by several applications.

355_Fig8.png

In the journey of platform creation we need to first name the project, I have been following a convention of naming it the project I am working on followed by _platform.  

355_Fig9.png

One 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

355_Fig10.png

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

355_Fig11.png

This will create a new platform in Vitis, which will contain the board support package containing drivers for the IP in the design, along with the First Stage Boot Loader required to create a bootable image.

355_Fig12.png

To be able to use the Platform we need to compile it, this builds all of the BSP and FSBL elements to do this click on the build Icon (hammer on the tool bar).  

355_Fig13.png

Once the platform has been created we can create a simple hello world application, this can be created from the menu and selecting File->New -> Application Project 

355_Fig14.png

This will open the application creation wizard, which creates both an application and a system application.  

355_Fig15.png

Once we have defined the name of the project the next step is to select the platform on which the applications runs.  

355_Fig16.png

On the next tab, create a new system project – System projects allow us to easily work with several different applications on the multiple processor available in the Zynq and Zynq MPSoC. 

355_Fig17.png

Select the standalone domain for the application, this should be the only domain created with when the platform was created. 

355_Fig18.png

The final option is to select the Hello World template project.  

355_Fig19.png

This will create a new system application project which contains a the hello world application, I opened the source file and made a few changes to the messages output.  

355_Fig20.png

Finally as the MicroZed does not have on board JTAG we need to create a boot file for the SD card. Right click on the system application and select create boot image, this will pull together all of the files required for the boot file to be created.  

355_Fig21.png

Double check the boot creation dialog which appears, notice there should be a boot loader followed by the programmable logic image and then finally the application software.

355_Fig22.png

You will find the boot.bin file created under the directory indicated in the output path, for me this was the path

mz_chron_354\workspace\mz_354_app_system\_ide\bootimage

Inserting the SD card into the MicroZed and booting it up when connected to a terminal program should show the messages entered in your application.

Mine showed the below  

355_Fig23.png

 

Now we know how to create a simple application in both Vivado and Vitis 2020.1 targeting the MicroZed, this can be of course used for other Zynq based boards.

As you can see there have been several changes to the flow from when we started in Vivado 2013 all those years ago!

 

See My FPGA / SoC Projects: Adam Taylor on Hackster.io

Get the Code: ATaylorCEngFIET (Adam Taylor)