In my last blog (Bringing up the Avnet MicroZed with Vivado) I focused upon creating the MicroZed system using the Vivado Design suite. I’d progressed as far as creating the bit file, which is needed for device configuration. The next step is to export the system hardware definition to the Software Design Kit (SDK) to allow the software engineering team to write the application code for the processing system side of the Zynq All Programmable SoC.
This is a very simple task, achieved by using the export function under the File->Export->Export Hardware for SDK Option as seen below:
The “Export Hardware” function creates a folder under the SDK_Export directory within your project that defines the hardware definition of the system. This should automatically be imported into SDK but if it is not, you can create a new hardware specification underneath the File->New->Other option, which allows you to point it to your exported hardware definition.
A project within the SDK designed to run upon the Zynq requires three different definitions:
Hardware Definition (uzed_hw), which defines the system hardware definition. This definition contains a file called system.xml that defines the makeup of your system: the address map, IP blocks present, and the device type. You will also see the configuration bit file that we will need later when we discuss configuration.
Board Support Package (uzed_bsp), which contains the drivers needed to support the IP block within the design. The BSP mainly consists of C include files. Here the file system.mss defines the BSP settings. This file will also contain links to the drivers for the IP blocks and provides examples of how to use them. Within the include file here you will find Xparameters.h, which defines your system in great detail.
The application itself (uzed_app). This is where you will actually put the software application.
The project definitions reference each other in progression with the Hardware Definition being the lowest level. The Hardware Definition is referenced by the BSP which in turn is referenced by the application.
Once we have imported the hardware project, we need to create a new BSP for our MicroZed. The simplest way to do this is by selecting File->New->Board Support Package, which allows you to select the name of the BSP, the processor upon which the application will run, and most importantly the hardware platform definition that you just imported.
Having created the Hardware Platform definition and the BSP, we’re ready to create the main application program using File->New->Application Project.
This screen lets you select the project name, the hardware platform and processor to be used, along with the board support package selection we created earlier. As this is a bare-metal implementation, we leave the OS Platform as standalone.
The next stage is to select the project type we want. Selecting the simple “Hello World” application will automatically create all that you need to get the Zynq up and running on the MicroZed board.
Under the application project (used_app) within the SRC directory, you will notice a number of files. The one named helloworld.c contains the program main function which initializes the platform and runs the application.
It is this file we will be modifying in the next blog so that we can finally run it on the MicroZed.