Styx Xilinx Zynq FPGA Module

Styx : Boot from SD card and QSPI flash

7357 views September 18, 2017 admin 7

Introduction

In this article we will use Xilinx SDK to create a bootable image for Styx Zynq Module for booting via following modes:

  • SD Boot Mode
  • QSPI Flash Boot Mode

Styx 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 Styx Zynq Module from non-volatile sources . We will use Vivado to create a basic “Hello World” program for Styx Zynq Module running on Zynq’s ARM processor and boot it from both SD Card as well as QSPI Flash.

Prerequisites

  • Hardware:
    1. Styx Zynq Module
    2. Xilinx Platform Cable II JTAG debugger.
  • Software:
    1. Xilinx Vivado Suite 2017.3 or higher
    2. FT_Prog tool for configuring on-board FT2232H USB Serial converter (download and install from FTDI website)

Lets get started

The following steps will walk you through the process of creating bootable image. To create Vivado project, follow the same steps from 1 to 14 mentioned in the Getting Started with Zynq Styx article here: https://numato.com/kb/getting-started-zynq-styx-using-vivado-design-suite/

After launching the SDK successfully, we now move on to creating the bootable image for SD card and QSPI Flash.

Booting from SD card

Step 1: After following till step-14 of the “Getting Started with Zynq Styx”, you should have Xilinx SDK open. In the Xilinx SDK window, Go to File -> New -> Application Project.

Step 2: We need to create an ‘fsbl (first stage boot loader)’ application. Type in a project name, leave other options as default, and click “Next”. In the next window, select ‘Zynq FSBL’ template and click “Finish”.

Step 3: After fsbl project is created, the next step is to create a ‘Hello World’ application in the same way as fsbl application project. Go to File -> New -> Application Project. In the “New Project” dialog window, type in a project name, choose “Use existing” bsp and select fsbl_bsp. Leave other options as default and click “Next”. In the next window, select ‘Hello World’ template and click “Finish”.

 

There is a minor modification we need to do to the code at this point. The application generated using SDK 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 4: Select the ‘helloWorld’ in the Project Explorer, go to Xilinx Tools -> Create Boot Image. 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)
  • styxHello.bit (Bitstream)
  • helloWorld.elf (Application program)

Step 5: To boot from SD card we need a .bin file, so, select the output format as ‘BIN’ if not already selected. Click on “Create Image” to create BOOT.bin file.

Step 6: 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 Styx boot mode to SD Card by following instructions in the Styx User Manual. Insert the SD card into Styx and connect the micro USB cable. Power up the board. .

Open any serial terminal (such as PuTTY) and connect to the COM Port corresponding to Styx at 115200 baudrate. If everything went well, Styx 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: Follow the same steps from 1 to 4 mentioned in the Boot from SD card. 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 Styx boot mode to QSPI Flash Boot Mode by following instructions in the Styx User Manual. Connect the micro USB cable and Xilinx Platform Cable USB II to Styx and then power up the board. Program the flash memory by selecting BOOT.mcs image file in the Xilinx Tools -> Program Flash.

Open any serial terminal (such as PuTTY) and connect to the COM Port corresponding to Styx at 115200 baudrate. If everything went well, Styx should boot up from QSPI flash and print “Hello World” continuously over USB-UART on the serial terminal application.

Was this helpful?

3 Comments
  • Christopher Smith says:

    Unfortunately the Styx board I just received does not boot from the SD card. I have set the jumper correctly and followed the provided tutorials explicitly but the device will not boot from the SD card, however, the same bin file can be programmed to SPI flash by the config tool and it boots fine. An interesting note is that I can use the same exact card for other Zynq boards and they boot from the SD card without an issue. I Further explored the issue by utilizing the Xilinx xilffs example project and the error returned is always FR_NOT_READY. I find online that this could mean many different problems including the SD card is not available. Even more interesting still is that the board originally came with a linux install on the SPI flash and it also would error out complaining about accessing the SD card time out error. I could really use some help with this issue if someone is available.

    September 23, 2018 at 4:40 pm
  • Christopher Smith says:

    Numato kindly replaced my board and now it does boot from both the SD card and the Flash ROM but not from the Xilinx Platform USB Cable II.

    October 12, 2018 at 12:50 am
  • Christopher Smith says:

    Update: My Styx board is working. Numato has excellent customer service.

    October 12, 2018 at 9:51 am
Leave a Reply to Christopher Smith Cancel reply
*
*