Project

General

Profile

Building 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-mitysbc-agilex5.tar.gz)
  • Bootloader from FPGA build (u-boot.itb)
  • Bootloader script from FPGA build (boot.scr)
  • Kernel Image from Yocto deploy directory or built manually (Image)
  • Kernel device tree from Yocto deploy directory or built manuall (socfpga_agilex5_mitysbc.dtb)

Make SD script

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

Run this script to generate an SD card image

./make_sd.sh \
    -a \
    -o sd_card.img \
    -d Agilex5 \
    -f path/to/u-boot.itb \
    -f path/to/boot.scr \
    -f path/to/Image \
    -f path/to/socfpga_agilex5_mitysbc.dtb \
    path/to/mitysom-image-base-mitysbc-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 and the FAT partition contains the rest of the binaries.

To update any of the binaries, first mount the FAT partition:

sudo mount /dev/sdX1 /mnt

The /mnt directory now contains the FAT partition and any of the binaries (u-boot.itb, boot.scr, Image, socfpga_agilex5_mitysbc.dtb) can now be replaced

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

sudo umount /dev/sdX1

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