First Xilinx Zynq Project

Getting started with Zynq 7000 SoC programming using the Blackboard

1013

Step 1: Tools installation

Follow the instructions on the page: TUTORIAL: VIVADO TOOLS INSTALLATION to download and install the latest Vivado version together with the Xilinx SDK.

Step 2: Create a Vivado Project

Create an empty project in using the latest version of Vivado as shown in: TUTORIAL: CREATE A VIVADO PROJECT. Make sure that you select the correct FPGA part for the Blackboard’s Zynq chip.

Step 3: Prepare the Hardware Design

You are now ready to create a block design for your system. This involves creating, adding, and editing a Zynq Processing System as well a custom AXI4 IPcore. Follow the directions at TUTORIAL: Prepare the Hardware Design to make and configure your hardware design. Make sure that you follow all steps as shown within the tutorial.

Step 4: Synthesize, Implementation, and Generate Bitstream

Follow the instructions in: TUTORIAL: Synthesize, Implementation, and Generate Bitstream for a tutorial on synthesizing, implementating, and generating bitstream of your Vivado Project.

Step 5: Design Software using Xilinx SDK

Export Hardware

To design ARM software that can communicate with your custom IPcore, you need to export the hardware design for use in SDK. This configures SDK with knowledge of the ARM’s address space your custom peripheral is mapped to.

To do this, open File Menu, select Export Hardware item under Export.

Figure 1. Export Hardware
Figure 1. Export Hardware

Select Include bitstream, and then click OK. This will save the configuration for SDK.

Figure 2. Include Bitstream When Exporting Hardware
Figure 2. Include Bitstream When Exporting Hardware

Launch SDK

Launch Xilinx Software Design Kit (SDK) by selecting Launch SDK in the File menu. Click OK in the pop-up window.

Figure 3. Launch SDK from Vivado
Figure 3. Launch SDK from Vivado

SDK Internal Error

If SDK failed to launch with an internal error complaining about some .../.metadata directory is read-only, you probably have a white space in the path leading to your project folder. Move the project folder to somewhere whose path string has no white space, the problem will go away. Please see this Xilinx Forum Thread for more details.

Create Application Project

After SDK launches, it will automatically import the Hardware Design you exported in previous steps. Use the New button and select Application Project to create a C-based software project.

Figure 4. Create Application Project
Figure 4. Create Application Project

The New Project dialog will pop up. Pick a name for your project as shown in Figure 5, and then click Next.

Figure 5. Create Project
Figure 5. Create Project

Select Empty Application and click Finish to create an empty project.

Figure 6. Create an Empty Project
Figure 6. Create an Empty Project

Create C Source File

Your newly created project is automatically added to the Project Explorer panel on the top left of SDK. Expand the project and right clik on the src folder. Navigate to the New menu, then select Source File.

Figure 7. New Source File for Your Project
Figure 7. New Source File for Your Project

The New Source File dialog will pop up. Put main.c as the source file name, then click Finish.

Figure 8. Add main.c to Application Source Folder
Figure 8. Add main.c to Application Source Folder

Edit main.c

Open up main.c file and copy the following code into the file.

#include "xil_types.h"

// Macro to access the base address of your LED controller
#define LED *((uint32_t *)0x4BB00000)

int main() 
{
    int i = 0;

    // Turn off all LEDs
    LED = 0x00;

    // Infinite loop
    while (1) {

        // invert the LED value
	LED= ~LED;

        // Delay
        for (i = 0; i < 10000000; i++);
    }
    return 1;
}

Step 6: Program FPGA and Launch on Hardware

Go to TUTORIAL: Programming FPGA and Lanching Software on Hardware and follow a short step by step tutorial on how you can test your first embedded software project.