Introduction
In this article we will use Xilinx Vitis Classic to create a bootable image for TityraCore D200 for booting via following modes:
- SD Boot Mode
- QSPI Flash Boot Mode
TityraCore D200 Zynq Module can boot from JTAG as well. This is explained in detail in the article “Getting Started With Zynq on Styx using Vivado Design Suite“. SD Boot and QSPI Boot methods are available for booting TityraCore D200 from non-volatile sources . We will use Vivado to create a basic “Hello World” program for TityraCore D200 running on Zynq’s ARM processor and boot it from both SD Card as well as QSPI Flash.
Prerequisites
To follow this article, you would need the following:
- Hardware:
- TityraCore D200 SODIMM Module.
- TityraCore D200 carrier.
- Xilinx Platform Cable II JTAG debugger.
- SD card.
- Software:
- Xilinx Vivado Design Suite 2024.1
- Vitis Classic 2024.1
- FT_Prog tool for configuring on-board FT2232H USB Serial converter (download and install from FTDI website)
Let’s get started
The following steps will walk you through the process of creating a new project with Vivado and building a hardware platform with Zynq processing system using IP integrator. This article is written for Numato Lab’s TityraCore D200 SODIMM Module, but can be adapted to any other Zynq based platform with minor changes. Screenshots are added wherever possible to make the process easier to the reader.
Step 1:
Download and install Vivado Board Support Package files for Tityra from here. Follow the readme in the link on how to install Vivado Board Support Package files for Numato Lab’s boards.
Step 2:
Start Vivado Design Suite, and select “Create New Project” from Quick Start section. The project wizard will pop up. Press next to proceed with creating the project.
Step 3:
Type in a project name and save it at a convenient location. For this example “Tityra_hello” is used as project name, but feel free to use any name. Select the check box below to keep all project files in a single folder. The image below shows the settings for the example project. Click “Next” to continue.
Step 4:
Choose “RTL Project” as project type and check the option “Do not specify sources at this time”.
Step 5:
At the “Default Part” step, select “Boards” and choose Vendor as “numato.com”. Select “Tityra” and click “Next”. If Tityrais not displayed in the boards list, you will need to install Tityra board support files correctly.
Continue the wizard and finish creating the project. When the new project wizard exits, a new project will be opened up in Vivado with the settings you have selected.
Step 6:
Under Flow Navigator, select “Create Block Design” in IP Integrator. Give an appropriate name to design. We will call it “tityra” for example.
Step 7:
Go to Diagram window, right click and select “Add IP” from the popup menu. Search for ZYNQ7 Processing System. Add it to block design by double clicking.
Step 8:
Click on “Run Block Automation” option on the green bar.
Step 9:
In the “Run Block Automation” window, select the options as in image below and click OK.
Step 10:
Go to “Sources” tab, right click on “tityra” design file and select “Create HDL Wrapper”. Click OK on the window that appears to finish generating wrapper.
Step 11:
Click “Generate Bitstream” under PROGRAM AND DEBUG section and click “Yes” in any subsequent dialog window which comes up.
Step 12:
Once the bitstream is successfully generated, close any “Bitstream Generation Completed” dialog which comes up asking for what to do next.
Go to File -> Export -> Export Hardware…
Check “Include bitstream”, keep “Export to:” default, and click OK.
Step 13:
Launch Vitis classic.
Note: In Vivado 2024.1, accessing Vitis via the tools menu inadvertently launches Vitis Unified instead of Vitis Classic, which is our preferred tool for project creation. To utilize Vitis Classic, it is necessary to launch it separately.
After opening Vitis Classic, choose a folder for keeping all the Vitis project files in the single folder.
After Vitis windows opens, click on “Create Application Project” and click “next” on the subsequent window.
Step 14:
To create a new platform for the project, select “create a new platform from hardware (XSA)” and select the XSA file saved using the step 12. Type in a project name, leave other options as default and click “Next”. In the next window, select Hello World template and click “Finish”.
Step 15:
After Creating an Hello world Application project, There is a minor modification we need to do to the code at this point. The application generated using vitis will print “Hello World” a single time and exit. We want to change the application code so that the code will keep printing the data indefinitely. Find the printf statement in the code (helloworld.c) and replace that with the following code.
while(1) { print("Hello World\n\r"); }
All that we are doing here is to surround the printf statement in a while loop so the printing never stops. Save the project and build.
Step 16:
Once the project is created build the project manually.
Booting from SD card
Step 1:
Select the ‘Hello_World’ in the Project Explorer, go to vitis -> Create Boot Image -> Zynq and Zynq Ultrascale. The tool automatically picks the files needed to create bootable image. If the files are not added automatically then add the following files manually.
- fsbl.elf (Bootloader)
- Hello_World.bit (Bitstream)
- Hello_World.elf (Application program)
Click on “Create Image” to create BOOT.bin file.
Step 2:
After generating BOOT.bin file successfully, copy the BOOT.bin into SD card. Make sure to configure channel B of the onboard FT2232H USB – Serial device as virtual communication port using FT_Prog. The process is very similar to that of Saturn and details are available here. Change the Tityra boot mode to SD Card by following instructions in the TityraCore D200 User Manual. Insert the SD card into Tityra and connect the Type C USB cable. Power up the board.
Open any serial terminal (such as PuTTY) and connect to the COM Port corresponding to Tityra at 115200
baudrate. If everything went well, Tityra should boot up from SD card and print “Hello World” repeatedly over USB-UART on the serial terminal application.
Booting from QSPI Flash
Step 1:
To boot from QSPI Flash we need .mcs file so, select output format as MCS if not already selected. Click on “Create Image” to create BOOT.mcs file.
Step 2:
After BOOT.mcs file is generated, make sure to configure channel B of the onboard FT2232H USB – Serial device as virtual communication port using FT_Prog. The process is very similar to that of Saturn and details are available here. Then, change the Tityra boot mode to QSPI Flash Boot Mode by following instructions in the TityraCore D200 User Manual. Connect the Type C USB cable and Xilinx Platform Cable USB II to TityraCore D200 and then power up the board. Program the flash memory by selecting BOOT.mcs image file in the vitis -> Program Flash.
Open any serial terminal (such as PuTTY) and connect to the COM Port corresponding to Tityra at 115200
baudrate. If everything went well, Tityra should boot up from QSPI flash and print “Hello World” continuously over USB-UART on the serial terminal application.