Booting Linux from SD Card


Use the procedure documented below to install the U-Boot firmware, Linux kernel and filesystem images to an SD Card the STM32MP1 module will be bootable from. Having completed the installation, the STM32MP1 SOM will boot to Linux from the SD Card on next reset / power on.

Please note that the installation will erase files previously installed on your SD Card. The SD Card size should be at least 5GB for the Linux kernel and filesystem images to fit on the card.

Here is the procedure:

  1. Insert SD Card to the board.

  2. Follow the instructions in the Section 5 of  to install the STM32CubeProgrammer Tool to your host.

  3. Add STM32_Programmer_CLI to your PATH:

    $ export PATH=$PATH:/bin: $ STM32_Programmer_CLI [psl@sergmir programmer]$ STM32_Programmer_CLI       -------------------------------------------------------------------                         STM32CubeProgrammer v2.7.0                        ------------------------------------------------------------------- Usage : STM32_Programmer_CLI.exe [command_1] [Arguments_1][[command_2][Arguments_2]...] ...
  4. Power off the board and select the USB Serial Downloader mode (see in Selecting Boot Device).

  5. Attach the microUSB (for STM32MP1-SOM) cable to connector P5 of the BSB and to the Linux host.

  6. Power on the board, attaching another USB-C cable to connector J10 (for STM32MP1-BSB).

  7. Check that the programming USB port appeared on the host (note the "Device Index" in the output):

    ------------------------------------------------------------------- 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
  8. 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/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-stm32mp1-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-stm32mp1-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 $
  9. Use the SD card Flash Layout file for programming the images to SD card:

  10. Disconnect the cables P5 and J10 (for STM32MP1-SOM).

  11. Set the boot mode for booting from SD Card. (Refer to Selecting Boot Device.)

  12. Connect USB-C cable to connector J10 for STM32MP1-BSB, this powers the board on.

  13. Connect to the serial console:

  14. Alternatively, a bootable SD Card could be prepared on the host. In the images directory, run the command below:

  15. Insert SD Card to the host and the run command above to program: