Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This page describes how to build the TorizonOS for the STM32MP2-EV1 development board.

2. Understanding Build Structure

The base principles for building the TorizonOS for STM32MP2 architecture are the same as for others described in official TorizonOS documentation https://developer.toradex.com/torizon/in-depth/build-torizoncore-from-source-with-yocto-projectopenembedded/

The main difference is that the build requires 2 additional meta-layers. These are:

  1. meta-st-stm32mp - BSP Layer for stm32mp developed by STMicroelectonics for the OpenSTLinux project https://wiki.st.com/stm32mpu/wiki/Category:Yocto-based_OpenSTLinux_embedded_software

  2. meta-torizon-st - adaptation of the stm32mp BSP for TorizonOS developed by EmCraft

Below is an instruction on how to integrate these two layers to the general TorizonOS Yocto project and build TorizonOS for the STM32MP2 targets.

3. Preparing BSP for Build

Perform the following steps:

  1. On the Linux host, set up a host system in a separate directory (/work/toradex/torizon in this example) using the Docker container provided by Toradex for the TorizonOS build:

    Code Block
    $ docker run --rm -it --name=crops6-minimal -v /work/toradex/torizon:/workdir --workdir=/workdir torizon/crops:kirkstone-6.x.y /bin/bash
  2. Set up the default git user and e-mail:

    Code Block
    $ git config --global user.email "you@example.com"
    $ git config --global user.name "Your Name"
  3. Initialise the TorizonOS BSP:

    Code Block
    $ repo init -u git://git.toradex.com/toradex-manifest.git -b kirkstone-6.x.y -m torizoncore/default.xml
  4. Sync the repositories:

    Code Block
    $ repo sync
  5. Download the ST32MP2 BSP layer:

    Code Block
    $ git -C layers clone -b mickledore https://github.com/STMicroelectronics/meta-st-stm32mp
  6. Download the ST32MP2 Torizon compatibility layer:

    Code Block
    $ git -C layers clone -b kirkstone git@github.com:EmcraftSystems/meta-torizon-st.git
  7. Replace the setup environment link and the Docker build link:

    Code Block
    $ ln -sf layers/meta-torizon-st/scripts/setup-environment setup-environment

...

4. Building BSP Images

Perform the following steps:

  1. In the same host system, set up the build environment:

    Code Block
    $ MACHINE=stm32mp25-eval DISTRO=torizon source setup-environment build-stm32mp25-eval
  2. Build the TorizonOS images:

    Code Block
    $ bitbake torizon-core-docker

5. Understanding Build Outcome

When build is complete the following artifacts in the build-stm32mp25-eval/deploy/images/stm32mp25-eval can be used to install TorizonOS to the STM32MP2-EV1 development board (refer to Installing TorizonOS to STM32MP2 EV1 Using the STM32 Programmer Tool):

  1. arm-trusted-firmware - the directory with FSBL (= Trusted Firmware-A) images: tf-a-stm32mp257f-ev1-usb.stm32(required to boot the STM32MP2 targets over USB for the initial installation), tf-a-stm32mp257f-ev1-optee-emmc.stm32 (to be installed and boot the STM32MP2 targets from eMMC) and metadata.bin(FSBL metadata)

  2. fip - the directory with FIP (= U-Boot) images to be installed to eMMC: fip-stm32mp257f-ev1-ddr-optee-emmc.bin(required to initialize DDR) fip-stm32mp257f-ev1-optee-emmc.bin (main bootloader image)

  3. flashlayout_torizon-core-docker/optee/FlashLayout_emmc_stm32mp257f-ev1-optee.tsv - eMMC layout to be used with STM32_Programmer

  4. torizon-core-docker-stm32mp25-eval.ota-ext4 - main TorizoOS OSTree based image, including the Linux kernel images and the root file system.