Coprocessor Yocto Manual - OpenSTLinux STM32MP (L-1097e.A0)

Table of Contents

Coprocessor Yocto Manual - OpenSTLinux STM32MP (L-1097e.A0)
Document TitleCoprocessor Yocto Manual - OpenSTLinux STM32MP (L-1097e.A0)
Document TypeCoprocessor Yocto Manual - OpenSTLinux STM32MP
Article NumberL-1097e.A0
Release Date26.05.2026
Is Branch ofCoprocessor Yocto Manual - OpenSTLinux STM32MP (L-1097e.Ax)

Compatible BSPs

Compatible BSP'SBSP Release TypeBSP Release DateBSP Status
BSP-Yocto-OpenSTLinux-STM32MP2-PD26.1.0Major Release19.05.2026released
BSP-Yocto-OpenSTLinux-STM32MP15x-PD25.1.0Major Release18.07.2025released

Yocto OpenSTLinux

For an introduction to Yocto and OpenSTLinux, refer to our Yocto OpenSTLinux Manual.

Introduction

Most modern system on a chip (SoC) designs include one or more coprocessors in addition to an application processor. Typically, the application processor runs Linux, while the coprocessor runs an RTOS. This manual explains how to efficiently utilize the coprocessor for projects.

It explains generic principles and applies them to a specific platform and tools through examples. It provides an introduction to coprocessor software stacks and RTOS, such as those provided through STM32CubeMP packages.

Internal vs. External Coprocessor

A coprocessor can be internal or external to the application processor's system on a chip (SoC). Both have their advantages and disadvantages. Internal coprocessors have advantages such as simpler firmware update management, more efficient communication between the coprocessor and the application processor, and probably a less expensive PCB design. Advantages of external coprocessors include more interfaces in addition to those of the application processor and direct startup, independent of the application processor.

This manual focuses on internal coprocessors of the STM32MP PHYTEC system on modules (SoMs).

Use Cases

There are several use cases for coprocessors in embedded systems. Almost any time-critical task that the application processor cannot handle can be offloaded to a coprocessor.

The following examples provide a more explicit idea of the possibilities:

Energy Constrained Applications

For energy-constrained applications, reducing the active time of the entire system on a chip (SoC) can help conserve power. In such cases, the application processor can enter sleep mode while the coprocessor remains active. For example, the coprocessor could monitor I2C communication and wake up the application processor when it receives a specific command.

Time-Critical Communication

Some protocols require real-time data transmission. If there is no hardware IP core capable of handling the desired protocol, a coprocessor can support it by building it in software.

Sensors and Real-Time

Some applications, such as an accelerometer, require a sensor to be read in a time-critical manner to detect small value changes in a short time frame. A coprocessor can ensure that the sensor is read at the right time. If the application processor has time to process the data, the data can be buffered and fed to it.

Safety and quick boot

This option is offered by the STM32MP2 SoC family and is called the "M33 Trusted Domain flavor" (M33-TD). Conversely, booting from the Cortex-A35 is called the "A35-TD."

The M33-TD flavor is ideal for the following requirements:

  • Support Cortex-A35 independant reboot
  • Need Safety
  • Need Quick processing while waking up from low power mode
  • Need early services launch
  • Need dual Flash for isolated boot codes

For more details, please refer to this ST article : How_to_choose_the_STM32MP2_boot_flavor

Coprocessors on STM32MP SoC familly

The Arm® Cortex®-M coprocessors and their peripherals are directly inherited from the STM32 MCU family on STM32MP processors. The STM32Cube™ environment, which is typically used for STM32 MCUs, is also used for STM32MP SoCs.

STM32Cube™ offers extensive embedded software libraries and tools that significantly reduce development effort, time, and cost. Thanks to the STM32CubeMPx Firmware Packages, it is fully integrated into the STM32MPU Embedded Software distribution, along with tools such as STM32CubeMX, STM32CubeIDE, and STM32CubeProgrammer.

STM32CubeMP15‎ Package Overview

The STM32CubeMP15 is the embedded software component of the STM32Cube™ platform and runs on the STM32MP15 Arm® Cortex®-M4 processor. Based on the STM32Cube MCU package, it has been adapted to the OpenSTLinux framework.

In our PHYTEC Git repository, the "master" branch is a clone of the STM32CubeMP1 GitHub repository.

We have added additional components for the phyBOARD-Sargas development board specifics in the "x.y.z-phy" branches to provide STM32CubeMP15 examples running on our development board.

The additional components are as follows:

  • Drivers/BSP/STM32MP15xx_phyBOARD-Sargas
  • Projects/STM32MP15-phyBOARD-Sargas
    • Applications
      • OpenAMP/OpenAMP_TTY_echo

      • OpenAMP/OpenAMP_raw
    • Demonstrations
      • AI_Character_Recognition (=> This application can be run using the GTK demo launcher of the Weston image)
    • Examples
      • GPIO/GPIO_EXTI
      • UART/UART_Receive_Transmit_Console
      • ADC/ADC_SingleConversion_Polling
      • ADC/ADC_SingleConversion_TriggerTimer_DMA
    • Templates

The above projects are provided as examples. They were copied from the "Projects/STM32MP157C-DK2" directory, with minor adaptations made for the phyBOARD-Sargas. These projects can be used with the STM32MPCubeIDE development tool.

By default, the projects from the "Applications and Examples" directories are built and deployed on the target within our BSP image. They can be run from the Linux user space. Refer to the next section, "How to run Cortex-M4 examples on target" for more information.

Tip

Other M4 applications, such as CoproSync and FreeRTOS, as well as M4 examples, such as I2C, ADC, Crypto, and Timers, can be found in the Projects/STM32MP157C-DK2 or Projects/STM32MP157C-EV1 folders. These applications and examples can easily be adapted to the phyBOARD-Sargas or a custom board, if needed.

STM32CubeMP2 Package Overview

The STM32CubeMP2 is the embedded software component of the STM32Cube™ platform. It runs on the STM32MP2 Arm® Cortex®-M33 and Arm® Cortex®-M0+ processors.

The PHYTEC Git repository is a clone of the STM32CubeMP1 GitHub repository. We have added additional components for the phyFLEX-STM32MP2x Libra RDK specifics on the "vx.y.z-phy" branches to provide STM32CubeMP2 examples running on our development board.

Those additional components are the following:

  • Drivers/BSP/STM32MP257F-PHYFLEX
  • Projects/STM32MP257F-PHYFLEX
    • Applications
      • OpenAMP/OpenAMP_TTY_echo

      • FreeRTOS/FreeRTOS_ThreadCreation (adaptation to Libra board in progress)
      • FreeRTOS/FreeRTOS_Timers (adaptation to Libra board in progress)
    • Demonstrations
      • CM0PLUS_DEMO (adaptation to Libra board in progress)
      • StarterApp_M33TD
    • Examples
      • GPIO/GPIO_EXTI
    • Templates

The above projects are provided as examples. They were copied from the "Projects/STM32MP257F-DK" folder, with minor adaptations made for the phyFLEX-STM32MP2x Libra board. They can be used with the STM32MPCubeIDE development tool.

By default, the following projects are built and deployed on the target within our BSP image using CMake:

    • Applications/OpenAMP/OpenAMP_TTY_echo

    • Examples/GPIO/GPIO_EXTI

The "Demonstrations/StarterApp_M33TD" project can be built with CMake. It is built by default when using our Yocto machine for the "M33-TD" flavor. Refer to the Cortex M33 Master ("M33-TD flavor").

 They can be run from Linux userspace (refer to next section: Run Cortex-M33 or Cortex-M0 examples on Libra RDK board).

Tip

Additional M33/M0+ examples can be found on STM32MP2x-DK2 or STM32MP2x-EV1 boards and can be easily adapted to the phyFLEX-STM32MP2x Libra board or a custom baseboard, if necessary.

Coprocessor Management with STM32Cube‎MP Firmwares and Linux

The coprocessor system is managed using services that rely on the open-source Linux RemoteProc and RPMsg frameworks.

Overview

For an overview, go to https://wiki.st.com/stm32mpu/wiki/Coprocessor_management_overview.

Ressource manager for STM32MP15x

The STM32MP15x resource manager proposes services to manage common resources and avoid any conflict.

  • Peripheral assignment request: hardware mechanism used to ensure that a peripheral is reserved for a processor usage. The principle is that a firmware requests the peripheral before starting to use it, relying on the  ETZPC table (configured by the OP-TEE secure OS).
    • On Cortex-A: At boot time, the ETZPC and Linux device tree are configured according to the TF-A device tree
    • On Cortex-M: the service is implemented by the Resource manager utilities.

Note that peripherals assigned to theCortex-A nonsecure  context are visible from any context, without any isolation.

  • Remote processor resource configuration set: services available in the Cortex-A, running Linux, to configure the system resources needed to operate the peripheral on the Cortex®M. The service is implemented by rproc_srmdrivers.

More details:

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

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

Ressource manager for STM32MP2

An internal peripheral assignment can be strengthened by a hardware mechanism: the RIF (Resource Isolation Framework) firewall.

At boot time, the RIF configures the system to manage common resources and assign, isolate, or share peripherals.

Coprocessor Management in Linux side (applicable for MP2 and MP15)

Information on the Linux coprocessor management software frameworks, such as mailbox and RPMsg:

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

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

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

Other Coprocessor Management Information (applicable for MP2 and MP15)

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

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

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

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

Getting Started

Starting the Coprocessor via Remoteproc

Run Cortex-M4 Examples on phyBOARD-Sargas 

1. Select boot mode for M4 examples:

When booting the Linux image, select the dedicated device tree configuration for M4 examples. This configuration allows you to allocate specific IP, clock, and pin control assignments related to M4 examples.

Select the boot mode phycore-stm32mp1-x-m4-examples (boot mode number 3) during the U-Boot stage, as described in the following log.

U-Boot 2020.01-stm32mp-r2.1 (Jan 06 2020 - 20:56:31 +0000)

CPU: STM32MP157FAC Rev.Z
Model: Phytec GmbH phycore-stm32mp1-4 Dev Board
Board: stm32mp1 in trusted mode (phycore-stm32mp1-4)
...
...
Found /mmc1_extlinux/phycore-stm32mp1-4_extlinux.conf
Retrieving file: /mmc1_extlinux/phycore-stm32mp1-4_extlinux.conf
851 bytes read in 20 ms (41 KiB/s)
Retrieving file: /splash.bmp
18244 bytes read in 21 ms (847.7 KiB/s)
Select the boot mode
1: OpenSTLinux
2: phycore-stm32mp1-4-a7-examples
3: phycore-stm32mp1-4-m4-examples
Enter choice:
Select the boot mode
1:      OpenSTLinux
2:      phycore-stm32mp1-4-a7-examples
3:      phycore-stm32mp1-4-m4-examples
Enter choice:


Note

The phycore-stm32mp1-x-m4-examples.dts kernel device tree allows you to define the peripherals and pins assigned to the Cortex-M4. This device tree example assigns a number of peripherals and pins to the Cortex-M4 to run the STM32CubeMP1 examples without conflicts with Linux.

2. Select Examples or Applications to Run:

root@phycore-stm32mp1-4:~# cd /usr/local/Cube-M4-examples/STM32MP15-phyBOARD-Sargas
  • For example, use the following command:

cd /usr/local/Cube-M4-examples/STM32MP15-phyBOARD-Sargas/Examples/<example_type>/<example_to_run>

  • For an Application, use the following command:

cd /usr/local/Cube-M4-examples/STM32MP15-phyBOARD-Sargas/Applications/<application_type>/<application_to_run>

In each of those directories, the following files are present:

  • fw_cortex_m4.sh: script to start/stop firmware
  • README: all information about the application/example
  • lib/firmware/<example_or_application_to_run>.elf: Cortex-M4 firmware of the application/example to run

Example with GPIO_EXTI :

root@phycore-stm32mp1-4:/usr/local/Cube-M4-examples/STM32MP15-phyBOARD-Sargas/Examples/GPIO/GPIO_EXTI# ls -l
total 8
-rwxr-xr-x 1 root root 4263 Sep 23  2020 README
-rwxr-xr-x 1 root root 1084 Sep 23  2020 fw_cortex_m4.sh
drwxr-xr-x 3 root root 1024 Sep 23  2020 lib
root@phycore-stm32mp1-4:/usr/local/Cube-M4-examples/STM32MP15-phyBOARD-Sargas/Examples/GPIO/GPIO_EXTI# ls -l lib/firmware/
total 4
-rwxr-xr-x 1 root root 68004 Sep 23 2020 GPIO_EXTI.elf

3. Start the Firmware:

Use the following command to start the selected example:

./fw_cortex_m4.sh start

Example with GPIO_EXTI:

root@phycore-stm32mp1-4:/usr/local/Cube-M4-examples/STM32MP15-phyBOARD-Sargas/Examples/GPIO/GPIO_EXTI# ./fw_cortex_m4.sh start
fw_cortex_m4.sh: fmw_name=GPIO_EXTI.elf
[ 72.909122] remoteproc remoteproc0: powering up m4
[ 72.913032] remoteproc remoteproc0: Booting fw image GPIO_EXTI.elf, size 68004
[ 72.919852] remoteproc remoteproc0: header-less resource table
[ 72.925647] remoteproc remoteproc0: no resource table found for this firmware
[ 72.932696] remoteproc remoteproc0: header-less resource table
[ 73.012111] rproc-srm-core mlahb:m4@10000000:m4_system_resources: bound mlahb:m4@10000000:m4_system_resources:serial@4000f000 (ops 0xc0cfd7e4)
[ 73.038917] rproc-srm-core mlahb:m4@10000000:m4_system_resources: bound mlahb:m4@10000000:m4_system_resources:i2c@40012000 (ops 0xc0cfd7e4)
[ 73.068431] rproc-srm-core mlahb:m4@10000000:m4_system_resources: bound mlahb:m4@10000000:m4_system_resources:dac@40017000 (ops 0xc0cfd7e4)
[ 73.079861] rproc-srm-core mlahb:m4@10000000:m4_system_resources: bound mlahb:m4@10000000:m4_system_resources:timer@44000000 (ops 0xc0cfd7e4)
[ 73.092382] rproc-srm-core mlahb:m4@10000000:m4_system_resources: bound mlahb:m4@10000000:m4_system_resources:spi@44004000 (ops 0xc0cfd7e4)
[ 73.104798] rproc-srm-core mlahb:m4@10000000:m4_system_resources: bound mlahb:m4@10000000:m4_system_resources:dma@48001000 (ops 0xc0cfd7e4)
[ 73.117427] rproc-srm-core mlahb:m4@10000000:m4_system_resources: bound mlahb:m4@10000000:m4_system_resources:adc@48003000 (ops 0xc0cfd7e4)
[ 73.129877] rproc-srm-core mlahb:m4@10000000:m4_system_resources: bound mlahb:m4@10000000:m4_system_resources:hash@4c002000 (ops 0xc0cfd7e4)
[ 73.142468] rproc-srm-core mlahb:m4@10000000:m4_system_resources: bound mlahb:m4@10000000:m4_system_resources:rng@4c003000 (ops 0xc0cfd7e4)
[ 73.154978] rproc-srm-core mlahb:m4@10000000:m4_system_resources: bound mlahb:m4@10000000:m4_system_resources:crc@4c004000 (ops 0xc0cfd7e4)
[ 73.167518] rproc-srm-core mlahb:m4@10000000:m4_system_resources: bound mlahb:m4@10000000:m4_system_resources:cryp@4c005000 (ops 0xc0cfd7e4)
[ 73.180131] rproc-srm-core mlahb:m4@10000000:m4_system_resources: bound mlahb:m4@10000000:m4_system_resources:button (ops 0xc0cfd7e4)
[ 73.192099] rproc-srm-core mlahb:m4@10000000:m4_system_resources: bound mlahb:m4@10000000:m4_system_resources:m4_led (ops 0xc0cfd7e4)
[ 73.204291] remoteproc remoteproc0: remote processor m4 is now up

The effects of this command are:

  • The Remote Processor System Resource Manager (rproc_srm) assigns and configures system resources for peripherals and pins assigned to the Cortex-M4 processor. Peripherals and pins that must be assigned to the Cortex-M4 processor are specified in the Linux device tree.
  • The Linux Remote Processor (remoteproc) loads and starts the M4 firmware.

For the GPIO_EXTI M4 example firmware, pressing the User S5 button on the phyBOARD-Sargas will turn the LED2 (red LED) on or off on the phyCORE-STM32MP15x. Refer to the README file for details.

4. Stop the Firmware:

Use the following command to stop the running example:

./fw_cortex_m4.sh stop

Example:

root@phycore-stm32mp1-4:/usr/local/Cube-M4-examples/STM32MP15-phyBOARD-Sargas/Examples/GPIO/GPIO_EXTI# ./fw_cortex_m4.sh stop
fw_cortex_m4.sh: fmw_name=GPIO_EXTI.elf
[ 4296.915003] remoteproc remoteproc0: warning: remote FW shutdown without ack
[ 4296.920578] remoteproc remoteproc0: stopped remote processor m4

This prevents the firmware from using the Linux Remote Processor (remoteproc) component. It also releases the relevant resource settings used by the example.

Run Cortex-M33 or Cortex-M0 examples on Libra RDK board 

1. Enable device tree overlay for M33 examples:

When booting the Linux image, select the dedicated device tree overlay for the M33 examples (stm32mp2-phyflex-libra-rdk-m33-examples.dtso). This overlay allows deallocation of specific IP, clock, and pin control assignments related to the M33 examples from Linux.

Refer to the phyFLEX-Libra RDK Device Tree Overlay chapter of the BSP Manual for the phyFLEX-STM32MP2x FPSC Rapid Development Kit. This chapter describes the procedure for applying the dedicated Device Tree Overlay.

2. Select Examples or Applications to Run:

  • For M33 examples:
root@stm32mp25x-phyflex-libra-rdk-3~:# cd /usr/local/Cube-M33-examples/STM32MP257F-PHYFLEX/
  • For M0 examples:
root@stm32mp25x-phyflex-libra-rdk-3~:# cd /usr/local/Cube-M0-examples/STM32MP257F-PHYFLEX/
  • For an "Example", use the following command:

cd /usr/local/Cube-M33-examples/Examples/<example_type>/<example_to_run>

  • For an "Application", use the following command:

cd /usr/local/Cube-M33-examples/Applications/<application_type>/<application_to_run>

In each of those directories, the following files are present:

  • fw_cortex_m33.sh: script to start/stop firmware
  • lib/firmware/<example_or_application_to_run>_NonSecure_stripped.elf: Non signed Cortex-M33 firmware of the Non Secure application/example to run
  • lib/firmware/<example_or_application_to_run>_NonSecure_sign.bin: Signed Cortex-M33 firmware of the Non Secure application/example to run. 

Tip

The firmware format required by the remoteproc (.elf for non signed, or .bin for signed) can be checked with following command:

root@stm32mp25x-phyflex-libra-rdk-3:~# cat /sys/class/remoteproc/remoteproc0/fw_format 
ELF

With the default BSP configuration, only unsigned firmware is permitted when the Cortex-M33 processor is managed by Linux. Signed firmware can only be executed when the Cortex-M33 coprocessor is managed by OP-TEE, which is not the case by default. This behavior can be changed by modifying the OP-TEE and Linux device tree (and U-Boot, if necessary).
Refer to Protect the Cortex-M coprocessor firmware

3. Start the Firmware:

Use the following command to start the selected example:

./fw_cortex_m33.sh start

Example with GPIO_EXTI:

root@stm32mp25x-phyflex-libra-rdk-3:/usr/local/Cube-M33-examples/STM32MP257F-PHYFLEX/Examples/GPIO/GPIO_EXTI# ./fw_cortex_m33.sh start
Found matching remoteproc device: remoteproc0
fw_cortex_m33.sh: fmw_name=GPIO_EXTI_CM33_NonSecure_stripped.elf
[  672.538199] remoteproc remoteproc0: powering up m33
[  672.539068] remoteproc remoteproc0: Booting fw image GPIO_EXTI_CM33_NonSecure_stripped.elf, size 25648
[  672.547767] remoteproc remoteproc0: header-less resource table
[  672.552766] remoteproc remoteproc0: no resource table found for this firmware
[  672.560673] remoteproc remoteproc0: header-less resource table
[  672.565761] remoteproc remoteproc0: remote processor m33 is now up

This command loads and starts the M33 firmware on the Linux Remote Processor (remoteproc).

In the case of the GPIO_EXTI M33 example firmware, emulating a push button on GPIO2 FPSC (PG14) by briefly connecting test point TP59 to ground (GND) will result in the LED1 (green LED) on phyFLEX-STM32MP2x being switched on or off.

Following code in "stm32mp2-phyflex-libra-rdk-m33-examples.dtso" device tree overlay is an error as this is not necessary, and PG14 should be exclusively reserved to Cortex-M33 (so not used by kernel device tree). This is not problematic anyway for this example.

	gpio-keys {
		compatible = "gpio-keys";

		/* gpio needs vdd core in retention for wakeup */
		button-1 {
			label = "PG14";
			linux,code = <BTN_1>;
			gpios = <&gpiog 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
			wakeup-source;
		};
	};

4. Stop the Firmware:

Use the following command to stop the example that is running:

./fw_cortex_m33.sh stop

Example:

root@stm32mp25x-phyflex-libra-rdk-3:/usr/local/Cube-M33-examples/STM32MP257F-PHYFLEX/Examples/GPIO/GPIO_EXTI# ./fw_cortex_m33.sh stop
Found matching remoteproc device: remoteproc1
[ 1108.311316] remoteproc remoteproc1: stopped remote processor m33

This stops the firmware using the Linux Remote Processor component (remoteproc). It releases the relevant resource settings used by the example.

Starting the Coprocessor from Bootloader

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

Boot from coprocessor (M33-TD) - STM32MP2 only

We provide an M33-TD-flavor BSP image that can run on the standard phyFLEX-STM32MP25x Libra Kit. The procedure to try it is below.

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

  • Plug the USB cable into the USB debug connector (X14) and your host PC. You should see four new devices appear on your Linux host PC: /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2, and /dev/ttyUSB3.

The Linux terminal (Cortex-A35) will be accessible on /dev/ttyUSB0 and the Cortex-M33 terminal on /dev/ttyUSB1.

  • 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/ttyUSB1 and /dev/ttyUSB0 
host:~$ minicom -D /dev/ttyUSB0
host:~$ minicom -D /dev/ttyUSB1
  • Connect the power supply to the power connector.
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.


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!

The console outputs can be viewed in your terminal windows. If everything was done correctly, you should see:

  • First, the Cortex-M33 boot traces on /dev/ttyUSB1. (MCUboot => TF-M => STM32Cube Firmware):
[INF] Loading gpt header

[INF] welcome to MCUboot: v2.1.0-stm32mp-r1-4-gcf726493f
[INF] cpu: STM32MP257FAK Rev.Y
[INF] board: stm32mp257f phyflex
[INF] dts: stm32mp257f-phyflex-fpsc-g-som-m33-emmc-bl2.dts
[INF] boot device: sdmmc2
[INF] mcu sysclk: 400000000
[INF] Starting bootloader
[INF] ***************************

[INF] Provisioning bypassed, if your OTP are not set.

[INF] Default values will be used.

[INF] DUMMY_PROVISIONING is not suitable for production!

[INF] This device is NOT SECURE

[INF] ***************************

[WRN] This device was provisioned with dummy keys.

[WRN] This device is NOT SECURE

[WRN] NV_MM_COUNTER_INIT is not suitable for production! This device is NOT SECURE 

[INF] Primary   slot: version=0.1.0+0
[INF] Image 1 Secondary slot: Image not found
[INF] Image 1 RAM loading to 0xe060000 is succeeded.
[INF] Image 1 loaded from the primary slot
[INF] BL2: image 1, enable DDR-FW
[INF] Primary   slot: version=2.1.0+0
[INF] Image 0 Secondary slot: Image not found
[INF] Image 0 RAM loading to 0x80000000 is succeeded.
[INF] Image 0 loaded from the primary slot
[INF] Bootloader chainload address offset: 0x180000
[INF] Jumping to the first image slot
[INF] welcome to TF-M: v2.1.0-stm32mp-r1-4-gcf726493f
[INF] board: stm32mp257f phyflex
[INF] dts: stm32mp257f-phyflex-fpsc-g-som-m33-emmc-s.dts
[INF] ***************************
[INF] Provisioning bypassed, if your OTP are not set.
[INF] Default values will be used.
[INF] DUMMY_PROVISIONING is not suitable for production!
[INF] This device is NOT SECURE
[INF] ***************************
[WAR] This device was provisioned with dummy keys.
[WAR] This device is NOT SECURE
[NS] [INF] Non-Secure system starting...
[NS] [INF] STM32Cube FW version: v1.2.0-rc0 
[NS] [RemoteProc] [INF] starting copro cpu@0... done
  • Then, the Cortex-A35 boot traces on /dev/ttyUSB0. Linux login prompt will be shown at the end of the booting process.

STM32CubeIDE Development Tool

STM32CubeIDE can be used for application development purposes on either STM32MP ARM Cortex-A processors or ARM Cortex-M coprocessors.

STM32CubeIDE is an advanced development platform for C and C++ with features such as peripheral configuration, code generation, compilation, and debugging for STM32 microcontrollers and microprocessors. For instructions on how to install and use this tool, please refer to: https://wiki.st.com/stm32mpu/wiki/STM32CubeIDE

How to Create a Cortex-M Project

There are several ways to create an STM32CubeIDE project for Cortex-M application development.

More info: https://wiki.st.com/stm32mpu/wiki/How_to_create_STM32CubeMPU_project_in_STM32CubeIDE

Generate a New Project from a STM32CubeMX Project (.ioc)

This is ideal when you have configured your platform with this tool for pin multiplexing and clock configuration. There are two methods to generate the STM32CubeIDE project in this case.

    • 1st method, use STM32CubeIDE : File → New → STM32 from an Existing STM32CubeMX Configuration File
    • 2nd method, use STM32CubeMX code generator tool to create the STM32CubeIDE project:
      • Open your STM32CubeMX project with The STM32CubeMX tool
      • Project Manager → Project → Toolchain / IDE: must be set to STM32CubeIDE
      • Generate Code => thiswill create a STM32CubeIDE project with some code (HAL/Middleware code for Cortex-M /Device Tree for Cortex-A) corresponding to your CubeMX project configuration
      • The newly generated project can be opened in STM32CubeIDE: File →  New → Open Projects from File System..

Using the Template Project Provided in the STM32CubeMP15 or STM32CubeMP2 Package

A template of the STM32CubeIDE projectfor Cortex-M4 is provided in the STM32CubeMP15 packageunder Projects/STM32MP15-phyBOARD-Sargas/Templates (refer to STM32CubeMP1 Overview).

A template of the STM32CubeIDE projectfor Cortex-M33 is provided in the STM32CubeMP2 packageunder Projects/STM32MP257F-PHYFLEX/Templates/ (refer to STM32CubeMP2 Overview).

You can directly create your project using this template:

    • File →  New → Open Projects from File System.

From an Existing SW4STM32 IDE Project

Please refer to the following page:https://wiki.st.com/stm32mpu/wiki/How_to_move_from_SW4STM32_to_STM32CubeIDE

Specific Tool Configuration

Use External JTAG

Since the PHYTEC boards do not have an STLINK serial link/debug feature, you must use an external STLINK JTAG (STLINK/V2 or STLINK-V3SET) or a SEGGER J-LINK JTAG connected to the JTAG connector to debug the Cortex-M application. This is not necessary for the Linux application.

Configure the MPU Serial Device

Since the PHYTEC boards have an FDTI USB/serial device, the "MPU serial device" parameter in the tool must be modified as follows on a Linux computer:

  • Connect your phyBOARD serial console to your computer
  • Open the Preferences menu: Window => Preferences
  • In the "Preferences" menu, open the submenu STM32Cube/MPU Serial
  • Configure the MPU serial as below ("/dev/ttyUSB0" should be in the Preferred device list):
MPU Serial Box

image2020-8-7_11-24-24.png

Cortex-M4 Production and Developer Modes (only on STM32MP15)

Two modes can be used to debug Arm® Cortex®-M firmware on the STM32 MPU device: "Developer mode" (also known as "Enigeering mode" ) or "Production mode".

Production Mode

Production debug mode is similar to the final product. To use Production mode, the board must be booted using the "classic" procedure. The boot modes are SD CARD, eMMC, NOR, and NAND for Linux booting.

In this mode, Linux must already be booted and running on the Cortex-A7. The Cortex-M4 firmware is loaded via an SSH connection (through Ethernet or USB OTG) and started with the remoteproc service running on the Cortex-A7.

Engineering/Developer Mode

To use Engineering Mode, the board must be booted in a specific way called "Engineering Boot Mode." In this mode, only the Cortex-M starts up, and the firmware loads into its dedicated RAM via JTAG/SWD.

Warning

Initialization is usually performed in the Cortex-A7 (clock tree setup, etc.). This process must be handled by the Arm Cortex-M4.

Tip

Debugging in engineering mode with an STM32 MPU device is very similar to debugging a standard STM32 MCU, except that the Arm Cortex-M4 in the MPU has dedicated memory but no flash memory.

Before powering or resetting the phyBOARD-Sargas, set the S7 DIP switch as follows to enter Engineering mode:

S7 DIP Switch

How to Debug a Cortex-M Application

Engineering Mode (only on STM32MP15)

  • To use this mode, first check that:
    • Your board is correctly connected to the host PC with the JTAG (ST-LINK or SEGGER J-LINK)
    • The boot mode is set correctly on your board to Engineering mode (with S7 DIP switch on phyBOARD-Sargas)
    • The application to debug contains some code that configures the system clock (the examples/applications given in the STM32CubeMP1 contain this code, so you can use it as a reference).
  • To start debugging:
    • In the left Project Explorer section, click on your Project and launch the Debug Configurationmenu with Run → Debug as → STM32 C/C++ Application
    • In the Debug Configuration menu, go to the Debugger tab, select the option through the JTGA/SWD link (Engineering mode)
    • If you are using an ST-LINK, you do not have to change any other options
    • Click on Debug

Debug configuration setting for Engineering mode:

Engineering Mode Debug Configuration

Production Mode (for both STM32MP2 or STM32MP15)

  • To use this mode, first check that:
    • Your board is correctly connected to the host PC with:
      • a JTAG (ST-LINK or SEGGER J-LINK)
      • a Network connection: USB OTG (Ethernet point to point) or Ethernet (IP address attributed by a DHCP server or to be manually configured)
      • a Serial Link (to access the Linux remote console).
    • Your board is powered on, and Linux is booted and running

Tip

With the phyBOARD-Sargas, to create the network connection, the easiest way is to use the USB OTG (connector X12) as it is already configured with a fixed IP address 192.168.7.1 (see Create an SSH Connection with USB OTG or Ethernet)

  • To start debugging:
    • In the left Project Explorer section, click on your Project and launch the Debug Configurationmenu with Run → Debug as → STM32 C/C++ Application
    • In the Debug Configuration menu, go to the Debugger tab, and keep the default option, which is: through Linux Core (Production mode)
    • In the Connection section, select the Serial Port (ex, MPU Serial (/dev/ttyUSB0)) and the Ethernet address of your target (ex, 192.168.7.1)
    • Click on Debug

Debug configuration setting for production mode:

Production Mode Debug Configuration

At debug launch, the following pop-up will appear:

  • A message requesting the SSH Password => User ID = "root" / no password (you can check the box "save the password", so it will not be asked again)
  • A warning message: The RSA key has to be approved => click on "Yes."
  • A progress bar that informs about the firmware loading progress into the target
  • a message "Confirm Perspective switch" => click on "Switch" (you can check "remember my decision, so it will not be asked again)

When debug mode is ready, the following logs will appear in red in the console, with some information from the debugger:

Debug Logs

Below are the 3 steps that are done to enter the Debug session in Production mode:

1. The firmware-built binary is transferred to the target through the network link (SSH protocol). It is copied in the Cortex-A Linux file system.

2. The firmware is loaded to the Cortex-M core thanks to the “remoteproc” framework.

3. The Debug session is started via JTAG/SWD connection.

Basic commands to debug an application:

  • Set breakpoints to desired lines → Make sure that the "Skip all breakpoints" button is not active 
  • Start the program and debugging with the "Resume" button 
  • Stop the debug session with the "Terminate" button 

Additional Information

Official STM32CubeMP15_Package Getting_started

https://wiki.st.com/stm32mpu/wiki/STM32CubeMP15_Package_-_Getting_started

Official STM32CubeMP2_Package Getting_started

https://wiki.st.com/stm32mpu/wiki/STM32CubeMP2_Package_-_Getting_started

How to structure the software to develop STM32CubeMP15 examples

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


Cortex-M33 Master ("M33-TD flavor")

As mentioned earlier, the Cortex-M33 can be used as a coprocessor when the Cortex-A35 is the master ("A35-TD flavor"). However, the Cortex-M33 can also be the master and use the Cortex-A35 as the coprocessor. This is referred to as the "M33-TD flavor."

We provide stm32mp25x-phyflex-libra-rdk-x-m33td.conf Yocto machines for this configuration:

  • stm32mp25x-phyflex-libra-rdk-3-m33td.confcorresponds to the stm32mp25x-phyflex-libra-rdk-3.conf machine but configured for M33-TD flavor (instead of A35-TD).
  • stm32mp25x-phyflex-libra-rdk-4-m33td.conf is the same but for SOM equipped with 4GB of RAM (insteaf of 2GB).

This Yocto machines allow to build a system for M33-TD flavor based on the following components:

  • MCUboot for secure boot and firmware update.
  • Trusted Firmware-M (TF-M)for secure services on the secure side ("CM33-S").
  • A nonsecure FreeRTOS application on "CM33-NS" acting as an application manager and supervising the high-performance Arm®Cortex®-A35 processor. It is a bare-minimum application that uses the common stack located under "Utilities/M33TD_NSAppCore" of the STM32CubeMP2 project.

Refer to this page (from wiki ST) for more information.

Information

We only provide the Non Secured application StarterAppM33TD as example.

Additionally Generated Yocto BSP Binaries

The generated BSP Binaries description is identical to the one contains in the Yocto OpenSTLinux Manual ("Building the BSP"). But the addtional following binaries are genarted for the M33-TD flavor mode:

Binary subfolder locationBinary file nameDescription

arm-trusted-firmware-m-cube

tfm-starterapp-stm32mp257f-phyflex-fpsc-g-som-m33td-emmc-emmc_s_ns.bin

TF-M Secure/NonSecure combined binary (not signed) - eMMC boot version

 




For more details on TF-M, please refer to:

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

tfm-starterapp-stm32mp257f-phyflex-fpsc-g-som-m33td-emmc-emmc_s_ns_signed.binSigned TF-M Secure/NonSecure combined binary - eMMC boot version
tfm-starterapp-stm32mp257f-phyflex-fpsc-g-som-m33td-sdcard-sdcard_s_ns.binTF-M Secure/NonSecure combined binary (not signed) - SDCARD boot version
tfm-starterapp-stm32mp257f-phyflex-fpsc-g-som-m33td-sdcard-sdcard_s_ns_signed.bin    Signed TF-M Secure/NonSecure combined binary - SDCARD boot version

arm-trusted-firmware-m

bl2-stm32mp257f-phyflex-fpsc-g-som-m33td-emmc.stm32

TF-M BL2 binary - eMMC boot version



For more details on TF-M BL2 (MCUboot), please refer to:

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

bl2-stm32mp257f-phyflex-fpsc-g-som-m33td-sdcard.stm32

TF-M BL2 binary - SDCARD boot version

ddr_phy_signed-stm32mp257f-phyflex-fpsc-g-som-m33td-emmc.bin

Signed DDR firmware binary  - eMMC boot version

ddr_phy_signed-stm32mp257f-phyflex-fpsc-g-som-m33td-sdcard.bin

Signed DDR firmware binary  - SDCARD boot version

MCUboot PHYTEC DTS Files

Device tree

For the M33-TD flavor, we use additional external device tree that not part of the kernel sources (i.e. not from our linux-stm32mp git repository - https://git.phytec.de/linux-stm32mp/).

The external device tree are added throught the external-dt Yocto recipe. The files are fetched from our following repository: https://github.com/phytec/dt-stm32mp

With Yocto, you can modify the device trees with Yocto using:

  • devtool modify external-dt

The recipe provides device trees for trusted-firmware-m, mcuboot, trusted-firmware-a, optee, u-boot and linux. The device trees are available in <external-dt>/stm32mp2/m33-td/.

NOTE: Device tree for phyFLEX-STM32MP257F with 4GB of RAM are currently identify with "-4Gb" in the .dts name.

MCUboot

One DT for the eMMC boot (-emmc) and another one for SDCARD boot (-sdcard). They are composed as follow:

Peripheral (.dts)

Pin control (pinctrl)Memory mapping (resmem)Clock Tree (RCC)Resource isolation Framework (RIF)

stm32mp257f-phyflex-fpsc-g-som(-4Gb)-m33td-emmc-bl2.dts

stm32mp257f-phyflex-fpsc-g-som(-4Gb)-m33td-sdcard-bl2.dts

stm32mp25xx-phyflex-fpsc-g-som-pinctrl.dtsistm32mp257f-phyflex-fpsc-g-som-bl2-resmem.dtsi

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

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

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

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

MCUboot PHYTEC DTS Files

Trusted Firmware-M

One DT for the Secure Processing Environment (SPE) and one DT for the Non Secure Processing Environment (NSPE) . For each, one for the eMMC boot (-emmc) and another one for SDCARD boot (-sdcard). They are composed as follow:

Processing Environment

Peripheral (.dts)

Pin control (pinctrl)Memory mapping (resmem)Clock Tree (RCC)Resource isolation Framework (RIF)System Control and Mangment Interface (SCMI)

Secure Processing Environment (SPE)

stm32mp257f-phyflex-fpsc-som(-4Gb)-emmc-s.dts

stm32mp257f-phyflex-fpsc-som(-4Gb)-scard-s.dts

stm32mp25-pinctrl.dtsi (common ST dtsi)

(same as A35-TD flavor pinctrl dtsi)

stm32mp257f-phyflex-fpsc-g-som-m33td-resmem.dtsistm32mp257f-phyflex-fpsc-g-som-m33td-rcc.dtsi

stm32mp257f-phyflex-fpsc-g-som-m33td-s-rif-ca35-emmc.dtsi

stm32mp257f-phyflex-fpsc-g-som-m33td-s-rif-ca35-sdcard.dtsi

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

stm32mp257f-phyflex-fpsc-g-som-m33td-scmi.dtsi

Non Secure Processing Environment (NSPE)

stm32mp257f-phyflex-fpsc-som(-4Gb)-emmc-ns.dts

stm32mp257f-phyflex-fpsc-som(-4Gb)-sdcard-ns.dts

stm32mp25-pinctrl.dtsi (common ST dtsi)

(same as A35-TD flavor pinctrl dtsi)

stm32mp257f-phyflex-fpsc-g-som-m33td-resmem.dtsistm32mp257f-phyflex-fpsc-g-som-m33td-ns-rcc.dtsinonenone
TF-M PHYTEC DTS Files

Have a look at this page for more information about the  STM32MP2 system firewall configuration RIF which is configurable by TF-M Device Tree (Trusted Firmware-A RIF configuration is similar to OP-TEE's)

Trusted Firmware-A

One DT for the eMMC boot (-emmc) and another one for SDCARD boot (-sdcard). They are composed as follow:

Peripheral (.dts)

Pin control (pinctrl)Clock Tree (RCC)Firmware Config (fw-config)

stm32mp257f-phyflex-fpsc-g-som(-4Gb)-m33td-emmc.dts

stm32mp257f-phyflex-fpsc-g-som(-4Gb)-m33td-sdcard.dts

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

(same as A35-TD flavor pinctrl dtsi)

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

stm32mp257f-phyflex-fpsc-g-som(-4Gb)-m33td-emmc-fw-config.dts

stm32mp257f-phyflex-fpsc-g-som(-4Gb)-m33td-sdcard-fw-config.dts

stm32mp257f-phyflex-fpsc-g-som-m33td-fw-config.dtsi

TF-A PHYTEC DTS Files

NOTE: There are additional programming *-serial-ca35tdcid.dts (and *-serial-a35td-fw-config.dts) DT that are only used for the TF-A programmer binary (for serial downloader).  Those device tree just include the device tree used for A35-TD flavor.

OP-TEE

One DT for the eMMC boot (-emmc) and another one for SDCARD boot (-sdcard). But in both cases, the DT are identical (include a common dts). They are composed as follow:

Peripheral (.dts)

Pin control (pinctrl)Memory mapping (resmem)Clock Tree (RCC)Resource isolation Framework (RIF)

stm32mp257f-phyflex-fpsc-g-som(-4Gb)-m33td-emmc.dts

stm32mp257f-phyflex-fpsc-g-som(-4Gb)-m33td-sdcard.dts

both including: 

stm32mp257f-phyflex-fpsc-g-som(-4Gb)-m33td.dts

stm32mp25-pinctrl.dtsi (common ST dtsi)

(same as A35-TD flavor pinctrl dtsi)

stm32mp257f-phyflex-fpsc-g-som-m33td-resmem.dtsistm32mp257f-phyflex-fpsc-g-som-m33td-rcc.dtsistm32mp257f-phyflex-fpsc-g-som-m33td-rif.dtsi
OP-TEE PHYTEC DTS Files

NOTE: There are additional programming *-serial-ca35tdcid.dts DT that are only used for the FIP programmer binary (for serial downloader).  Those device tree just include the device tree used for A35-TD flavor.

U-boot

One DT for the eMMC boot (-emmc) and another one for SDCARD boot (-sdcard). But in both cases, the DT are identical (include a common dts). They are composed as follow:

Peripheral (.dts)

Pin control (pinctrl)Memory mapping (resmem)U-boot add-ons (-u-boot)

stm32mp257f-phyflex-fpsc-g-som(-4Gb)-m33td-emmc.dts

stm32mp257f-phyflex-fpsc-g-som(-4Gb)-m33td-sdcard.dts

both including: 

stm32mp257f-phyflex-fpsc-g-som(-4Gb)-m33td.dts

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

(same as A35-TD flavor pinctrl dtsi)

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

stm32mp257f-phyflex-fpsc-g-som(-4Gb)-m33td-emmc-u-boot.dtsi

stm32mp257f-phyflex-fpsc-g-som(-4Gb)-m33td-sdcard-u-boot.dtsi


U-boot PHYTEC DTS Files

NOTE: There are additional programming *-serial-ca35tdcid.dts DT that are only used for the FIP programmer binary (for serial downloader).  Those device tree just include the device tree used for A35-TD flavor.

Linux

For linux we provide a device tree based on the A35-TD flavor one. Device Tree is adapted because in this boot flavor, SCMI server is manged by TF-M (instead of OP-TEE) and clock frequency frequency scaling is managed throught TF-A BL31 + TF-M (instead of OP-TEE).

It is composed as follow:

Libra Peripheral (.dts)

SOM peripheralPin control (pinctrl)Memory mapping (resmem)

stm32mp257f-phyflex-libra-rdk-m33td.dts

stm32mp25xx-phyflex-fpsc-g-som-m33td.dtsi

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

(same as A35-TD flavor pinctrl dtsi)

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

Linux PHYTEC DTS Files

How to‎...

Protect the Cortex-M coprocessor firmware

https://wiki.st.com/stm32mpu/wiki/How_to_protect_the_Cortex-M_coprocessor_firmware

How to assign an internal peripheral to an execution context

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

Exchange Large Data Buffers with the Coprocessor - Principle

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

Retrieve Cortex-M4 Logs after Crash

https://wiki.st.com/stm32mpu/wiki/How_to_retrieve_Cortex-M4_logs_after_crash

Migrate STM32CubeMPU examples from A35-TD flavor to M33-TD flavor (applicable for STM32MP2)

https://wiki.st.com/stm32mpu/wiki/How_to_migrate_STM32CubeMPU_examples_from_A35-TD_flavor_to_M33-TD_flavor

How to import, build and debug STM32CubeMP2 StarterAppM33TD demonstration in STM32CubeIDE

https://wiki.st.com/stm32mpu/wiki/How_to_import,_build_and_debug_STM32CubeMP2_StarterAppM33TD_demonstration_in_STM32CubeIDE

Use the Cortex-M0+  (applicable for STM32MP2)

https://wiki.st.com/stm32mpu/wiki/How_to_use_the_Cortex-M0%2B

Revision History

VersionChangesDate
L-1097e.A0

Preliminary Edition

Coprocessor manual was created based on the STM32MP15 Yocto manual L-1060e.A4. Only the Cortex-M4 subject is kept and adapted to cover the new MP25.

26.05.2026

Contact Information