BSP Manual - phyFLEX-STM32MP2x FPSC Rapid Development Kit (L-1091e.A3)

Table of Contents

BSP Manual - phyFLEX-STM32MP2x FPSC Alpha Kit (L-1091e.A3)

Document TitleBSP Manual - phyFLEX-STM32MP2x FPSC Rapid Development Kit (L-1091e.A3)
Document TypeBSP Manual
Article NumberL-1091e.A3
Release Date19.11.2026
Is Branch ofBSP Manual - phyFLEX-STM32MP2x FPSC Rapid Development Kit (L-1091e.Ax)

Compatible BSPs

Compatible BSPsBSP Release TypeBSP Release DateBSP Status
BSP-Yocto-OpenSTLinux-STM32MP2-PD26.2.0Major Release09.11.26Released

PHYTEC Documentation

PHYTEC will provide a variety of hardware and software documentation for all of our products. This includes any or all of the following: Quickstart Guide: A short guide on how to set up and boot a phyFLEX board, along with brief information on building a BSP, the device tree, and accessing peripherals.

  • Hardware Manual: A detailed description of the System on Module and accompanying carrier board. 
  • Yocto Manual: A comprehensive guide for the Yocto version the phyFLEX uses. This guide contains an overview of Yocto, introducing, installing, and customizing the PHYTEC BSP; how to work with programs like Bitbake; and much more.
  • BSP Manual: A manual specific to the BSP version of the phyFLEX. Information such as how to build the BSP, booting, updating software, device tree, and accessing peripherals can be found here.
  • Development Environment Guide: This guide shows how to work with the Virtual Machine (VM) Host PHYTEC has developed and prepared to run various Development Environments. There are detailed step-by-step instructions for Eclipse and Qt Creator, which are included in the VM. There are instructions for running demo projects for these programs on a phyFLEX product as well. Information on how to build a Linux host PC yourself is also a part of this guide.
  • Pin Muxing Table: phyFLEX SOMs have an accompanying pin table (in Excel format). This table will show the complete default signal path, from the processor to the carrier board. The default device tree muxing option will also be included. This gives a developer all the information needed in one location to make muxing changes and design options when developing a specialized carrier board or adapting a PHYTEC SOM to an application. 

On top of these standard manuals and guides, PHYTEC will also provide Product Change Notifications, Application Notes, and Technical Notes. These will be done on a case-by-case basis. Most of the documentation can be found on the applicable download page of our products.

Supported Hardware

This BSP supports the phyFLEX-STM32MP2x FPSC-Gamma SOM with the Libra Rapid Development Kit. The STM32MP2 BSP is a unified BSP, which means in the future it will support a set of different PHYTEC Carrier Boards (CB) with different Systems on Module (SOMs). These hardware sets are called MACHINE.

If you need to figure out the corresponding MACHINE name of your board, go to the phyFLEX-STM32MP2x FPSC-Gamma Product Page (Downloads under the heading "Software Linux BSP-Releases / Software Manuals", click on the corresponding BSP release).

Example: Release page for STM32MP2 PD26.2.0 Release: BSP-Yocto-OpenSTLinux-STM32MP2-PD26.2.0

If you choose a specific Machine Name in the section Supported Machines, you can see which Article Numbers are available under this machine and also a short description of the hardware information. In case you only have the Article Number of your hardware, you can leave the Machine Name drop-down menu empty and only choose your Article Number. Now it should show you the necessary Machine Name for your specific hardware. 

View of the Libra Rapid Development Kit

Libra Development Board (top)

Libra Development Board (bottom)

Getting Started with the included SD Card

This section is designed to get the board up and running with the SD card included in the kit, which has been prepared with pre-built images.

Included in the Kit

  • Alpha phyFLEX-STM32MP2x FPSC-Gamma SOM on Alpha Libra Rapid Development Kit (PD-05036-ALPHA.A1)

  • Power adapter supplying 24 V / 1 A (SV055)

  • 2x USB-A to USB-C cable (WK560)

  • Ethernet cable (WK114)
  • SD Card with prepared prebuilt images 
  • 2.54 10P to DB9P Female (WF072)

  • 1 x 2.54 10P to DB9P Male (WF228)

Booting from the SD Card

This section describes how to boot the phyFLEX-STM32MP2 with the pre-built images on the included SD card.

  • Insert the microSD card into the SD card slot of the board.
  • Check that the S1 DIP Switch is in the default position (boot from SD):

    1234
    -+++


    S1 DIP Switch Default Position (for Libra Version 1618.2)

    1234
    +---
    S1 DIP Switch Default Position (for Libra Version 1618.3)

  • Plug the USB cable into the USB debug connector (X14, shown on ) and your host PC. You should see 4 new devices appear: /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2 and /dev/ttyUSB3 . A Linux terminal will be accessible on /dev/ttyUSB0. 
  • Start your favorite terminal software (e.g., Minicom or Tera Term) on your host PC and configure it for 115200 baud, 8 data bits, no parity, and 1 stop bit (8n1) with no handshake.
  • Example to launch minicom on /dev/ttyUSB0:
host:~$sudo minicom -D /dev/ttyUSB0
  • Connect the power supply to the power connector.

Warning

If you are using a power adapter other than the one provided, please note the polarity of the power component X8. Ensure that your power adapter is correctly set up to use the polarity as shown below.../../../_images/power-connector.png

Warning

If the USB-PD port (X2) is mounted, do not use it in parallel with the 24V Power-In connector (X8). This may damage your device!

Tips

Be aware that as soon as the Libra FPSC is supplied with power, the SD Card boot sequence will begin. Ensure that all cables are connected to the board!

The console output can be viewed in your terminal window. If everything was done correctly, the login prompt will be shown at the end of the booting process:

ST OpenSTLinux - Weston - (A Yocto Project Based Distro) 5.0.6-snapshot stm32mp25x-libra-fpsc-1a6-b1-6f-aa-0c-ab ttySTM0

stm32mp25x-libra-fpsc-1a6-b1-6f-aa-0c-ab login: root (automatic login)

root@stm32mp25x-libra-fpsc-1a6-b1-6f-aa-0c-ab:~# 

Log-in is done automatically as root (no password is required).

Prebuild Images

PHYTEC provides pre-built images and release notes for the phyFLEX-STM32MP2 Libra Rapid Development Kit. They can be downloaded here: https://download.phytec.de/Software/Linux/BSP-Yocto-STM32MP2/

Building the BSP

This section will guide you through the general build process of the STM32MP2 BSP using our phyLinux script (based on repo tool) and the Yocto environment provided by OpenSTLinux.

tips

For more information on our Yocto OpenSTLinux BSP, please refer to our Yocto OpenSTLinux Manual.

Get and Initialize the BSP Environment

To learn how to obtain and initialize the BSP environment, please refer to our Yocto OpenSTLinux Manual. In this manual, you will also find out how to choose the right OpenSTLinux Distribution and the right BSP Image for your project.

Build Process

Now that the build environment is ready, you can start the first build process using the following command:

host:~/BSP/build$ bitbake <BSP_IMAGE>

Example to build the "st-image-weston":

host:~/BSP/build$ bitbake st-image-weston

Generated BSP Image Binaries

All images generated by Bitbake are deployed to ~/BSP/build/tmp-glibc/deploy/images/<MACHINE>. The following list shows the generated files used for flashing the phyFLEX-STM32MP2x:

Generated Files

Binary subfolder locationBinary file nameDescription

arm-trusted-firmware

tf-a-<BOOTLOADER_DEVICE_TREE_NAME>-optee-programmer-usb.stm32

TF-A binary for USB serial boot mode (STM32CubeProgrammer)

 


For more details on TF-A BL2, please refer to:

https://wiki.st.com/stm32mpu/wiki/TF-A_BL2_overview

tf-a-<BOOTLOADER_DEVICE_TREE_NAME>-optee-programmer-uart.stm32TF-A binary for UART serial boot mode (STM32CubeProgrammer)
tf-a-<BOOTLOADER_DEVICE_TREE_NAME>-optee-emmc.stm32TF-A binary for FSBL partition (eMMC boot device)
tf-a-<BOOTLOADER_DEVICE_TREE_NAME>-optee-sdcard.stm32TF-A binary for FSBL partition (SD-card boot device)

fip

fip-<BOOTLOADER_DEVICE_TREE_NAME>-ddr-optee-programmer-usb.bin

FIP binary for FIP DDR partition used on USB serial boot mode (STM32CubeProgrammer)

 

TF-A FIP binary encapsulates TF-A BL31, OP-TEE, and U-boot. For more details, please refer to:

https://wiki.st.com/stm32mpu/wiki/How_to_configure_TF-A_FIP

fip-<BOOTLOADER_DEVICE_TREE_NAME>-optee-programmer-usb.bin

FIP binary for the FIP partition used in USB serial boot mode (STM32CubeProgrammer)

fip-<BOOTLOADER_DEVICE_TREE_NAME>-optee-emmc.bin

FIP binary for the FIP partition of eMMC

fip-<BOOTLOADER_DEVICE_TREE_NAME>-optee-sdcard.bin

FIP binary for the FIP partition of SDCARD

-

st-image-bootfs-<DISTRO>-<MACHINE>.splitted-bootfs.ext4

Binary for bootfs partition on eMMC and microSD card devices

st-image-vendorfs-<DISTRO>-<MACHINE>.splitted-vendorfs.ext4

Binary for vendorfs partition on eMMC and microSD card devices

<BSP_IMAGE>-<DISTRO>-<MACHINE>.splitted-rootfs.ext4

Binary for rootfs partition on eMMC and microSD card devices

st-image-userfs-<DISTRO>-<MACHINE>.splitted-userfs.ext4

Binary for userfs partition on eMMC and microSD card devices

<BSP_IMAGE>-<DISTRO>-<MACHINE>.rootfs.wic

<BSP_IMAGE>-<DISTRO>-<MACHINE>.rootfs.bmap

<BSP_IMAGE>-<DISTRO>-<MACHINE>.rootfs.wic.bz2


WIC file to create an SD card image


Note

Additional binaries under "arm-trusted-firmware-m-cube" and "arm-trusted-firmware-m" subfolders are generated when building images for "M33-TD flavor" mode (boot from Cortex-M33).

This mode is not described in this document. Please refer to the Coprocessor OpenSTLinux Manual for details on this mode.

Programming the Target

There are two ways to program the target (SD card, eMMC, or NOR flash): 

  • Using the ST official method with STM32MPCubeProgrammer (using USB DFU boot mode)
  • Programming from a running U-boot or Linux on the target. 

tips

Programming a complete BSP from a running target is usually faster than the USB DFU option with STM32MPCubeProgrammer.

The phyFLEX-STM32MP2x is delivered with a pre-programmed bootloader on eMMC. So when booting from eMMC (default boot mode), U-boot is reached. From U-boot, it is possible to flash the eMMC (from Ethernet, SD card, or USB stick).

Booting a minimal Linux from U-boot (through initramfs or NFS method) to flash the eMMC can be a better option than directly from U-boot (possible to use SSH and optimized flash tools like bmaptool or partup). Booting a minimal Linux with an "initramfs" should also be possible using USB DFU and  STM32MPCubeProgrammer (but this has not been validated yet with phyFLEX-STM32MP2x).

In any case, it is highly recommended to equip custom carrier boards with either a USB Dual Role port or an SD-card interface to be able to program the target (in case the pre-programmed bootloader in eMMC is not reachable anymore).

Flash eMMC (or SD card) with STM32MPCubeProgrammer - USB DFU boot mode

STM32MPCubeProgrammer tool is used for flashing the eMMC or SD Card.

Installing and using the tool is described in the Coprocessor OpenSTLinux Manual.

To download the BSP with STM32MPCubeProgrammer, change the BOOT mode tothe UART/USB boot mode.

For the Libra carrier board:

  • Switch OFF the board
  • Change the S1 DIP switch to UART/USB boot mode:

S1 DIP Switch USB Boot Position (for Libra Version 1618.2)

S1 DIP Switch USB Boot Position (for Libra Version 1618.3)
  • Switch ON the board.
  • Connect a USB-C cable to X18 and to the host PC that contains the BSP image.

The board is now ready for programming with STM32MPCubeProgrammer. Please refer to the Yocto OpenSTLinux Manual - STM32MP (L-1060e) for a detailed procedure on how to install STM32CubeProgrammer and flash the target.

tips

For USB serial downloader mode, there are alternative options to the STM32MPCubeProgrammer tool (not tested yet by PHYTEC for the STM32MP SOMs):

Flash eMMC from a running U-boot or Linux on target

A way to program the eMMC is to flash from U-boot (already running on eMMC) or from Linux (SD-card boot or Linux booted by U-boot using NFS or initramfs). In this section, we will only describe how to update the eMMC from the network (ETH1 interface of the SOM is taken as an example).

Other interfaces could be used instead: ETH2, USB Dual Role port (with Ethernet over USB gadget, on Linux only), SD card, or USB stick.

tips

From a high-level point of view, an eMMC device is like an SD card. Therefore, it is possible to flash a specific WIC image (<name>.wic) from the Yocto build system directly to the eMMC.

In the STM32MP case, the WIC image for eMMC contains all the necessary GPT partitions except the eMMC boot partitions that need to be updated separately (must contain the TF-A BL2 bootloader stage).

Warning

Except for our "OpenSTLinux RAUC distro", we currently don't provide a WIC image to flash the eMMC; the provided generated WIC is for SD-card flashing only.

(With the RAUC distro version, we don't support SD-card boot, so the provided WIC image is for eMMC flashing only).

To build a WIC for eMMC, the BSP needs to be built by adding this line in the buid/local.conf file:

WKS_FILES:openstlinuxcommon = "stm32mp-emmcimage.wks.in"

("stm32mp-emmcimage.wks.in" is located in meta-st-openstlinux-phytec/wic/)

Warning

bmaptool (https://docs.yoctoproject.org/dev-manual/bmaptool.html) is currently not recommended for flashing the WIC file: the current generated WIC file within our OpenSTLinux BSP seems to have GPT partitions alignment not compatible with bmaptool. This is planned to be fixed. So the dd command is currently used instead.

Alternatively, the PHYTEC partup flashing tool (https://partup.readthedocs.io/en/latest/) could be used from a Linux running on the target. partup packages are not yet delivered by default for our STM32MP BSPs. (but the tool is present on target).

Host Network Preparation

For various tasks involving a network in the Bootloader, some host services are required to be set up. On the development host, a TFTP and DHCP server might have to be installed and configured.

TFTP Server Setup

  •  Install the TFTP server:
host:~$ sudo apt install tftpd-hpa
  • First, create a directory to store the TFTP files:
host:~$ sudo mkdir /srv/tftp
  • Then copy your BSP image files to this directory and make sure other users have read access to all the files in the TFTP directory; otherwise, they are not accessible from the target:
host:~$ sudo chmod -R o+r /srv/tftp
  • You also need to configure a static IP address for the appropriate interface. The default IP address of the PHYTEC evaluation boards (on Linux) is 192.168.3.11 (for ETH1). Setting a host address of 192.168.3.10 with netmask 255.255.255.0 is a good choice.

host:~$ ip addr show <network-interface>
Replace <network-interface> with the network interface you configured and want to connect the board to. You can show all network interfaces by not specifying a network interface.
  • The message you receive should contain this:
inet 192.168.3.10/24 brd 192.168.3.255
  • Create or edit the /etc/default/tftpd-hpa file:
# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="-s -c"
  • Set TFTP_DIRECTORY to your TFTP server root directory

  • Set TFTP_ADDRESS to the host address the server is listening to (set to 0.0.0.0:69 to listen to all local IPs)

  • Set TFTP_OPTIONS. The following command shows the available options:

host:~$ man tftpd
  • Restart the services to pick up the configuration changes:

host:~$ sudo service tftpd-hpa restart

TFTP Server Setup is ready, and you can now connect the ETH1 Ethernet port of the board to your host system.

Note that the default IP address set on the Linux target for ETH1 is 192.168.3.11. But currently, this is not the case in the U-boot default environment, so ipaddr and serverip must be set accordingly.

DHCP Server Setup

  •  Install the DHCP server:

host:~$ sudo apt install kea
  • Create or edit the /etc/kea/kea-dhcp4.conf file, using the internal subnet sample. Replace <network-interface> with the name for the physical network interface:
  •  Install the DHCP server:

 host:~$ cat /etc/kea/kea-dhcp4.conf 
{
  "Dhcp4": {
    "interfaces-config": {
      "interfaces": [ "<network-interface>/192.168.3.10" ]
    },
    "lease-database": {
      "type": "memfile",
      "persist": true,
      "name": "/tmp/dhcp4.leases"
    },
    "valid-lifetime": 28800,
    "subnet4": [{
        "id": 1,
        "next-server": "192.168.3.10",
        "subnet": "192.168.3.0/24",
        "pools": [
          { "pool": "192.168.3.1 - 192.168.3.255" }
        ]
    }]
  }
}

Warning

Be careful when creating subnets, as this may interfere with the company network policy. To be on the safe side, use a different network and specify that via the interfaces configuration option.

  • Now the DHCP server has to read the /etc/kea/kea-dhcp4.conf file again:

host:~$ sudo systemctl restart kea-dhcp4-server 

When you boot/restart your host PC and don’t have the network interface, as specified in the kea-dhcp4 config, the kea-dhcp4-server will fail to start. Make sure to start/restart the systemd service when you connect the interface.

Flash eMMC from Network in U-Boot

These steps will show how to update the eMMC via the network from U-Boot. It is assumed that all necessary images are copied to the default /srv/tftp directory:

  • TF-A BL2 binary (tf-a- *.stm32)
  • WIC file for eMMC (*.wic.gz or *.wic.xz or *.wic).

The wic.gz format can be decompressed in U-boot with the "gzwrite" command. This allows you to flash raw WIC files that are bigger than the RAM size. 

Update TF-A BL2 on eMMC "boot" areas

  • When using a static IP address, serverip and ipaddr must be set:
STM32MP> setenv ipaddr 192.168.3.11
STM32MP> setenv serverip 192.168.3.10
STM32MP> saveenv
STM32MP> ping 192.168.3.10 # optionnal: to check if connection is ok and start it. Relaunch a second time if it fails.                 
  • Load your image via network to RAM and flash it to the eMMC boot areas ("boot1" and "boot2"):
STM32MP> mmc dev 1                                              # select eMMC device
STM32MP> tftp ${loadaddr} tf-a-stm32mp257f-phyflex-fpsc-g-som-optee-emmc.stm32
STM32MP> mmc partconf 1 1 1 1                                   # set boot1 partition access (and set boot partition 1 enabled for boot)
STM32MP> mmc write ${loadaddr} 0x0 0x200                        # write tf-a on boot1, size is 256KB (0x200*512)
STM32MP> mmc partconf 1 1 1 2                                   # set boot2 partition access (and keep boot partition 1 enabled for boot) 
STM32MP> mmc write ${loadaddr} 0x0 0x200                        # write tf-a on boot2, size is 256KB (0x200*512)
STM32MP> mmc partconf 1 1 1 0                                   # set user partition access (and keep boot partition 1 enabled for boot)                          

Update the eMMC "user" area

Warning

This step, performed on the U-boot side, only works if the size of the compressed WIC image .wic.gz file is less than the SOM RAM size (2GB, for example).
  • If the WIC file is compressed in .wic.xz format, uncompressing the WIC image on the host for eMMC flashing is mandatory first:
host:~$ unxz /srv/tftp/st-image-weston-openstlinux-weston-stm32mp25x-phyflex-libra-rdk-3.rootfs.wic.xz
  • Configure the network:
    • When using DHCP:
STM32MP> dhcp
BOOTP broadcast 1
DHCP client bound to address 192.168.3.1 (1 ms)
    • When using a static IP address (serverip and ipaddr must be set additionally):
STM32MP> setenv ipaddr 192.168.3.11
STM32MP> setenv serverip 192.168.3.10
STM32MP> saveenv
  • Load your image via network to RAM:
STM32MP> tftp ${loadaddr} st-image-weston-openstlinux-weston-stm32mp25x-phyflex-libra-rdk-3.rootfs.wic
Using eth1@482c0000 device
TFTP from server 192.168.3.10; our IP address is 192.168.3.11
Filename 'st-image-weston-openstlinux-weston-stm32mp25x-phyflex-libra-rdk-3.rootfs.wic'.
Load address: 0x84000000
Loading:: ######################################
         ######################################
         ######################################
         ...
         ...
         ...
         ######################################
         #############
          9.4 MiB/s
done
Bytes transferred = 1205879808 (47e04400 hex)
  • For flashing with a .gz-compressed WIC file (*.wic.gz):
STM32MP> mmc dev 1
switch to partitions #0, OK
mmc1(part 0) is current device
STM32MP> gzwrite mmc 1 ${loadaddr} ${filesize} 0x1000000 0
2701131776/2739345408
        2739345408 bytes, crc 0x3d803097

eMMC is now flashed, and the target can be rebooted.

  • For flashing with an uncompressed WIC file:
STM32MP> mmc dev 1
switch to partitions #0, OK
mmc1(part 0) is current device
STM32MP> setexpr nblk ${filesize} / 0x200 # compute block count(block size is 512bytes = 0x200)
STM32MP> mmc write ${loadaddr} 0x0 ${nblk} 

MMC write: dev # 1, block # 0, count 2355234 ... 2355234 blocks written: OK

eMMC is now flashed, and the target can be rebooted.

Flash eMMC from Network in Linux 

There are three different ways to boot Linux with an empty eMMC or one containing only U-boot:

  • Boot a BSP from an SD card
  • When eMMC already contains a bootloader (this is the case by default), you could boot Linux by NFS or initramfs.
  • Through initramfs launched with STM32CubeProgrammer through the USB OTG connection (method not validated yet on STM32MP2)

Then you can update the eMMC from the network, either by launching a command from HOST or from TARGET.

Update TF-A BL2 on eMMC "boot" areas

  • Launching a command from HOST:

host:~$ scp /srv/tftp/tf-a-stm32mp257f-phyflex-fpsc-g-som-optee-emmc.stm32 [email protected]:/tmp

# Allow mmcblk1boot0 and mmcblk1boot1 access
host:~$ ssh [email protected] "echo 0 > /sys/class/block/mmcblk1boot0/force_ro"
host:~$ ssh [email protected] "echo 0 > /sys/class/block/mmcblk1boot1/force_ro"
 
# <send_ack>=1 to enable the boot acknowledge bit in the eMMC ext_csd register and the eMMC boot configuration is 1 wire configuration and 25 MHz: 
host:~$ ssh [email protected] "mmc bootbus set single_backward x1 x1 /dev/mmcblk1"

#  update TF-A in boot0
host:~$  ssh [email protected] "dd if=/tmp/tf-a-stm32mp257f-phyflex-fpsc-g-som-optee-emmc.stm32 of=/dev/mmcblk1boot0 conv=fdatasync"

# update TF-A in boot1 (only required for fail-safe update)
host:~$  ssh [email protected] "dd if=/tmp/tf-a-stm32mp257f-phyflex-fpsc-g-som-optee-emmc.stm32 of=/dev/mmcblk1boot1 conv=fdatasync"

# Select boot0 as boot partition
host:~$  ssh [email protected] "mmc bootpart enable 1 1 /dev/mmcblk1"
  • Launching a command from TARGET:
target$ scp <HOST_USER>@192.168.3.10:/srv/tftp/tf-a-stm32mp257f-phyflex-fpsc-g-som-optee-emmc.stm32 /tmp

# Allow mmcblk1boot0 and mmcblk1boot1 access
target$ echo 0 > /sys/class/block/mmcblk1boot0/force_ro
target$ echo 0 > /sys/class/block/mmcblk1boot1/force_ro

# <send_ack>=1 to enable the boot acknowledge bit in the eMMC ext_csd register and the eMMC boot configuration is 1 wire configuration and 25 MHz:
target$ mmc bootbus set single_backward x1 x1 /dev/mmcblk1

#  update TF-A in boot0
target$ dd if=/tmp/tf-a-stm32mp257f-phyflex-fpsc-g-som-optee-emmc.stm32 of=/dev/mmcblk1boot0 conv=fdatasync

# update TF-A in boot1 (only required for fail-safe update)
target$ dd if=/tmp/tf-a-stm32mp257f-phyflex-fpsc-g-som-optee-emmc.stm32 of=/dev/mmcblk1boot1 conv=fdatasync

# Select mmcblk1boot0 as boot partition
target$ mmc bootpart enable 1 1 /dev/mmcblk1

Update the eMMC "user" area

  • Launching command from HOST:
    • With *.wic.xz: 
host:~$ scp /srv/tftp/st-image-weston-openstlinux-weston-stm32mp25x-phyflex-libra-rdk-3.rootfs.wic.xz [email protected]:/tmp && ssh [email protected] "xzcat /tmp/st-image-weston-openstlinux-weston-stm32mp25x-phyflex-libra-rdk-3.rootfs.wic.xz | sudo dd of=/dev/mmcblk1 bs=1M conv=fsync status=progress"
    • With *.wic: 
host:~$ scp /srv/tftp/st-image-weston-openstlinux-weston-stm32mp25x-phyflex-libra-rdk-3.rootfs.wic [email protected]:/tmp && ssh [email protected] "dd if=/tmp/st-image-weston-openstlinux-weston-stm32mp25x-phyflex-libra-rdk-3.rootfs.wic of=/dev/mmcblk1 bs=1M conv=fsync status=progress"
  • Launching command from TARGET:
    • With *.wic.xz: 
target:~$ scp <HOST_USER>@192.168.3.10:/srv/tftp/st-image-weston-openstlinux-weston-stm32mp25x-phyflex-libra-rdk-3.rootfs.wic.xz /tmp && xzcat /tmp/st-image-weston-openstlinux-weston-stm32mp25x-phyflex-libra-rdk-3.rootfs.wic.xz | sudo dd of=/dev/mmcblk1 bs=1M conv=fsync status=progress
    • With *.wic: 
target:~$ scp <HOST_USER>@192.168.3.10:/srv/tftp/st-image-weston-openstlinux-weston-stm32mp25x-phyflex-libra-rdk-3.rootfs.wic /tmp && dd if=/tmp/st-image-weston-openstlinux-weston-stm32mp25x-phyflex-libra-rdk-3.rootfs.wic of=/dev/mmcblk1 bs=1M conv=fsync status=progress

Fix the eMMC GPT partition table and extend the last partition

As opposed to the STM32CubeProgrammer tool (or PHYTEC partup tool), the last GPT partition will not be automatically extended to the end of the disk after flashing a WIC file. Also, the GPT backup table will not be located at the end of the disk, so the following GPT errors will be displayed at boot (but without any consequence):

[    1.671219] GPT:Primary header thinks Alt. header is not at the end of the disk.
[    1.673163] GPT:2355233 != 15273599
[    1.676607] GPT:Alternate GPT header not at the end of the disk.
[    1.682700] GPT:2355233 != 15273599
[    1.686165] GPT: Use GNU Parted to correct GPT errors.

Expand the last partition size to the end of the eMMC disk

To fix this, follow the following procedure. It can only be done from a booted Linux, so when programming from U-boot, this must be performed at first boot. Otherwise, when programming directly on Linux, it can be done before the first eMMC boot.

Fix GPT Header (Move backup table to the end of disk) 

target:~$ sgdisk -e /dev/mmcblk1
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
target:~$ partprobe /dev/mmcblk1 # Refresh kernel partition view after sgdisk

Expand last partition size to the end of the eMMC disk

target:~$ PART_NUM=$(sfdisk -l /dev/mmcblk1 | grep "^/dev/mmcblk1" | wc -l) # Get last partition number
target:~$ echo ", +" | sfdisk -N "$PART_NUM" /dev/mmcblk1 --no-reread        # We use --no-reread to avoid "Device Busy" errors if disk is mounted
Disk /dev/mmcblk1: 7.28 GiB, 7820083200 bytes, 15273600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 00000000-0000-0000-0000-00004D9B9EF0

Old situation:

Device           Start     End Sectors  Size Type
/dev/mmcblk1p1    1024    9215    8192    4M Linux reserved
/dev/mmcblk1p2    9216   10239    1024  512K Linux reserved
/dev/mmcblk1p3   10240  141311  131072   64M Linux filesystem
/dev/mmcblk1p4  141312  239615   98304   48M Linux filesystem
/dev/mmcblk1p5  239616 2093055 1853440  905M Linux filesystem
/dev/mmcblk1p6 2093056 2355199  262144  128M Linux filesystem

/dev/mmcblk1p6: 
New situation:
Disklabel type: gpt
Disk identifier: 00000000-0000-0000-0000-00004D9B9EF0

Device           Start      End  Sectors  Size Type
/dev/mmcblk1p1    1024     9215     8192    4M Linux reserved
/dev/mmcblk1p2    9216    10239     1024  512K Linux reserved
/dev/mmcblk1p3   10240   141311   131072   64M Linux filesystem
/dev/mmcblk1p4  141312   239615    98304   48M Linux filesystem
/dev/mmcblk1p5  239616  2093055  1853440  905M Linux filesystem
/dev/mmcblk1p6 2093056 15273566 13180511  6.3G Linux filesystem

The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or partx(8).
Syncing disks.

target:~$ partprobe /dev/mmcblk1                                            # Refresh kernel partition view after sfdisk

When expanding the last partition before the first boot, the filesystem of the last partition will automatically be extended at first boot (thanks to the resize-helper ST script launched by systemd at the first Linux boot only).

But when flashing the WIC file from U-boot, the first Linux boot is done just after, so in this case, resize-helper must be launched manually after expanding the partition:

target:~$ resize-helper 
[ 1759.290688] RESIZE-HELPER START
[ 1759.374683] RESIZE-HELPER: Using systemd-growfs
[ 1759.398110] EXT4-fs (mmcblk1p5): resizing filesystem from 231680 to 231680 blocks
Successfully resized "/" to 905.0M bytes.
[ 1759.420943] EXT4-fs (mmcblk1p3): resizing filesystem from 65536 to 65536 blocks
Successfully resized "/boot" to 64.0M bytes.
[ 1759.443394] EXT4-fs (mmcblk1p4): resizing filesystem from 49152 to 49152 blocks
Successfully resized "/vendor" to 48.0M bytes.
[ 1759.467704] EXT4-fs (mmcblk1p6): resizing filesystem from 131072 to 6590255 blocks
[ 1762.779599] EXT4-fs (mmcblk1p6): resized filesystem to 6590255
Successfully resized "/usr/local/" to 6.2G bytes (512 bytes lost due to blocksize).
[ 1763.349572] Filesystem      Size  Used Avail Use% Mounted on
[ 1763.349572] devtmpfs        815M     0  815M   0% /dev
[ 1763.349572] /dev/mmcblk1p5  859M  614M  184M  77% /
[ 1763.349572] tmpfs           885M     0  885M   0% /dev/shm
[ 1763.349572] tmpfs           354M  9.4M  345M   3% /run
[ 1763.349572] tmpfs           885M  8.0K  885M   1% /tmp
[ 1763.349572] /dev/mmcblk1p3   55M   20M   32M  39% /boot
[ 1763.349572] /dev/mmcblk1p4   40M   27M   10M  73% /vendor
[ 1763.349572] /dev/mmcblk1p6  5.9G   41M  5.6G   1% /usr/local
[ 1763.349572] tmpfs           885M   20K  885M   1% /var/volatile
[ 1763.349572] tmpfs           177M  8.0K  177M   1% /run/user/1000
[ 1763.349572] tmpfs           177M  4.0K  177M   1% /run/user/0
[ 1763.411779] RESIZE-HELPER FINISH

Here, we can see that the partition filesystem (/dev/mmcblk1p6) size is expanded to the end of the disk (5.9GB after launching the resize-helper script, instead of 115MB initially).

Create an SD Card Image (with PC Host SD Card Reader)

When booting from an SD card, another possibility (apart from using STM32CubeProgrammer) is to create an SD Card image that contains all BSP binary files in correctly preformatted partitions. This can be done from a .wic file or .raw file.

Please refer to the Yocto OpenSTLinux Manual to learn how to create an SD card.

System Booting

The phyFLEX-STM32MP2 can boot from the following devices:

  • eMMC
  • UART / USB (for USB DFU programming)
  • SD-Card

And optionally from the following other memory types (not tested):

  • serial NOR (QSPI/OCTOSPI)
  • serial NAND (QSPI/OCTOSPI)
  • parallel NAND (FMC)
  • HyperFlash (OCTOSPI)

The boot source is chosen by setting the S1 DIP switch.

Booting from SD Card

Booting from the SD Card is useful in several situations (for example, when the bootloader in Flash memory has crashed).

To boot from the SD card, set the S1 DIP switch as follows:

S1 DIP Switch SD-card Boot (for Libra Version 1618.2)

S1 DIP Switch SD-card Boot (for Libra Version 1618.3)

There are two ways to create a bootable SD card (refer to Programming the Target). You can either use:

  • Use a single prebuilt SD card image
  • Use STM32MPCubeprogrammer to flash the SD card from a target

Booting from eMMC Flash

  • First, you have to follow the procedure to flash the eMMC: Programming the Target
  • After flashing, power off the board. Then set the S1 DIP switch to the correct positions:

S1 DIP Switch eMMC Boot (for Libra Version 1618.2)

S1 DIP Switch eMMC Boot (for Libra Version 1618.3)
  • When powering the board again, the system will boot from eMMC.

Booting from QSPI NOR Flash (populated on Libra board)

  • First, you have to follow the procedure to flash the QSPI NOR and eMMC: Programming the Target
  • After flashing, power off the board. Then set the S1 DIP switch to the correct positions:

S1 DIP Switch QSPI NOR Boot (for Libra Version 1618.2)

S1 DIP Switch QSPI NOR Boot (for Libra Version 1618.3)
  • When powering the board again, the system will boot from QSPI NOR.

Booting using Cortex M33

The phyFLEX-STM32MP2 can boot from the ARM Cortex-M33 co-processor ("M33-TD flavor" specific BSP image should be used - refer to our Coprocessor OpenSTLinux Manual for details of this mode). 

Booting M33 from SD-Card 

To boot from the SD card, set the S1 DIP switch as follows: 

S1 DIP Switch SD-card M33 Boot (for Libra Version 1618.2)

S1 DIP Switch SD-card M33 Boot (for Libra Version 1618.3)

Booting M33 from eMMC

To boot from the eMMC, set the S1 DIP switch as follows: 

S1 DIP Switch eMMC M33 Boot (for libra Version 1618.2)

S1 DIP Switch eMMC M33 Boot (for libra Version 1618.3)

Accessing Peripherals (in Linux userspace)

The following sections provide an overview of the supported hardware components and their operating system drivers on the STM32 platform.

UARTs (tty)

The STM32MP2 SoC provides up to 5 x UART, 4 x USART, and 1 x LPUART. phyFLEX-STM32MP2x FPSC-Gamma and carrier board are configured by default with 3 UARTs:

phyboard-segin-stm32mp15x Generated Files

FPSC interfaceSTM32MP25 interfaceLinux DeviceFunction on Libra Carrier BoardRTS/CTS
UART1USART6/dev/ttySTM2

UART available either on:

  • RS232/RS485 (X27)
  • Bluetooth on M2 Key-E (X52)
yes
UART2UART5/dev/ttySTM1

UART available either on:

  • USB debug (X14) - 2nd FTDI serial port
  • JP1
yes
UART3USART2/dev/ttySTM0

UART available either on:

  • USB debug (X14) - 1st FTDI serial port (Linux Terminal)
  • JP1
no


UART/RS232

Below are some Linux userspace commands to test the UART/RS232 on the target:

  • Configuration of the SM32MP2 UART5 interface can be done with stty. For example:
target$ stty -F /dev/ttySTM1 115200 crtscts raw -echo
  • Sending a message on STM32MP2 UART5:
target$ echo "test" > /dev/ttySTM1
  • Receiving a message on STM32MP2 UART5:
target$ cat /dev/ttySTM1
  • Be sure that the baud rate is set correctly on the host and target. To get the currently configured baud rate, you can use the command stty on the target.

Command to get tty help:

target$ tty --help

RS485

RS485 is available at the X27 connector (through FPSC UART1) when the S5 dip switch is ON (UART1_RS232_485_SEL "low"). Otherwise, if the S5 dip switch is OFF, the interface is RS232.

Tip

Remember to use bus termination resistors of 120 ohms at each end of the bus when using longer cables.

For easy testing, look at the linux-serial-test tool. This tool is called the IOCTL for RS485 and sends a constant stream of data.

target$ linux-serial-test -p /dev/ttySTM2 -b 115200 --rs485 0

More information about the linux-serial-test tool and its parameters can be found here: linux-serial-test

The linux-serial-test will automatically set ioctls, but they can also be set manually with the rs485conf tool.

You can show the current config with:

target$ rs485conf /dev/ttySTM2

You can show all options with:

target$ rs485conf /dev/ttySTM2 -h

Documentation for calling the IOCTL within C code is described in the Linux kernel documentation: https://www.kernel.org/doc/Documentation/serial/serial-rs485.txt

RS485 half-duplex

For half-duplex mode, your connection setup should look like this:

../../../_images/RS485_halfduplex_connection1.png

Half-Duplex Mode Configuration

Which function is on which pin is described in the hardware manual.

For half-duplex mode, you can set the ioctls manually like this:

target$ rs485conf /dev/ttySTM2 -e 1 -r 0
target$ rs485conf /dev/ttySTM2
= Current configuration:
RS485 enabled:                true
RTS on send:                  high
RTS after send:               low
RTS delay before send:        0
RTS delay after send:         0
Receive during sending data:  false
Bus termination enabled:  false

 Then you can test if sending and receiving work, like this:

On target1:
target1$ cat /dev/ttySTM2

On target2:
target2$ echo test > /dev/ttySTM2

You should see “test” printed out on target1. You can also switch the roles and send to target2 and receive on target1.

Alternatively, you can also test with the linux-serial-test tool:

On target1:
target1$ linux-serial-test -s -e -f -p /dev/ttySTM2 -b 115200 --rs485 0 -t -i 8
...
/dev/ttySTM2: count for this session: rx=57330, tx=0, rx err=0

On target2:
target2$ linux-serial-test -s -e -f -p /dev/ttySTM2 -b 115200 --rs485 0 -r -o 5
...
/dev/ttySTM2: count for this session: rx=0, tx=57330, rx err=0

In this example, "target1" will be the receiver and "target2" will be the transmitter. You should also be able to switch the roles. Remember to first start the receiver and then the transmitter immediately after. The receiver will receive for 8 sec, and the transmitter will send for 5 sec. The receiver needs to receive for a bit longer than the transmitter sends. At the end of the program, the final “count for this session”. There you can check that all transmitted frames were received.

All the tests are target-to-target, but can also be done with host-to-target with a USB to RS485 converter. You may need to adjust the interfaces then.

FD CAN Bus

For an overview of the Linux Controller Area Network (CAN) framework, please refer to https://wiki.st.com/stm32mpu/wiki/CAN_overview

PhyFLEX-STM32MP2x FPSC-Gamma and carrier board provide 3 FD CAN buses:

FPSC interfaceSTM32MP25 interfaceLinux device
CAN1FDCAN1can0
CAN2FDCAN2can1
CAN3FDCAN3can2
3 Controller Area Networks

Below are some examples of how to send or receive data on a SocketCAN interface using the can-utils package with the cansend and candump commands:

Prerequisite: At least two nodes are required to communicate on a CAN network.

  • Initialize CAN0 Link with 1Mbit/s:
target$ ip link set can0 up type can bitrate 1000000
  • The command below allows you to get details on the created link:
target$ ip -details link show can0
4: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
    link/can  promiscuity 0 allmulti 0 minmtu 0 maxmtu 0 
    can state STOPPED (berr-counter tx 0 rx 0) restart-ms 0 
          m_can: tseg1 2..256 tseg2 2..128 sjw 1..128 brp 1..512 brp_inc 1
          m_can: dtseg1 1..32 dtseg2 1..16 dsjw 1..16 dbrp 1..32 dbrp_inc 1
          clock 100000000 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536 gso_ipv4_max_size 65536 gro_ipv4_max_size 65536 parentbus platform parentdev 402d0000.can 

  • To send a single frame, use the cansend utility (cansend <device> <can_frame>):
target$ cansend can0 123#1122334455667788                                                                                                                                                   
  • To receive CAN messages, use the candump utility:
target$ candump can0                                                                                                                                                     
  can0  123   [8]  00 11 22 33 44 55 66 77
  can0  123   [8]  00 11 22 33 44 55 66 77
  • To print help on the candump utility, use: "candump -h."

Network

Two Gigabit Ethernet ports are provided by our SOM and carrier board:

Ethernet  Interface

Linux Device

Function on the Libra Carrier board

X25

end0

First Ethernet connection from the PHY populated on the SOM

Default network configuration = static IP 192.168.3.11

X22end1

Second Ethernet connection from the PHY populated on the SBC

Default network configuration = DHCP

Ethernet Configuration

The interfaces offer a standard Linux network port that can be programmed using theBSD socket interface. The BSP contains different Network tools that allow for the configuration and testing of the Ethernet connections.

For information about these different tools and how to use them, please refer tohttps://wiki.st.com/stm32mpu/wiki/Network_tools

Example of how to assign a given IP address to an Ethernet end0 interface:

ifconfig end0 10.48.1.324

Create an SSH Connection with USB Dual Role or Ethernet

When the target is running on Linux, you can create an SSH connection with Ethernet or USB Dual Role (Ethernet over USB gadget is enabled by default).

To create an SSH connection over Ethernet, proceed as follows: 

  • Plug an Ethernet cable between the carrier board (X25 or X22) and the PC Host.
    • end0 will have a default IP address of 192.168.3.11
    • end1 is configured as DHCP, so you first need to configure it with a fixed IP address (ex: ifconfig en1 192.168.3.12)
  • Configure your host PC Ethernet (for example, 192.168.3.10).
target$ ifconfig 
end0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.163.3.11  netmask 255.255.255.0  broadcast 192.163.3.255
        ether ee:6a:ec:ab:d9:e5  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 56  base 0x8000  

end1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 8a:a7:3a:00:43:da  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 59
  • Connect to the target (to create a new remote terminal through SSH):
host:~$ ssh [email protected]
  • You can also copy any file from the host to the target with the following command:
host:~$ scp ~/myFile [email protected]:/home/root

To create an SSH connection over USB Dual role (USB1 on X18), you can proceed the same way. In this case, the target IP address of this interface is by default 192.168.7.1:

target$ ifconfig 
usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.7.1  netmask 255.255.255.0  broadcast 192.168.7.255
        inet6 fe80::438:b1ff:fe80:3010  prefixlen 64  scopeid 0x20<link>
        ether 06:38:b1:80:30:10  txqueuelen 1000  (Ethernet)
        RX packets 36  bytes 5226 (5.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 32  bytes 7900 (7.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Audio

On the PEB-AV-10, we use the TI TLV320AIC3007 audio codec. Audio support is done via the SAI2 interface and controlled via I2C.

  • To check if your sound card driver is loaded correctly and to check which audio output device is available:
target$ aplay -L
  • You will get output similar toː
null
    Discard all samples (playback) or generate zero samples (capture)
samplerate
    Rate Converter Plugin Using Samplerate Library
speexrate
    Rate Converter Plugin Using Speex Resampler
oss
    Open Sound System
pipewire
    PipeWire Sound Server
speex
    Plugin using Speex DSP (resample, agc, denoise, echo, dereverb)
upmix
    Plugin for channel upmix (4,6,8)
vdownmix
    Plugin for channel downmix (stereo) with a simple spacialization
default
    Default ALSA Output (currently PipeWire Media Server)
sysdefault:CARD=PHYFLEXLIBRA
    PHYFLEX-LIBRA, 402a0004.audio-controller-tlv320aic3x-hifi tlv320aic3x-hifi-0
    Default Audio Device
usbstream:CARD=PHYFLEXLIBRA
    PHYFLEX-LIBRA
    USB Stream Output
  • To test Audio Playback:
target$ aplay /usr/share/sounds/alsa/Front_Center.wav
  • You may have to select the audio device:
target$ aplay -D plughw:PHYFLEXLIBRA /usr/share/sounds/alsa/Front_Center.wav
  • Run speaker-test to identify channel numbers (Left, Right...). For example, to check the right and left channels (2 channels):
target$ speaker-test -c 2 -t wav
  • You may have to select the audio device:
target$ speaker-test -c 2 -t wav -D plughw:PHYFLEXLIBRA
  • To inspect your sound card capabilities, call:
target$ alsamixer -c PHYFLEXLIBRA

You should see a lot of options, as the audio-ICs have many features you can play with. It might be better to open alsamixer via SSH (see Create an SSH Connection with USB OTG or Ethernet) instead of the serial console, as the console graphical effects are better.

SD/MMC card

The STM32MP2 supports a slot for Secure Digital Cards to be used as general-purpose block devices. These devices can be used in the same way as any other block device.

Warning

These kinds of devices are hot-pluggable. Nevertheless, you must ensure not to unplug the device while it is still mounted. This may result in data loss!

After inserting an SD/MMC card, the kernel will generate new device nodes in /dev. The full device can be reached via its /dev/mmcblk0 device node. SD/MMC card partitions will show up in the following way:

/dev/mmcblk0p<Y>

<Y> counts as the partition number starting from 1 to the max count of partitions on this device. The partitions can be formatted with any kind of file system and also handled in a standard manner, e.g., the mount and umount commands work as expected.

Tip

These partition device nodes will only be available if the card contains a valid partition table (”hard disk” like handling). If no partition table is present, the whole device can be used as a file system (”floppy” like handling). In this case, /dev/mmcblk1 must be used for formatting and mounting. The cards are always mounted as writable.

eMMC Devices

PHYTEC modules like phyFLEX-STM32MP2x FPSC-Gamma are populated with an e.MMC memory chip as the main storage. e.MMC devices contain raw Multi-Level Cells (MLC) or Triple-Level Cells (TLC) combined with a memory controller that handles ECC and wear leveling. They are connected via an SD/MMC interface to the STM32MP2 and are represented as block devices in the Linux kernel, like SD cards, flash drives, or hard disks.

The electrical and protocol specifications are provided by JEDEC (https://www.jedec.org/standards-documents/technology-focus-areas/flash-memory-ssds-ufs-emmc/e-mmc). The eMMC manufacturer’s datasheet is relatively short and meant to be read together with the supported version of the JEDEC eMMC standard.

PHYTEC currently utilizes the e.MMC chips with JEDEC Version 5.0 and 5.1.

GPIOs

The phyFLEX-STM32MP2 Libra carrier board has a set of pins specifically dedicated to user I/Os. 36 GPIOs come from the GPIO expander; the others are connected directly to the STM32MP2 balls. On the FPSC pinout, there are 7 free GPIOs. But note that the default state of the STM32MP2 I/O pins is GPIOs if not muxed as an alternate function. Accessing GPIOs from userspace can be done using libgpiod.

Note

On Linux, the default BSP (for the Libra board), FPSC GPIO3 (PG15), and FPSC GPIO4 (PI6) are not usable, as they are used as an interrupt by the gpio expander driver. 

To see how to access the GPIOs, please refer to https://wiki.st.com/stm32mpu/wiki/How_to_control_a_GPIO_in_userspace 

Examples:

  • List all lines of specified gpiochips, their names, consumers, and their settings: 
target$ gpioinfo
gpiochip0 - 16 lines:
       line   0:      "PA0"       unused   input  active-high 
       line   1:      "PA1"       unused   input  active-high
       ...
  • Read the values of the specified GPIO lines (not valid if the line is already requested). The line will then be configured as input.
target$ gpioget PB9  --> to get value of GPIO PB9
"PB9"=active
  • Set the values of the specified GPIO lines, potentially keeping the lines exported, and wait until timeout, user input or signal (not valid if the line is already requested).
target$ gpioset PB9=0                --> get GPIO PB9 and set it low
Ctrl + C
target$ gpioset PB9=1                --> get GPIO PB9 and set it high
Ctrl + C


Warning

Most CPU I/O pins are used for special functions (pin-muxed as alternate functions). Before using a user I/O, refer to the schematic or the hardware manual of your board to ensure that it is not already in use.

LEDs

If any LEDs are connected to GPIOs, you can access them via a special LED driver (gpio-leds) interface instead of the general GPIO interface (section GPIOs). You will then access them using /sys/class/leds/. The maximum brightness of the LEDs can be read from the max_brightness file. The brightness file will set the brightness of the LED (taking a value from 0 up to max_brightness). Most LEDs do not have hardware brightness support and, therefore, will just be turned on by all non-zero brightness settings.

Here is a simple example:

  • To get all LEDs available, type:
target$ ls /sys/class/leds
pca963x:blue/   pca963x:green/  pca963x:red/

Here, the LEDs are the three possible colors from an RGB LED driven by a dimmer present on the phyFLEX-STM32MP2 Libra. By default, the RGB LED is off. But this RGB LED can also be used as a "user LED".

led-1 is for the red color, led-2 for green, and led-3 for blue.

  • Example to make the RGB color bright blue:
target$ cd /sys/class/leds
target$ echo 10 > pca963x:blue/brightness
  • Example to turn the RGB LED Blue color OFF:
target$ echo 0 > pca963x:blue/brightness

I2C Bus

The STM32MP2 SoC provides up to 9 I²C FM (Fast-Mode). The phyFLEX-STM32MP2x FPSC Gamma is configured with the following five Fast-Mode I²C modules:

FPSC interfaceSTM32MP2 interfaceLinux deviceFunction on the SOM / Libra Board
I2C1I2C7Not accessible (secure only)Reserved for the PMIC I²C device on the SOM.
I2C2I2C2/dev/i2c-0Used by the carrier board (by plenty of devices).
I2C3I2C8/dev/i2c-2Used by the carrier board (by plenty of devices).
I2C4

I2C4

Not usedReserved for the carrier board (used by SFP+ X113, not mounted for Libra STM32MP2).
I2C5

I2C1

/dev/i2c-1Reserved for the carrier board (used by P3T1750DPZ Temperature sensor).
I2C Modules


Warning

By default, in the BSP configuration, I2C7 of the phyFLEX-STM32MP2 SOM is secure and not accessible through Linux (used for the PMIC device managed by the OP-TEE software secure component).

EEPROM

EEPROM on phyFLEX-STM32MP2x and on Libra RDK board

The system features three I2C EEPROM devices distributed across the SoM and Libra carrier board:

On the phyFLEX-STM32MP2x FPSC SoM:

  • SoM Detection EEPROM

    • Bus: I2C-3 FPSC

    • Address: 0x50

    • Purpose: Reserved Factory configuration for board identification

And on the Libra FPSC carrier board:

  • Carrier Board Detection EEPROM

    • Bus: I2C-2 FPSC

    • Address: 0x51

    • Purpose: Reserved for carrier board identification

  • User EEPROM

    • Bus: I2C-2 FPSC

    • Address: 0x52

    • Purpose: Available for user applications

It is possible to read and write directly to the device:

/sys/class/i2c-dev/i2c-1/device/1-0051/eeprom => Carrier board Detection EEPROM
/sys/class/i2c-dev/i2c-1/device/1-0052/eeprom => User EEPROM (on carrier board)
/sys/class/i2c-dev/i2c-2/device/2-0050/eeprom => SoM Detection EEPROM
  • To read and print the first 100 bytes of the User EEPROM as a hex number, execute:
target$ dd if=/sys/class/i2c-dev/i2c-1/device/1-0052/eeprom bs=1 count=100  | od -x
  • To fill the whole User EEPROM (2Kbit) with zeros, use:
target$ dd if=/dev/zero of=/sys/class/i2c-dev/i2c-1/device/1-0052/eeprom bs=256 count=

Warning

The first 256 bytes of the normal EEPROM area (bus: I2C-2 addr: 0x50) are reserved and should not be overwritten! (See below)

EEPROM SoM Detection

PHYTEC uses the first 256 bytes in the EEPROM normal area to store information about the SoM. This includes RAM size, SoC version, PCB revision, and mounting options.

The EEPROM data is read at a really early stage during startup. It is used to select the correct SoM configuration (like RAM size). This makes it possible to use the same bootloader image for different SoM configurations.

If the first 256 bytes of the normal area are deleted, the bootloader will fall back to the phyFLEX-STM32MP27F Kit setup (2GiB x32bit RAM).

Warning

Data in the first 256 bytes of the normal EEPROM area (bus: I2C-2 addr: 0x50) shouldn’t be erased or corrupted! This might influence the behavior of the bootloader. The board might not boot correctly anymore.

RTC

The STM32MP25 internal RTC is available.

RTCs can be accessed via /dev/rtc*. 

  • Check the available RTCs:
target$ ls /sys/class/rtc
target$ rtc0 rtc1

Tip

This will list all RTCs, including the non-I²C RTCs. Linux assigns RTC device IDs based on the device tree aliases entries, if present.

  • To find the name of the RTC devices, you can read their sysfs entry with:
target$ cat /sys/class/rtc/rtc*/name
rtc-rv3028 2-0052
stm32_rtc 46000000.rtc
RTC Device Names

RTC DevicesNameDescription
/dev/rtc0
rtc-rv3028 2-0052
External RTC RV-3028 (on the SOM). It is the Default RTC used by the Linux Timing System.
/dev/rtc1

stm32_rtc 46000000.rtc

Internal RTC of the CPU

As time is set according to the value of rtc0 during system boot, rtc0 should always be the RTC that is being backed up. 

  • Date and time can be manipulated with the date command and the hwclock tool. Example to set the date on /dev/rtc0:
target$ date 0711101425
Fri Jul 11 10:14:00 UTC 2025
target$ hwclock -w


Tip

As the VBACKUP pin of the external RTC component RV-3028 (on the SOM) is connected to a Gold Cap (on the carrier board), the date and time stored in the RTC are kept even if the board is switched off. (The "Backup Switchover Mode" of the RV-3028 RTC needs to be correctly set. Refer to the RTC parameters section.)

RTC Parameters

RTCs have a few abilities that can be read/set with the help of hwclock tool.

  • We can check RTC-supported features with:

target$ hwclock --param-get features
The RTC parameter 0x0 is set to 0x70.

What this value means is encoded in the kernel; each set bit translates to:

#define RTC_FEATURE_ALARM               0
#define RTC_FEATURE_ALARM_RES_MINUTE    1
#define RTC_FEATURE_NEED_WEEK_DAY       2
#define RTC_FEATURE_ALARM_RES_2S        3
#define RTC_FEATURE_UPDATE_INTERRUPT    4
#define RTC_FEATURE_CORRECTION          5
#define RTC_FEATURE_BACKUP_SWITCH_MODE  6
#define RTC_FEATURE_ALARM_WAKEUP_ONLY   7
#define RTC_FEATURE_CNT                 8
  • We can check RTC BSM (Backup Switchover Mode) with:
target$ hwclock --param-get bsm
The RTC parameter 0x2 is set to 0x1.

What BSM values mean translates to these values:

#define RTC_BSM_DISABLED   0
#define RTC_BSM_DIRECT     1
#define RTC_BSM_LEVEL      2
#define RTC_BSM_STANDBY    3

So, here, the BSM value is "RTC_BSM_DIRECT", meaning that the RTC is currently in "Direct Switching Mode".

  • We can set RTC BSM to "RTC_BSM_LEVEL" ("Level Switching Mode") with:
target$ hwclock --param-set bsm=0x2
The RTC parameter 0x2 will be set to 0x2.

Tip

You should set BSM mode to DSM or LSM for the RTC to switch to a backup power source when the initial power source is not available. Check the RV-3028 RTC datasheet to read what LSM (Level Switching Mode) and DSM (Direct Switching Mode) actually mean.

SPI Bus

The STM32MP2 SoC provides up to 8 SPI interfaces and 2 OSPI. The phyFLEX-STM32MP2 is configured with 3 SPI and 1 QSPI.

By default, when no device is connected to SPI, the Linux SPI driver used in the BSP is spidev.

SPI Driver

FPSC interfaceSTM32MP2 interfaceLinux DeviceFunction on the Libra board

SPI1

SPI3

/sys/bus/spi/devices/spi2.0ADC chip (MCP3208-BI/SL)

SPI2

SPI8

/sys/bus/spi/devices/spi3.0TPM chip (SLB 9670)

SPI3

SPI2

/sys/bus/spi/devices/spi1.0

not used - managed by the spidev kernel driver by default (/dev/spidev1.0)

QSPI

QSPI1

/sys/bus/spi/devices/spi0.0

QSPI NOR (MT25QU512ABB8E12)

Displays

Display currently supported: AC209 10" USB capacitive LCD screen - 1280x800 pixels (ph128800t006-zhc01).

This display can be connected through different interfaces of the Libra board:

  • LVDS1 on X43/X44 connectors 
  • LVDS2 with PEB-AV-10 PHYTEC addon connected on Audio/Video connectors X46/X50
  • MIPI DSI with PEB-AV-12 PHYTEC add-on connected on X39

By default, the PHYTEC BSP is configured for the AC209 on the LVDS1 interface.

Switching between those 3 different configurations is explained in phyFLEX-STM32MP2x and phyFLEX-Libra RDK Device Tree

Note

Equivalent ETML1010Gx displays are supported in the BSP. But those displays are now replaced by AC209 (ph128800t006-zhc01).

USB Host 2.0 and USB 2.0/3.2 Dual Role

Both USB Host and Dual Role use the same framework.

To learn about the Linux USB framework and how to use it, please refer to the USB framework: https://wiki.st.com/stm32mpu/wiki/USB_overview

FPSC interfaceSTM32MP2 interfaceLinux DeviceFunction on the Libra board

USB1

USB1(USB3DR)


USB 2.0/3.2 Dual-role is available on X18 (USB)

(USB 2.0 dual-role only on standard KIT)

USB2

USB2 (USBH)


USB HOST 2.0 on USB 2xType A (X16)
USB Devices

For more software details about the USB3DR (USB3 Dual Role) internal peripheral, please refer to https://wiki.st.com/stm32mpu/wiki/USB3DR_internal_peripheral

For more software details about the USBH internal peripheral, please refer to https://wiki.st.com/stm32mpu/wiki/USBH_internal_peripheral

Watchdog

The STM32MP2 includes several watchdog circuits called "IWDG" (Independent Watchdog) that can reset the board when the system hangs (due to software or hardware failures).

Two independent watchdogs (IWDG1 and IWDG2) are dedicated to MPU:

  • IWDG1 can be allocated to the Cortex-A secure, which can export it to non-secure through SMC.
  • IWDG2 can be allocated to the Cortex-A non-secure. In this configuration, the secure monitor (from OP-TEE or TF-A) is able to receive IWDG early interrupts that can be used to save some logs before reset.

The STM32MP25x also includes 3 other watchdogs (IWDG3, IWDG4, IWDG5), but these are allocated to the Cortex M33 or M0+.

How to enable the IWDG2 and configure its timeout value

The IWDG2 watchdog is enabled by default in the stm32mp2xx-phyflex-fpsc-g-som.dtsi kernel device tree with a custom timeout value in seconds (timeout-sec):

&arm_wdt {
	timeout-sec = <32>;
	status = "okay";
};

By default, the Watchdog Timer Linux framework support and the IWDG support are activated in the Linux kernel. This configuration can be changed through the Menuconfig tool:

Device Drivers --->
[*] Watchdog Timer Support --->
[*] Disable watchdog shutdown on close
[*] Update boot-enabled watchdog until userspace takes over
<*> ARM Secure Monitor Call based watchdog support
<*> STM32 Independent WatchDoG (IWDG) support

With the option  "Update boot-enabled watchdog until userspace takes over" (enabled by default), the kernel will ping the watchdog as long as an application opens the /dev/watchdog file (used by systemd).

How to use the watchdog in Linux using systemd

systemd can use the Hardware watchdog to check for system hangs (when the system is running or during reboot). This feature is enabled by default, with the RuntimeWatchdogSec= option in the file system.conf in /lib/systemd/system.conf.d/00-systemd-conf.conf :

RuntimeWatchdogSec=30s ShutdownWatchdogSec=10min

When RuntimeWatchdogSec is not set or equal to 0, the Watchdog is not used. Setting this option to a different value allows you to use it.

RuntimeWatchdogSec defines the timeout value of the watchdog, while ShutdownWatchdogSec defines the timeout when the system is rebooted. For more detailed information about hardware watchdogs under systemd, refer to http://0pointer.de/blog/projects/watchdog.html.

To get more information on the IWDG internal peripheral, please refer to:

https://wiki.st.com/stm32mpu/wiki/IWDG_internal_peripheral

https://wiki.st.com/stm32mpu/wiki/IWDG_device_tree_configuration

To get more information on the IWDG Linux Kernel support and how to use and trace/debug the WDT framework, please refer to:

https://wiki.st.com/stm32mpu/wiki/Watchdog_overview

Device Tree (DT)

STM32MP2 BSP Device Tree Concept

All device tree documentation can be found under:

host:~/PHYTEC_STM32MP13x_BSP/build/tmp-glibc/work-shared/<MACHINE>/kernel-source/Documentation/devicetree/bindings

An introduction to the device tree usage can be found in the Linux kernel: Documentation/devicetree/usage-model.rst. The device tree files are used during boot time by the Trusted Firmware (TF-A), the Bootloader (U-Boot),the secure monitor (OP-TEE), and the Linux kernel.

STM32MP documentation about the STM32MP2x Device Tree can be found at:

As shown in the STM32MP2x device tree documentation, the device tree organization depends on whether you are using the standard STM device tree structure or the device tree generated by the STM32CubeMX tool. We recommend using the standard STM device tree structure to conform to the upstream kernel. In this BSP customization chapter, we are presenting the standard STM device tree organization.

Note that in this STM documentation, the concept is exactly the same for the phyFLEX-STM32MP2x boards, but with those two main differences: 

  • Device tree files of our boards contain "phyflex-fpsc-g-som" or "phyflex-libra-rdk".
  • The main Device Tree source file (.dts) of our boards doesn't have the same name between the bootloaders (TF-A, U-boot), OP-TEE, and the kernel.

Refer to the following section for the phyFLEX and Libra carrier board device tree file organization: phyFLEX-STM32MP2x and phyFLEX-Libra RDK Device Tree

Device tree source files:

.dts: The device tree source (DTS) that can be processed by DTC (Device Tree Compiler) into a binary device tree called "device tree blob" (.dtb). This device tree blob can be parsed by the embedded software components: LinuxKernel, U-Boot, and TF-A.

For each SOM version (MACHINE), it is assigned a .dts file (one for TF-A, one for U-Boot, and one for Linux).

.dtsi: Source files that can be included from a DTS file.

For example, in the Linux kernel, our stm32mp257f-phyflex-libra-rdk.dts DTS files include stm32mp257.dtsi, stm32mp25xf.dtsi, stm32mp25xx-phyflex-fpsc-g-som.dtsi and stm32mp257f-phyflex-libra-rdk-pinctrl.dtsi.

STM32MP2 Pin Muxing

The STM32MP2 SoC contains many peripheral interfaces. To reduce package size and lower overall system cost while maintaining maximum functionality, many of the STM32MP2 terminals can multiplex up to 16 signal functions. The STM32MP2 BSP is based on the pin controller Linux kernel framework (pinctrl) with a specific pinctrl-stm32 driver. The configuration is performed in the device tree source (DTS).

Please refer to the ST documentation to learn about pinctrl and how to configure it in the device tree:

phyFLEX-STM32MP2x and phyFLEX-Libra RDK Device Tree (applicable for A35-TD flavor)

Note

The Device Tree description below is applicable to the "A35-TD flavor" mode (boot from Cortex-A35). For device tree details on the "M33-TD flavor" mode, please refer to our Coprocessor OpenSTLinux Manual.

As seen in the previous section, the DTS of the stm32mp2xx-phyflex-libra-rdk-x machines contains the specific SoC dtsi files. In addition to those .dtsi files, other dtsi filesare included to specify the board hardware specifics, which are split into two boards: the SOM and the Baseboard (one dtsi per board): 

  • SOM:  stm32mp2-phyflex-fpsc-g-som.dtsi => contains the Hardware specificities common to all the phyFLEX-STM32MP2x SOM declinations (or Yocto machines)
  • Baseboard:stm32mp257f-phyflex-libra-rdk.dts  => contains the Hardware configuration of the phyFLEX-Libra RDK.

Info

The hardware differences between the different phyFLEX-STM32MP2x SoM configs are set in the .dts files. This is done by including different DDR configuration dtsi files (TF-A only), and enabling/disabling SoC optional features (like GPU/NPU, Ethernet, CAN, ...) or SOM configuration (like USB3.2 vs PCIe, or other optional external devices).

SOM and Baseboard .dtsi include other .dtsi files (for pin control, for example).

Below is the complete list of our PHYTEC custom DTS files (.dts & .dtsi) for the phyFLEX-STM32MP2x SOM andphyFLEX-Libra RDK used by each software component (Linux Kernel, U-Boot, OP- TEE, and TF-A).

To know how to modify those sources and rebuild the BSP image, refer to the next sections.

Sources

DTS files path

DTS file name (.dts)phyFLEX-STM32MP2x files
Libra RDK files

peripheral configuration

pin controlMemory mapping configurationClock Tree configurationRIFperipheral configuration

Linux

Kernel

arch/arm64/boot/dts/st/

stm32mp257f-phyflex-libra-rdk.dts

stm32mp235c-phyflex-libra-rdk.dts

stm32mp2-phyflex-fpsc-g-som.dtsi

stm32mp2-phyflex-fpsc-g-som-pinctrl.dtsi

stm32mp257f-phyflex-ca35tdcid-resmem.dtsi

stm32mp235c-phyflex-ca35tdcid-resmem.dtsi

 NoneNone

stm32mp257f-phyflex-libra-rdk.dts

stm32mp235c-phyflex-libra-rdk.dts

U-Boot


arch/arm/dts



stm32mp257f-phyflex-fpsc-g-som.dts

stm32mp235c-phyflex-fpsc-g-som.dts


 

stm32mp2-phyflex-fpsc-g-som.dtsi

Copied from kernel + adding the following interfaces from Libra kernel dtsi:

  • UART console debug
  • USB 2.0 dual role
  • SD-card

stm32mp2-phyflex-fpsc-g-som-pinctrl.dtsi

Partially copied from kernel pinctrl dtsi file


 

stm32mp257f-phyflex-ca35tdcid-resmem.dtsi

stm32mp235c-phyflex-ca35tdcid-resmem.dtsi

 None

None

None



U-Boot add-on files:

stm32mp257f-phyflex-fpsc-g-som-u-boot.dtsi

stm32mp235c-phyflex-fpsc-g-som-u-boot.dtsi

stm32mp2-phyflex-fpsc-g-som-u-boot.dtsi

OP-TEE

core/arch/arm/dts

stm32mp235c-phyflex-fpsc-g-som.dts

Partially copied from kernel + adding regulator, low power, clock, and secure configs:

stm32mp2-phyflex-fpsc-g-som.dtsi

stm32mp25-pinctrl.dtsi


stm32mp257f-phyflex-fpsc-g-som-resmem.dtsi

stm32mp235c-phyflex-fpsc-g-som-resmem.dtsi

stm32mp257f-phyflex-fpsc-g-som-rcc.dtsi

stm32mp235c-phyflex-fpsc-g-som-rcc.dtsi

stm32mp257f-phyflex-fpsc-g-som-rif.dtsi

stm32mp235c-phyflex-fpsc-g-som-rif.dtsi

 

None


TF-A


fdts

stm32mp257f-phyflex-fpsc-g-som.dts

stm32mp235c-phyflex-fpsc-g-som.dts


Partially copied from kernel + adding clock tree config:

stm32mp2-phyflex-fpsc-g-som.dtsi

stm32mp2-phyflex-fpsc-g-som-pinctrl.dtsi

Partially copied from kernel pinctrl dtsi file



 None

 stm32mp2-phyflex-fpsc-g-som-ca35tdcid-rcc.dtsi

None

None



TF-A firmware configuration file: 

stm32mp257f-phyflex-fpsc-g-som-fw-config.dts

stm32mp235c-phyflex-fpsc-g-som-fw-config.dts

stm32mp2-phyflex-fpsc-g-som-ca35tdcid-fw-config.dtsi

PHYTEC Custom DTS Files

Have a look at this page for more information about the  STM32MP2 system firewall configuration RIF, which is configurable by OP-TEE Device Tree.

tip

When customizing the BSP, the device tree (DT) can also be automatically generated thanks to the STM32CubeMX tool. Note that this is a partial device tree, as some manual code needs to be added. But the generated "pinctrl" device tree node can be reused (no manual code needed in this node).

For further information about the pin muxing tool, refer to STM32CubeMX.

phyFLEX-Libra RDK Device Tree Overlay

phyFLEX-Libra-rdk add-ons (expansions, phyCAM, etc.), or specific connector configurations are managed by Device Tree Overlay(DTO).

DTOs are device tree blob fragments that allow specific parts of a Kernel device tree to be overridden on-the-fly, before booting the Kernel. This allows you to make small changes without defining a new complete device tree or modifying the original one.

The phyFLEX-Libra-rdk DTO defines the necessary Kernel device tree adaptation for the specific add-ons/connectors config. One or more DTOs can be applied by U-Boot over the machine device tree (DTB) before booting the kernel. 

phyFLEX-Libra-rdk DTO source files (.dtso) are stored separately from the other kernel device tree source files, in a subdirectory called "overlays": arch/arm64/boot/dts/st/overlays/

Like classic device tree, the Device Tree Overlay sources are processed by DTC (Device Tree Compiler), but into a binary with a .dtbo extension.

With the U-boot FIT Image feature, the dtbo are included inside the fitImage binary (which contains the kernel and .dtb).

By default, the .dtbo are also stored on the target under: /boot/ (although having them stored here is not neccessary are they are already include in the FIT Image).

List of phyFLEX-Libra RDK Device Tree Overlays

Device Tree Overlay Name

Description

stm32mp2-phyflex-libra-rdk-ksp-0221-bluetooth-uart.dtbo

KSP-0221 expansion board for Bluetooth

stm32mp2-phyflex-libra-rdk-ksp-0221-wlan-sdio.dtbo

KSP-0021 expansion board for Wifi

stm32mp2-phyflex-libra-rdk-lvds-etml1010g3dra.dtbo

Overlay for screen etml1010g3dra

stm32mp2-phyflex-libra-rdk-lvds-ph128800t006-zhc01.dtbo

Overlay for screen ph128800t006-zhc01

stm32mp2-phyflex-libra-rdk-m33-examples.dtboOverlay for M33 copro examples

stm32mp2-phyflex-libra-rdk-peb-av-10-etml1010g3dra.dtbo

PEB-AV-10 expansion board for AC200 LVDS display (etml1010g3dra) and sound

stm32mp2-phyflex-libra-rdk-peb-av-10-ph128800t006-zhc01.dtbo

PEB-AV-10 expansion board for AC209 LVDS display (ph128800t006-zhc01) and sound

stm32mp2-phyflex-libra-rdk-peb-av-12-etml1010g3dra.dtbo

PEB-AV-12 expansion board MIPI to LVDS for AC200 display (etml1010g3dra)

stm32mp2-phyflex-libra-rdk-peb-av-12-ph128800t006-zhc01.dtbo

PEB-AV-12 expansion board MIPI to LVDS for AC209 display (ph128800t006-zhc01)

stm32mp2-phyflex-libra-rdk-vm016-csi1.dtbo

phyCAM-M VM-016 B&W or COL

phyFLEX-Libra RDK Device Tree Overlays

How to Apply the Device Tree Overlay

The board must be booted and accessible through a remote console. Device tree overlays can be applied either from u-boot or from userspace:

Applying DTO from userspace

  • Edit the /boot/overlays.txt file

target$ vi /boot/overlays.txt

This file specifies the DT overlays to apply with the following syntax:

overlays=conf-aa#conf-bb#conf-cc#conf-dd

- aa, bb, cc, dd correspond to a device tree name file (with .dtbo extension)

Edit the file to enable/disable any DTBO

tip

You will need to use the following basic vi commands:

<Inser> or <i> => to enter Edit mode

Esc => to escape Edit mode

:wq =>save the modifications and quit the file

:q! => quit the file without saving

Example: content of /boot/overlays.txt for applying and  "stm32mp2-phyflex-libra-rdk-lvds-ph128800t006-zhc01.dtbo" and "stm32mp2-phyflex-libra-rdk-vm016-csi1.dtbo":

overlays=conf-stm32mp2-phyflex-libra-rdk-lvds-ph128800t006-zhc01.dtbo#conf-stm32mp2-phyflex-libra-rdk-vm016-csi1.dtbo
  • Force filesystem sync:
target$ sync
  • Reboot the board:
target$ reboot

Applying DTO from U-Boot

Device tree overlays to apply can also be set on U-Boot with the following commands:

STM32MP> setenv overlays 'conf-aa#conf-bb#cc'
STM32MP> saveenv

With aa, bb, cc, dd corresponding to a device tree name file (with .dtbo extension):

If you want to modify an existing overlays variable, you can use the following command:

STM32MP> editenv overlays

Once you have saved the u-boot environments with "saveenv", you can continue the normal boot with the u-boot command "boot".

Note

This method will create the "overlays" u-boot env variable, and in this case, the content of /boot/overlays.txt will be ignored.

To use the overlays.txt file instead, remove the "overlays" env var with the following u-boot command: setenv overlays

Modifying the Device Tree

Modifying the device tree is a mandatory step when customizing the BSP for a custom carrier board. It is possible to do that using the OpenSTLinux Yocto build environment.

Please refer to our Yocto OpenSTLinux Manual.

OpenSTLinux Yocto SDK

When a Yocto distribution has been modified and validated on target, it is pertinent to build a new Software Development Kit that integrates the modifications and redistributes this SDK to developers.

The procedure to build, install, and use the SDK is described in our Yocto OpenSTLinux Manual.

How to Use the Cortex-M33 and Cortex-M0 MCU

Please refer to the Coprocessor OpenSTLinux Manual.