Project

General

Profile

Building SD Card

1. Prerequisites 2. Building the FPGA and Bootloader 3. Building the Filesystem 4. Building the SD Card

Prerequisites

  • Linux PC (Ubuntu 22.04)
  • libguestfs-tools
sudo apt-get install libguestfs-tools
  • vmlinux set a readable (note: this needs to be done every time the kernel is upgraded)
sudo chmod a+r /boot/vmlinuz*
  • Filesystem Tarball from Yocto (mitysom-image-base-mitysom-agilex5.tar.gz)
  • FPGA Design (a5e.core.rbf)
  • Bootloader from FPGA build (u-boot.itb)
  • Bootloader script from FPGA build (boot.scr)

Make SD script

The make_sd.sh script can be found in the FPGA project scripts/make_sd.sh

Run this script to generate an SD card image

# Make a rootfs overlay to install the RBF file
mkdir -p rootfs_overlay/lib/firmware
cp output_files/a5e.core.rbf rootfs_overlay/lib/firmware

./make_sd.sh \
    -a \
    -o sd_card.img \
    -d Agilex5 \
    -f path/to/u-boot.itb \
    -f path/to/boot.scr \
    -r rootfs_overlay \
    path/to/mitysom-image-base-mitysom-agilex5.tar.gz

The following will generate an sd_card.img that can be flashed onto an SD card

Manually updating any binaries on an existing SD card

The SD card has two partitions, a FAT partition and an EXT partition.

The EXT partition contains the Linux filesystem which also contains:

  • The FPGA design RBF in /lib/firmware.
  • The Linux Kernel in /boot
  • The Linux device tree in /boot

The FAT partition contains the rest of the binaries:

  • The bootloader - u-boot.itb
  • The bootloader script - boot.scr

To update any of the binaries, first mount the partition (The FAT partition is the first partition /dev/sdX1 and the EXT partition is the second partition /dev/sdX2):

sudo mount /dev/sdX1 /mnt

The /mnt directory now contains the partition and any of the binaries can now be replaced

When complete, the partition can be unmounted with the following:

sudo umount /dev/sdX1

1. Prerequisites 2. Building the FPGA and Bootloader 3. Building the Filesystem 4. Building the SD Card

Go to top
Add picture from clipboard (Maximum size: 1 GB)