Note that the installation procedure requires a bootable SD card that will be used for the initial boot. Refer to Booting Linux from SD Card for information on how to create a bootable SD card. Note also that the procedure will erase all data previously present on the eMMC.
- Insert a USB Flash into the Linux development host. Download the tarball with the prebuilt bootable Linux images from the Emcraft site, and unpack it into the USB Flash:
$ mkdir -p /media/emcraft/5B4E/mfg_images
$ tar xvfj images-stm32mp1-<version>.tar.bz2 -C /media/emcraft/5B4E/mfg_images
emcraft-rootfs-openstlinux-weston-stm32mp1-som.tar.xz
st-image-bootfs-openstlinux-weston-stm32mp1-som.tar.xz
st-image-userfs-openstlinux-weston-stm32mp1-som.tar.xz
st-image-vendorfs-openstlinux-weston-stm32mp1-som.tar.xz
stm32mp1-som.dtb
tf-a-stm32mp1-som-trusted.stm32
u-boot-stm32mp1-som-trusted.stm32
uImage
$
- Insert the USB Flash into the SOM-BSB carrier board and boot the STM32MP1 SOM. Refer to Booting Linux from SD Card.
- If the USB Flash device is not mounted automatically, use the following command:
$ mount /dev/sda1 /media/sda1
- In the Linux command prompt, unmount the eMMC (if it is mounted) in order to make sure it is ready for the partitioning:
$ umount -f /dev/mmcblk1*
- Erase the previous partition table that might be present if the eMMC has been used earlier:
$ wipefs --all /dev/mmcblk1
- Create a new GPT partition table on the eMMC using gdisk as shown below:
root@stm32mp1-som:~# gdisk -l /dev/mmcblk1
GPT fdisk (gdisk) version 1.0.3
[ 121.572170] mmcblk1: p1 p2 p3 p4 p5
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/mmcblk1: 7471104 sectors, 3.6 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 0B727674-919F-4603-8853-36FA9D72465F
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 7471070
Partitions will be aligned on 1024-sector boundaries
Total free space is 990 sectors (495.0 KiB)
Number Start (sector) End (sector) Size Code Name
1 1024 5119 2.0 MiB 0700 ssbl
2 5120 136191 64.0 MiB 8300 bootfs
3 136192 168959 16.0 MiB 8300 vendorfs
4 168960 6460415 3.0 GiB 8300 rootfs
5 6460416 7471070 493.5 MiB 8300 userfs
root@stm32mp1-som:~#
- Install the U-Boot image file (u-boot-stm32mp1-som-trusted.stm32) to the eMMC:
$ dd if=/media/sda1/mfg_images/u-boot-stm32mp1-som-trusted.stm32 of=/dev/mmcblk1p1 bs=1M conv=fdatasync
- Install the ARM Trusted Firmware images to the eMMC:
$ echo 0 > /sys/class/block/mmcblk1boot0/force_ro
$ echo 0 > /sys/class/block/mmcblk1boot1/force_ro
$ dd if=/media/sda1/mfg_images/tf-a-stm32mp1-som-trusted.stm32 of=/dev/mmcblk1boot0 bs=1M conv=fdatasync
$ dd if=/media/sda1/mfg_images/tf-a-stm32mp1-som-trusted.stm32 of=/dev/mmcblk1boot1 bs=1M conv=fdatasync
- Create the filesystems on the eMMC:
$ mkfs.ext4 -F /dev/mmcblk1p2
$ mkfs.ext4 -F /dev/mmcblk1p3
$ mkfs.ext4 -F /dev/mmcblk1p4
$ mkfs.ext4 -F /dev/mmcblk1p5
- Mount the eMMC partitions:
$ mkdir -p /media/mmcblk1p2
$ mkdir -p /media/mmcblk1p3
$ mkdir -p /media/mmcblk1p4
$ mkdir -p /media/mmcblk1p5
$ mount /dev/mmcblk1p2 /media/mmcblk1p2
$ mount /dev/mmcblk1p3 /media/mmcblk1p3
$ mount /dev/mmcblk1p4 /media/mmcblk1p4
$ mount /dev/mmcblk1p5 /media/mmcblk1p5
- Copy the Linux kernel and DTB images to the mmcblk1p2 eMMC partition:
$ cd /media/mmcblk1p2
$ tar xf /media/sda1/mfg_images/st-image-bootfs-openstlinux-weston-stm32mp1-som.tar.xz
$ cp /media/sda1/mfg_images/{uImage,*.dtb} .
- Install the filesystem images:
$ cd /media/mmcblk1p3
$ tar xf /media/sda1/mfg_images/st-image-vendorfs-openstlinux-weston-stm32mp1-som.tar.xz
$ cd /media/mmcblk1p4
$ tar xf /media/sda1/mfg_images/emcraft-rootfs-openstlinux-weston-stm32mp1-som.tar.xz
$ cd /media/mmcblk1p5
$ tar xf /media/sda1/mfg_images/st-image-userfs-openstlinux-weston-stm32mp1-som.tar.xz
$
- Reboot the system and stop at the U-Boot prompt by pressing any key:
$ reboot
...
U-Boot 2018.09-stm32mp-r2-2.8.0 (Feb 14 2019 - 15:13:06 +0000)
...
Hit any key to stop autoboot: 0
STM32MP1-SOM>
- Configure the eMMC internal partition table for booting:
STM32MP1-SOM> mmc partconf 1 1 2 0
STM32MP1-SOM> mmc partconf 1
EXT_CSD[179], PARTITION_CONFIG:
BOOT_ACK: 0x1
BOOT_PARTITION_ENABLE: 0x2
PARTITION_ACCESS: 0x0
STM32MP1-SOM>
- Remove the SD card from the slot, power off the SOM-BSB board, and prepare it for booting from the eMMC by setting the S4 DIP switch boot selection as described in Selecting Boot Device.
- Re-apply the power and boot the system to the shell prompt:
U-Boot 2018.09-stm32mp-r2-2.8.0 (Feb 14 2019 - 15:13:06 +0000)
CPU: STM32MP15x.B
Model: Emcraft STM32MP1 SOM Rev 1A, www.emcraft.com
Board: stm32mp1 in trusted mode
Watchdog enabled
DRAM: 1 GiB
Clocks:
- MPU : 650 MHz
- MCU : 196.608 MHz
- AXI : 266.500 MHz
- PER : 24 MHz
MMC: STM32 SDMMC2: 0, STM32 SDMMC2: 1
In: serial
Out: vidconsole
Err: vidconsole
Model: Emcraft STM32MP1 SOM Rev 1A, www.emcraft.com
Board: stm32mp1 in trusted mode
Error: 16 bit/pixel mode, but BMP has 24 bit/pixel
Net: eth0: ethernet@5800a000
Boot over mmc1!
Hit any key to stop autoboot: 0
...
Emcraft STM32MP1-SOM Release Distro (ST OpenSTLinux 2.4-snapshot-20190213)
stm32mp1-som ttyS3
stm32mp1-som login: root (automatic login)
root@stm32mp1-som:~#