Configure FPGA/SPI Flash to Run Linux on LX9 MicroBoard, Part 2 – Quick Way

This is Part 2 for the topic, I will present Part 1 (Preparation) after Part 3 (Easy Way) is done.

Petalinux is using a 2-stage booting process. The First Stage boot, FS-Boot, is running from FPGA’s BRAM once powered on. It’s sole responsibility is to load the main system bootloader, i.e., U-Boot, from the flash to the larger external memory, and run U-Boot from the external memory.

One of the quick ways to configure FPGA is to copy binary images to the flash, instead of programming it, which could take significant time depends on programmer used.

In order to do that, networking connectivity and a mechanism to deliver and retrieve images are required.
As used by almost everyone, I’m using tftp. The host runs tftpd is connected to the LX9 MicroBoard via a router.

The following images are needed.

Image Description Usage
download.bit bitstream plus fs-boot binary FPGA and fs-boot image on flash
u-boot.elf U-Boot in ELF format to transfer u-boot-s.bin and image.ub to flash
u-boot-s.bin relocatable U-Boot in binary format U-Boot on flash
image.ub Linux kernel and root filesystem in binary format Linux on flash
impact.cmd script for impact (not required) transfer download.bit
xmd.ini script for xmd (not required) run u-boot.elf

I am using Platform Cable USB II programmer, usb/uart port is directly connected to the host via minicom.

This is the board connection

Board Connection

Start tftp daemon, and point the working folder to where the above files are.

Start tftp Daemon

Start tftp

Next step is to program FPGA through impact. If you’re using Digilent’s HS1 or onboard JTAG connection, your script should be different.

Program FPGA through impact

Program FPGA

Then download and run U-Boot through xmd. If you’re using Digilent’s HS1 or onboard JTAG connection, your script should be different.

Download and Run U-Boot through xmd

Download and Run U-Boot

If the flash is programmed already, stop the autoboot process from the uart port console, in order to move new U-Boot and Linux to the flash.

Stop Autoboot from uart console

Stop Autoboot

Now it is time to copy Linux kernel and U-Boot to flash. But before doing that, IP addresses for the tftp server (host) and the board (target) need be set. Your IP addresses could be different the ones used below.
Here’s how to do it and copy the Linux kernel (image.ub) to the flash.

IP Addresses setup and copy Linux kernel

IP Setup and Copy Kernel

Then copy the U-Boot.

Copy U-Boot to Flash

Copy U-Boot

Now if everything goes well, you can run Linux by either hitting the reset button or issuing boot command from U-Boot prompt.

Booting Petalinux

Booting

Here’s the booted console, and SPI flash’s partitions.

Booted Console and SPI Flash Partitions

Booted Console and SPI Flash Partitions

You can find listed binary images and scripts here.

Advertisements

One Response to “Configure FPGA/SPI Flash to Run Linux on LX9 MicroBoard, Part 2 – Quick Way”

  1. push Says:

    I really like what you guys are up too. This sort of clever
    work and reporting! Keep up the excellent works guys I’ve incorporated you guys to my blogroll.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: