Bootloader: Booting device from SD

Yuhei Horibe
3 min readApr 29, 2019

--

In this section, the focus is on booting device without using JTAG. Using bootloader enables device to boot itself.

Bootloader

Bootloader is a program which basically loads executables (user application, next stage bootloader, or operating system) and various data (device tree, ramdisk and so on) into main memory, and gives control to the program in main memory. Also, First-Stage bootloader usually initializes DRAM controller to utilize DRAM as a main memory. If the target device is programmable SoC, bootloader also programs FPGA at the beginning. Therefore, bootloader has to have device drivers, especially for various storage devices attached to the target board.

Bootloader itself resides in SD card, on-board ROM, SPI flash, etc. Zedboard has jumper pins to select the boot device.

Creating FSBL (First-Stage BootLoader) using SDK

Xilinx SDK can generate FSBL for Zynq devices. Open SDK and “Files” → “New” → “Application Project”.

This project is named like “FSBL”, but it could be anything. Select appropriate Hardware Platform and “Next”.

Choose “Zynq FSBL”, and “Finish”. Then FSBL for Zynq will be generated automatically.

Creating boot image using SDK GUI

In previous step, executable (FSBL.elf) is generated, but boot image must be created with this executable to boot the device.

To create boot device, select “Xilinx” → “Create Boot Image”.

Create Boot Image dialogue

Important thing is, 3 things must be added into “Boot image partitions” section in specific order.

  1. Bootloader executable
  2. Hardware bitstream
  3. Other Executable

Add files in this order, and specify the “Output BIF file path”.

Click “Create Image” button, then boot image will be generated. The output “output.bif” and “BOOT.bin” are generated in the same directory. Copy BOOT.bin to SD card. Important: this partition in SD card has to be formatted as “VFAT” or “FAT32”.

Note: *.bif file is just a text file and can be edited by any text editor.

Preparing the target board

Boot device is determined by jumper settings on Zedboard. “jp6” must be shorted, and “jp9” and “jp10” should be pulled up to 3.3V. It depends on the target board. Make sure your boot configuration is correct (Refer to the hardware manual of your board).

Insert SD card and power it on. If the FPGA is programmed correctly, then blue LED labeled “DONE” will be on, and if the user application is working properly, then LEDs should be “0000 1010” pattern.

--

--

No responses yet