/
Installing Torizon OS to STM32MP Targets

Installing Torizon OS to STM32MP Targets

1. Overview

This page describes how to deploy the Torizon OS target images to STM32MP targets.

The procedure documented below will install the arm-trusted firmware, the U-Boot firmware and the Torizon OS image, including the Linux kernel and filesystem images, to the the boot media of the supported STM32MP targets. The default boot media on the STM32MP Evaluation board and the Discovery kits is the SD card. The STM32MP2 EV1 board also supports booting from the eMMC disk (while the STM32MP1 discovery board has only the SD card option). The installation instructions are mostly similar for the SD card and eMMC, you just have to select a corresponding Flash layout for the desired media when running the programmer tool. Having completed the installation, the STM32MP board will boot to Torizon OS from SD card or eMMC.

Note that the procedure will erase all data that might be present on the boot media previously.

2. Preparing Host

Perform the following steps:

  1. Follow the instructions in Installing the STM32CubeProgrammer Tool in order to install the STM32CubeProgrammer Tool to your Linux host.

  2. Add STM32_Programmer_CLI to your PATH:

    $ export PATH=$PATH:/bin: $ STM32_Programmer_CLI ------------------------------------------------------------------- STM32CubeProgrammer v2.14.0 ------------------------------------------------------------------- Usage : STM32_Programmer_CLI.exe [command_1] [Arguments_1][[command_2][Arguments_2]...]
  3. Download the archive with the release images for your target board from the Emcraft site and unpack them into an arbitrary directory on the Linux host. List of the supported boards and available releases:

    1. STM32P2 Evaluation board - torizon_6.9.0-core-docker-stm32mp25-eval.tar.bz2

    2. STM32P2 Discovery kit - torizon_6.9.0-core-docker-stm32mp25-disco.tar.bz2

    3. STM32P1 Discovery kit - torizon_6.9.0-core-docker-stm32mp15-disco.tar.bz2

If you are installing the images built by Yocto (as opposed to using the pre-built images available from the Emcraft web site), navigate to the $BUILDDIR/deploy/images/$MACHINE directory in the Yocto work directory. Refer to ​Understanding Build Outcome for details on the files structure in the deploy directory.

  1. Set up the target board, connect the serial console and a power supply. Refer to STM32 MPU boards for a description of your target hardware.

3. Installing Torizon OS

Perform the following steps:

  1. Power the target board off.

  2. Select the USB Serial Downloader mode. Refer to ST’s WiKi for details on the boot switches for your board:

    1. STM32MP257X-EV1 - Boot related switches

    2. STM32MP257x-DKx - Boot switches

    3. STM32MP157x-DKx - Boot related switches

  3. Power the target board on.

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

    $ STM32_Programmer_CLI -l usb ------------------------------------------------------------------- STM32CubeProgrammer v2.14.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
  5. Pass the SD card or eMMC Flash Layout file to the STM32_Programmer_CLI for programming the images to boot media: STM32_Programmer_CLI -c port=usb1 -w flashlayout_torizon-core-docker/optee/FlashLayout_<MEDIA>_<BOARD>-optee.tsv, where <MEDIA> is one of sdcard or emmc, <BOARD> is one of stm32mp257f-ev1, stm32mp257f-dk or stm32mp157f-dk2. For example, use the following command to install Torizon OS to the eMMC disk on the STM32MP2 Evaluation board:

    $ STM32_Programmer_CLI -c port=usb1 -w flashlayout_torizon-core-docker/optee/FlashLayout_emmc_stm32mp257f-ev1-optee.tsv ------------------------------------------------------------------- STM32CubeProgrammer v2.14.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.184 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:01.990 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.055 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.056 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.613 RUNNING Program ... PartID: :0x08 Start operation done successfully at partition 0x08 Memory Programming ... Opening and parsing file: torizon-core-docker-stm32mp25-eval.ota-ext4 File : torizon-core-docker-stm32mp25-eval.ota-ext4 Size : 1.44 GB Partition ID : 0x10 Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:07:31.984 RUNNING Program ... PartID: :0x10 Start operation done successfully at partition 0x10 Flashing service completed successfully
  6. Power the target board off.

  7. Set the boot mode for booting from SD card or eMMC. Refer to the ST’s WiKi for the boot switches details for your board:

    1. STM32MP257X-EV1 - Boot related switches

    2. STM32MP257x-DKx - Boot switches

    3. STM32MP157x-DKx - Boot related switches

  8. Power the target board on.

  9. From the serial console terminal, monitor the target boot sequence: