CL-SOM-AM57x: U-Boot: Creating a bootable SD card

From Compulab Mediawiki
Jump to: navigation, search

Introduction

CL-SOM-AM57x system-on-module uses on-board SPI flash as its main boot storage. CL-SOM-AM57x can also boot from an SD card. This article describes the creating of bootable SD card.

SD card requirements

Prior to installing the CL-SOM-AM57x firmware on an SD card, make sure that the SD card partitions do not start in the first 1MB of the SD card. Otherwise, the partitions may be overwritten by this procedure.

Installing firmware on an SD card

The firmware can be installed on an SD card using a Linux workstation with an SD card reader.

Admolition note.png The same U-Boot firmware image is used for the SPI and the SD card.
  • Insert the SD card into the workstation card reader
  • The SD card will be identified as /dev/sdX, where X is the SD card drive letter.

Raw mode - Recommended

Use the firmware image cl-som-am57x-firmware from U-Boot package for CL-SOM-AM57x

  • Run the following command:
dd if=cl-som-am57x-firmware of=/dev/sdX bs=1K seek=128 oflag=dsync

File system mode

Use the binary images spl-v2017.01-cl-som-am57x-1.3.bin and u-boot-v2017.01-cl-som-am57x-1.3.bin from U-Boot package for CL-SOM-AM57x

  • Use fdisk to create or modify the first partition. Partition configuration:
    • Type: FAT16/32.
    • Bootable.

Example of creating DOS partition table and bootable 1G FAT32 partition with fdisk:

echo -e "o\nn\np\n1\n\n+1G\nt\nc\na\nw\neof\n" | fdisk -u /dev/sdX
  • Format the first partition:
mkfs.fat /dev/sdX1 -n boot
  • Mount the first partition.

The path /mount/path should be replaced with the actual mount point.

mount /dev/sdX1 /mount/path/
  • Copy and rename the SPL and U-Boot images image to the mount path:
cp spl-v2017.01-cl-som-am57x-1.3.bin /mount/path/MLO
cp u-boot-v2017.01-cl-som-am57x-1.3.bin /mount/path/u-boot.img
  • Un-mount the first partition:
umount /dev/sdX1

Booting from an SD card

  • Plug the SD card into the P9 SD card socket of the SB-SOM
  • Hold the ALT BOOT (SW3) button while resetting/powering on the CL-SOM-AM57x evaluation system.
  • The CL-SOM-AM57x will boot from the SD card

See also