Use the procedure documented below to install the U-Boot firmware, Linux kernel and filesystem images to the eMMC on the STM32MP1 module. Having completed the installation, the STM32MP1 SOM will boot to Linux from the eMMC on next reset / power on.
Note that the procedure will erase all data previously present on the eMMC.
Here is the installation procedure:
Follow the instructions in the Section 5 of https://wiki.st.com/stm32mpu/wiki/STM32MP15_Discovery_kits_-_Starter_Package#Installing_the_STM32CubeProgrammer_tool to install the STM32CubeProgrammer Tool to your host.
Add
STM32_Programmer_CLI
to yourPATH
:$ export PATH=$PATH:/opt/st/bin: $ STM32_Programmer_CLI ------------------------------------------------------------------- STM32CubeProgrammer v2.7.0 ------------------------------------------------------------------- Usage : STM32_Programmer_CLI.exe [command_1] [Arguments_1][[command_2] [Arguments_2]...] ...
Power off the board and select the USB Serial Downloader mode (see in Selecting Boot Device).
Attach the miniUSB (for SOM-BSB) or microUSB (for STM32MP1-SOM) cable to connector P5 of the BSB and to the Linux host.
Power on the board, attaching another miniUSB cable to connector P3 (for SOM-BSB) or USB-C cable to connector J10 (for STM32MP1-BSB).
Check that the programming USB port (DFU interface) appeared on the host (note the "Device Index" in the output):
$ STM32_Programmer_CLI -l ------------------------------------------------------------------- STM32CubeProgrammer v2.7.0 ------------------------------------------------------------------- ===== DFU Interface ===== Total number of available STM32 device in DFU mode: 1 Device Index : USB1 USB Bus Number : 001 USB Address Number : 004 Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000 Serial number : 003000193338511534383330 Firmware version : 0x0110 Device ID : 0x0500
Download the Emcraft release images from Emcraft site and unpack them into the arbitrary directory. (If you are installing the images built by Yocto, navigate to
builddir/tmp-glibc/deploy/images/stm32mp15-som
directory):$ ls -l total 203344 -rw-rw-r-- 1 psl psl 208217109 Apr 27 13:52 images-stm32mp15-4.1.0.tar.bz2 $ tar xfj images-stm32mp15-4.1.0.tar.bz2 $ ls -l total 961696 drwxr-xr-x 3 psl psl 4096 Apr 16 21:53 arm-trusted-firmware drwxr-xr-x 2 psl psl 4096 Apr 16 20:55 bootloader -rw-r--r-- 1 psl psl 558419968 Apr 20 20:59 emcraft-rootfs-openstlinux-weston-stm32mp15-som.ext4 drwxrwxr-x 4 psl psl 4096 Apr 27 14:49 flashlayout_emcraft-rootfs -rw-rw-r-- 1 psl psl 208217109 Apr 27 13:52 images-stm32mp15-4.1.0.tar.bz2 drwxr-xr-x 2 psl psl 4096 Mar 8 20:46 scripts -rw-r--r-- 1 psl psl 67108864 Apr 20 20:57 st-image-bootfs-openstlinux-weston-stm32mp15-som.ext4 -rw-r--r-- 1 psl psl 134217728 Apr 20 18:31 st-image-userfs-openstlinux-weston-stm32mp15-som.ext4 -rw-r--r-- 1 psl psl 16777216 Apr 20 18:31 st-image-vendorfs-openstlinux-weston-stm32mp15-som.ext4 $
Run the following command to install the images to eMMC:
$ STM32_Programmer_CLI -c port=usb1 -w flashlayout_emcraft-rootfs/optee/FlashLayout_emmc_stm32mp157d-som-optee.tsv ------------------------------------------------------------------- STM32CubeProgrammer v2.7.0 ------------------------------------------------------------------- USB speed : High Speed (480MBit/s) Manuf. ID : STMicroelectronics Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000 SN : 003000193338511534383330 FW version : 0x0110 Device ID : 0x0500 Device name : STM32MP1 Device type : MPU Device CPU : Cortex-A7 Start Embedded Flashing service Memory Programming ... Opening and parsing file: tf-a-stm32mp157d-som-usb.stm32 File : tf-a-stm32mp157d-som-usb.stm32 Size : 220,40 KB Partition ID : 0x01 Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:00:00.452 RUNNING Program ... PartID: :0x01 Start operation done successfully at partition 0x01 Flashlayout Programming ... [==================================================] 100% Running Flashlayout Partition ... Flashlayout partition started successfully ... Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:00:39.074 RUNNING Program ... PartID: :0x24 Start operation done successfully at partition 0x24 Flashing service completed successfully $
Disconnect the cables from P5 and P3 (for SOM-BSB) or P5 and J10 (for STM32MP1-SOM).
Select the eMMC as the boot device (see in Selecting Boot Device).
Connect miniUBS to P3 (for SOM-BSB) or USB-C cable to connector J10 (for STM32MP1-BSB), this powers the board on.
Connect to the serial console (see Setting Up the STM32MP1 SOM Starter Kit) and see the system booting:
NOTICE: CPU: STM32MP157AAA Rev.B NOTICE: Model: Emcraft STM32MP157 SOM rev 1A, https://emcraft.com INFO: Reset reason (0x15): INFO: Power-on Reset (rst_por) INFO: Using EMMC INFO: Instance 2 INFO: Boot used partition fsbl1 NOTICE: BL2: v2.2-r2.0(debug):v2.2-stm32mp-r2-2-g7aca41fc2 NOTICE: BL2: Built : 18:25:18, Mar 31 2021 INFO: Using crypto library 'stm32_crypto_lib' INFO: BL2: Doing platform setup INFO: RAM: DDR3-DDR3L 32bits 533000Khz INFO: Memory size = 0x40000000 (1024 MB) ... ST OpenSTLinux - Weston - (A Yocto Project Based Distro) 3.1-snapshot stm32mp1-som ttySTM0 stm32mp1-som login: root (automatic login) Last login: Fri Feb 7 15:51:09 UTC 2020 on tty7 root@stm32mp1-som:~#