2025-07-02 6:08 AM
Hi
We have a project that will use STM32MP257F on a custom hardware design.
I have a STM32MP257F-EV1 board which I intend to use for early development.
Our customer has a very strict boot time requirement so we want to use the Cortex M33 as the first boot processor and TF-M master
We want to boot the Cortex A35 processors and leave them in a standby or low power state as the first application does not need them.
In the STM32ubeMP2 package I found STM32CubeMP2/Projects/STM32MP257F-EV1/Demonstrations/StarterApp_M33TD
which according to its README file, does almost exactly what I want. However I am having difficulty building it according to the instructions in the README file.
Here's what I did
I created a new workspace at the top level of my Linux shell
mkdir workspace2
cd workspace2
I downloaded the STM32CubeMP2 package from GitHub and checked its tags. Output is below
git clone https://github.com/STMicroelectronics/STM32CubeMP2
Cloning into 'STM32CubeMP2'...
remote: Enumerating objects: 14087, done.
remote: Counting objects: 100% (217/217), done.
remote: Compressing objects: 100% (33/33), done.
remote: Total 14087 (delta 190), reused 197 (delta 181), pack-reused 13870 (from 1)
Receiving objects: 100% (14087/14087), 105.47 MiB | 18.78 MiB/s, done.
Resolving deltas: 100% (8199/8199), done.
Updating files: 100% (5451/5451), done.
git log --tags --simplify-by-decoration --pretty="format:%ci %d"
2025-06-25 13:43:09 +0530 (HEAD -> main, tag: v1.2.0, origin/main, origin/HEAD)
2024-11-28 13:08:32 +0530 (tag: v1.1.1)
2024-11-19 14:34:43 +0530 (tag: v1.1.0)
2024-06-20 14:43:45 +0530 (tag: v1.0.0)
I then went into the Middlewares/Third-Party directory and downloaded the STM trusted firmware package
git clone https://github.com/STMicroelectronics/trusted-firmware-m.git
Cloning into 'trusted-firmware-m'...
remote: Enumerating objects: 95817, done.
remote: Counting objects: 100% (28990/28990), done.
remote: Compressing objects: 100% (9185/9185), done.
remote: Total 95817 (delta 19645), reused 27697 (delta 18895), pack-reused 66827 (from 1)
Receiving objects: 100% (95817/95817), 44.25 MiB | 17.68 MiB/s, done.
Resolving deltas: 100% (65506/65506), done.
Updating files: 100% (4459/4459), done.
I then tried following the README build instructions.
First step seems to be to configure TF-M and BL2 for the target
cd ~/workspace2/Middlewares/Third_Party/trusted-firmware-m
cmake -B config_default -G"Unix Makefiles" -DTFM_PLATFORM=stm/stm32mp257f_ev1 -DTFM_TOOLCHAIN_FILE=toolchain_GNUARM.cmake -DTFM_PROFILE=profile_medium -DCMAKE_BUILD_TYPE=Relwithdebinfo -DNS=OFF -DSTM32_M33TDCID=ON -DDTS_EXT_DIR="~/workspace2/STM32CubeMP2/Utilities/dt-stm32mp/" -DDTS_BOARD_BL2=stm32mp2/m33-td/mcuboot/stm32mp257f-ev1-cm33tdcid-ostl-sdcard-bl2.dts -DDTS_BOARD_S=stm32mp2/m33-td/tfm/stm32mp257f-ev1-cm33tdcid-ostl-sdcard-s.dts -DDTS_BOARD_NS=stm32mp2/m33-td/tfm/stm32mp257f-ev1-cm33tdcid-ostl-sdcard-ns.dts
This seems to complete OK. I logged the console output to a file which I have attached (cmake_log.txt)
I then try to build it
make -C config_default/ install
But this step fails with errors (log make_log.txt is also attached), one or two examples are below.
/home/mark.heaps.dev/workspace2/STM32CubeMP2/Middlewares/Third_Party/trusted-firmware-m/platform/ext/target/stm/common/devicetree/include/devicetree.h:200:36: error: 'DT_N_NODELABEL_ddr_fw_primary_partition_REG_IDX_0_VAL_ADDRESS' undeclared here (not in a function)
200 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
/home/mark.heaps.dev/workspace2/STM32CubeMP2/Middlewares/Third_Party/trusted-firmware-m/platform/ext/target/stm/common/devicetree/include/devicetree.h:200:36: error: 'DT_N_NODELABEL_tfm_secondary_partition_REG_IDX_0_VAL_SIZE' undeclared here (not in a function)
200 | #define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
The problem seems to be that some symbols are being used that are not defined. I think that it might be something that isn't configured in the device tree but I'm new to device trees and this is just a guess.
Can someone help please?
2025-07-02 6:52 AM
I should have also pointed out that configuring TF-M as described in
How to configure TF-M - stm32mpu
Using the following works and generates TF-M binaries and elf
git clone --branch v1.7.0-stm32mp25-r9.1 https://github.com/STMicroelectronics/trusted-firmware-m.git
cd trusted-firmware-m
cmake -S . -B build_ca35td -DTFM_PLATFORM=stm/stm32mp257f_ev1 -DTFM_TOOLCHAIN_FILE=toolchain_GNUARM.cmake -DTFM_PROFILE=profile_medium -DCMAKE_BUILD_TYPE=Relwithdebinfo -G "Unix Makefiles" -DNS=OFF
make -C build_ca35td/ install
HOWEVER
The same process fails at the cmake stage when using the latest trusted-firmware-m tag from git
2025-07-02 9:12 AM
Hi @MDH63 ,
Our M33TD offer is not yet Mass Market but in Alpha phase, limited to granted customers with direct support of ST.
I advise you to contact your local ST office or opening a support case in OLS.
Olivier