-
James Talbert authored
This is the working version of the master branch from before the merge with the working groundstation.
James Talbert authoredThis is the working version of the master branch from before the merge with the working groundstation.
How to use XSDK
Introduction
In this guide we will cover the following topics regarding XSDK:
- What Is XSDK
- How to open XSDK
- How to create a BSP
- How to create a new application project
- How to configure JTAG
- How to launch an Application Project
- How to boot using an SD card
What is XSDK?
XSDK stands for Xilinx Software Development Kit and it does exactly that. It builds the project C files and necessary packages into files that allow the developer to program the Zybo board to whatever he/she desires granted it meets the system constraints.
There are three main things required for a project:
- A system hardware platform (automatically exporting design from XPS)
- A Board Support Package (Contains software functions for interacting with the Processing System controllers i.e. UART and I2C or logic cores on the FPGA)
- An Application Project (A simple hello world, an NES emulator, or something else)
As mentioned above the system_hw_platform is imported for us by XPS when we export our bitstream file to the XSDK. We’ll walkthrough the other two items as well as programming the FPGA from within the XSDK.
Opening XSDK
Setting up access to the Xilinx tools is fairly straight forward given the machine the user is on. This guide will cover three types of machines: Coover 3050-11 and -12 computers (highly recommended), ISU’s Remote Linux Servers, and a user’s own PC
- Coover 3050-11 and -12
Two machines in the Distributed Sensing and Decision Making Lab (Coover 3050)
come with the
tools already installed. However, the following steps need to be taken in
order to launch the
program
- In a terminal, enter
source /opt/Xilinx/2018.2/Vivado/2018.2/settings64.sh
- In terminal type
xsdk &
- In a terminal, enter
- ISU Remote Linux Servers (linux-X, research-x.ece.iastate.edu)
source Xilinx_Tools/setup_scripts/remote_servers/setup.sh
- In terminal type
xsdk &
(Note: these servers are not good for programming the Zybo board when it comes time to launch a program on the board)
- User PC
Some users may opt to download the Xilinx tools on their own PCs for
development, but this is not recommended.
- Download the Vivado Design Suite here (~6GB)
- Run XSDK
Creating a new Board Support Package (bsp)
The BSP package is responsible for grabbing all necessary Xilinx library files so they can be called by your program. In other words, it holds the drivers necessary to interface with the hardware on the board.
- Click File and select New->Board Support Package
- In the New Board Support Package Project, enter a project name (system_bsp in the example).
- Ensure system_hw_platform and ps7_cortexa9_0 are selected in Target Hardware
- Ensure “standalone” is selected.
- Click Finish to create the BSP
IMPORTANT: If UART0 is enabled, follow the steps below, otherwise ensure these are set properly anyway.
- Click on “standalone” and change the value of stdin AND stdout to ps7_uart_1
- Click OK when done, you should now see the BSP in the project explorer
Creating a new Application Project
Lastly, we have the software program that will run on the board. This is the last piece to the Zybo puzzle, and we’re almost there. Projects can be written in C or C++, and can use some standard libraries like stdio, stdlib, string, and otherse. HOWEVER, some libraries (often from Linux) are not implemented (like time.h), and alternate methods must be used for some things an OS would normally handle. Hopefully you do not run into these instances. (Off topic hint: If you need timing things, check out xtime_l.h)
- Click File -> New -> Application Project to open the New Project box
- Enter a project name, and select the “Use existing” radio button for the BSP. We want to use our newly created one rather than create one.
- Click next and select a template (Hello World is probably best) and hit Finish
- The new project should appear on the Project Explorer. Expand the project, src, and open the helloworld.c