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.
|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.
Start tftp daemon, and point the working folder to where the above files are.
Next step is to program FPGA through impact. If you’re using Digilent’s HS1 or onboard JTAG connection, your script should be different.
Then download and run U-Boot through xmd. If you’re using Digilent’s HS1 or onboard JTAG connection, your script should be different.
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.
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.
Then copy the 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.
Here’s the booted console, and SPI flash’s partitions.
You can find listed binary images and scripts here.