Use the procedure documented below to install the U-Boot firmware, Linux kernel and filesystem images to the eMMC on the STM32MP2 module will be bootable from. Having completed the installation, the STM32MP2 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 procedure:
Follow the instructions in the https://voxelbotics.atlassian.net/wiki/spaces/DOC/pages/546275360/Setting+up+the+STM32MP257F-EV1+Evaluation+Board#Installing-the-STM32CubeProgrammer-tool to install the STM32CubeProgrammer Tool to your host.
Add
STM32_Programmer_CLI
to yourPATH
:$ export PATH=$PATH:/bin: $ STM32_Programmer_CLI [psl@sergmir programmer]$ STM32_Programmer_CLI ------------------------------------------------------------------- STM32CubeProgrammer v2.17.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 https://voxelbotics.atlassian.net/wiki/spaces/DOC/pages/561709057/Selecting+STM32MP2+EV1+Boot+Device?atl_f=content-tree ).
Attach USB-C (for STM32MP2 EV) cable to connector CN15 and to the Linux host.
Power on the board, attaching another USB-C cable to connector CN15.
Check that the programming USB port appeared on the host (note the "Device Index" in the output):
------------------------------------------------------------------- STM32CubeProgrammer v2.17.0 ------------------------------------------------------------------- ===== DFU Interface ===== Total number of available STM32 device in DFU mode: 1 Device Index : USB1 USB Bus Number : 002 USB Address Number : 007 Product ID : DFU in HS Mode @Device ID /0x505, @Revision ID /0x2000 Serial number : 002A00194136500B00363653 Firmware version : 0x0110 Device ID : 0x0505
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 the
builddir/tmp-glibc/deploy/images/stm32mp25-eval
directory):$ tar xfj stm32mp2-4.3.0.tgz $ cd stm32mp2-4.3.0 $ ls -l total 1287524 drwxr-xr-x 2 psl psl 4096 Oct 7 02:43 arm-trusted-firmware -rw-r--r-- 1 psl psl 1201 Apr 5 2011 build-emcraft-rootfs-openstlinux-weston-stm32mp25-eval -rw-r--r-- 1 psl psl 1066606592 Oct 7 02:39 emcraft-rootfs-openstlinux-weston-stm32mp25-eval.ext4 -rw-r--r-- 1 psl psl 116724 Oct 7 02:38 emcraft-rootfs-openstlinux-weston-stm32mp25-eval.manifest drwxrwxr-x 2 psl psl 4096 Oct 7 02:28 fip drwxr-xr-x 4 psl psl 4096 Oct 7 02:42 flashlayout_emcraft-rootfs drwxr-xr-x 2 psl psl 4096 Sep 23 03:11 scripts -rw-r--r-- 1 psl psl 67108864 Oct 4 01:41 st-image-bootfs-openstlinux-weston-stm32mp25-eval.ext4 -rw-r--r-- 1 psl psl 179 Oct 4 01:41 st-image-bootfs-openstlinux-weston-stm32mp25-eval.manifest -rw-r--r-- 1 psl psl 134217728 Oct 4 01:33 st-image-userfs-openstlinux-weston-stm32mp25-eval.ext4 -rw-r--r-- 1 psl psl 5794 Oct 4 01:33 st-image-userfs-openstlinux-weston-stm32mp25-eval.manifest -rw-r--r-- 1 psl psl 50331648 Oct 4 01:32 st-image-vendorfs-openstlinux-weston-stm32mp25-eval.ext4 -rw-r--r-- 1 psl psl 842 Oct 4 01:32 st-image-vendorfs-openstlinux-weston-stm32mp25-eval.manifest
Use the SD card Flash Layout file for programming the images to SD card:
[psl@sergmir 3.0.0]$ STM32_Programmer_CLI -c port=usb1 -w flashlayout_emcraft-rootfs/optee/FlashLayout_emmc_stm32mp257f-ev1-optee.tsv ------------------------------------------------------------------- STM32CubeProgrammer v2.17.0 ------------------------------------------------------------------- USB speed : High Speed (480MBit/s) Manuf. ID : STMicroelectronics Product ID : DFU in HS Mode @Device ID /0x505, @Revision ID /0x2000 SN : 002A00194136500B00363653 DFU protocol: 1.1 Board : -- Device ID : 0x0505 Device name : STM32MP25xx Device type : MPU Revision ID : -- Device CPU : Cortex-A7 Start Embedded Flashing service Memory Programming ... Opening and parsing file: tf-a-stm32mp257f-ev1-usb.stm32 File : tf-a-stm32mp257f-ev1-usb.stm32 Size : 198.86 KB Partition ID : 0x01 Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:00:02.199 RUNNING Program ... PartID: :0x01 Reconnecting the device ... USB speed : High Speed (480MBit/s) Manuf. ID : STMicroelectronics Product ID : DFU @Device ID /0x505, @Revision ID /0x0011, @Name /STM32MP257FAI Rev.Y, SN : 002A00194136500B00363653 DFU protocol: 1.1 Board : -- Device ID : 0x0505 Device name : STM32MP257FAI Rev.Y Device type : MPU Device CPU : Cortex-A7 Start operation done successfully at partition 0x01 Memory Programming ... Opening and parsing file: fip-stm32mp257f-ev1-ddr-optee-emmc.bin File : fip-stm32mp257f-ev1-ddr-optee-emmc.bin Size : 29.38 KB Partition ID : 0x02 Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:00:00.024 RUNNING Program ... PartID: :0x02 Reconnecting the device ... USB speed : High Speed (480MBit/s) Manuf. ID : STMicroelectronics Product ID : DFU @Device ID /0x505, @Revision ID /0x0011, @Name /STM32MP257FAI Rev.Y, SN : 002A00194136500B00363653 DFU protocol: 1.1 Board : -- Device ID : 0x0505 Device name : STM32MP257FAI Rev.Y Device type : MPU Device CPU : Cortex-A7 Start operation done successfully at partition 0x02 Memory Programming ... Opening and parsing file: fip-stm32mp257f-ev1-optee-emmc.bin File : fip-stm32mp257f-ev1-optee-emmc.bin Size : 2.65 MB Partition ID : 0x03 Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:00:02.363 RUNNING Program ... PartID: :0x03 Reconnecting the device ... USB speed : High Speed (480MBit/s) Manuf. ID : STMicroelectronics Product ID : USB download gadget@Device ID /0x505, @Revision ID /0x0011, @Name /STM32MP257FAI Rev.Y, SN : 002A00194136500B00363653 DFU protocol: 1.1 Board : -- Device ID : 0x0505 Device name : STM32MP257FAI Rev.Y Device type : MPU Device CPU : Cortex-A7 Start operation done successfully at partition 0x03 Flashlayout Programming ... [==================================================] 100% Running Flashlayout Partition ... Reconnecting the device ... USB speed : High Speed (480MBit/s) Manuf. ID : STMicroelectronics Product ID : USB download gadget@Device ID /0x505, @Revision ID /0x0011, @Name /STM32MP257FAI Rev.Y, SN : 002A00194136500B00363653 DFU protocol: 1.1 Board : -- Device ID : 0x0505 Device name : STM32MP257FAI Rev.Y Device type : MPU Device CPU : Cortex-A7 Flashlayout partition started successfully Memory Programming ... Opening and parsing file: tf-a-stm32mp257f-ev1-optee-emmc.stm32 File : tf-a-stm32mp257f-ev1-optee-emmc.stm32 Size : 202.91 KB Partition ID : 0x04 Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:00:00.059 RUNNING Program ... PartID: :0x04 Start operation done successfully at partition 0x04 Memory Programming ... Opening and parsing file: tf-a-stm32mp257f-ev1-optee-emmc.stm32 File : tf-a-stm32mp257f-ev1-optee-emmc.stm32 Size : 202.91 KB Partition ID : 0x05 Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:00:00.059 RUNNING Program ... PartID: :0x05 Start operation done successfully at partition 0x05 Memory Programming ... Opening and parsing file: metadata.bin File : metadata.bin Size : 120.00 B Partition ID : 0x06 Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:00:00.006 RUNNING Program ... PartID: :0x06 Start operation done successfully at partition 0x06 Memory Programming ... Opening and parsing file: metadata.bin File : metadata.bin Size : 120.00 B Partition ID : 0x07 Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:00:00.006 RUNNING Program ... PartID: :0x07 Start operation done successfully at partition 0x07 Memory Programming ... Opening and parsing file: fip-stm32mp257f-ev1-optee-emmc.bin File : fip-stm32mp257f-ev1-optee-emmc.bin Size : 2.65 MB Partition ID : 0x08 Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:00:00.718 RUNNING Program ... PartID: :0x08 Start operation done successfully at partition 0x08 Memory Programming ... Opening and parsing file: st-image-bootfs-openstlinux-weston-stm32mp25-eval.ext4 File : st-image-bootfs-openstlinux-weston-stm32mp25-eval.ext4 Size : 64.00 MB Partition ID : 0x10 Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:00:21.586 RUNNING Program ... PartID: :0x10 Start operation done successfully at partition 0x10 Memory Programming ... Opening and parsing file: st-image-vendorfs-openstlinux-weston-stm32mp25-eval.ext4 File : st-image-vendorfs-openstlinux-weston-stm32mp25-eval.ext4 Size : 48.00 MB Partition ID : 0x11 Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:00:16.195 RUNNING Program ... PartID: :0x11 Start operation done successfully at partition 0x11 Memory Programming ... Opening and parsing file: emcraft-rootfs-openstlinux-weston-stm32mp25-eval.ext4 File : emcraft-rootfs-openstlinux-weston-stm32mp25-eval.ext4 Size : 1017.20 MB Partition ID : 0x12 Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:05:42.759 RUNNING Program ... PartID: :0x12 Start operation done successfully at partition 0x12 Memory Programming ... Opening and parsing file: st-image-userfs-openstlinux-weston-stm32mp25-eval.ext4 File : st-image-userfs-openstlinux-weston-stm32mp25-eval.ext4 Size : 128.00 MB Partition ID : 0x13 Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:00:43.005 RUNNING Program ... PartID: :0x13 Start operation done successfully at partition 0x13 Flashing service completed successfully $
Disconnect the cables CN21 (for STM32MP2 EV1).
Set the boot mode for booting from eMMC. (Refer to https://voxelbotics.atlassian.net/wiki/spaces/DOC/pages/561709057/Selecting+STM32MP2+EV1+Boot+Device?atl_f=content-tree .)
Connect USB-C cable to connector CN21 for STM32MP2 EV1, this powers the board on.
Connect to the serial console:
NOTICE: CPU: STM32MP257FAI Rev.Y NOTICE: Model: STMicroelectronics STM32MP257F-EV1 Evaluation Board NOTICE: Board: MB1936 Var1.0 Rev.D-01 INFO: Reset reason (0x2034): INFO: Pad Reset from NRST INFO: PMIC2 version = 0x11 INFO: PMIC2 product ID = 0x20 INFO: FCONF: Reading TB_FW firmware configuration file from: 0xe011000 INFO: FCONF: Reading firmware configuration information for: stm32mp_io INFO: FCONF: Reading firmware configuration information for: stm32mp_fuse INFO: Using EMMC INFO: Instance 2 ...