Skip to main content
ADunc.1
Senior
March 15, 2026
Question

Bug/Issue in helper scripts

  • March 15, 2026
  • 0 replies
  • 125 views

Following the tutorial here, when I get to the step "To generate binary to flashing via Cortex-A", the helper script fails to build when given the 'programmer' argument.  The problem appears to be incorrect configuration of the path to a device tree file.  

All other steps in the tutorial build correctly using the device tree files given, just not the programmer step fails.

The output is shown below.  In it you can see the following paths are supplied:

EXTDT_DIR=/home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp2-openstlinux-26.02.18/sources/STM32MP215DK-AshMX
EXTDT_DIR_OPTEE=CA35/DeviceTree/STM32MP215DK-AshMX/optee-os

The correct path to the dts file is ${EXT_DIR}/${EXTDIR_DIR_OPTEE}, but the path actually searched for the dts file is (refer line 58 in the log below):

/home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp2-openstlinux-26.02.18/sources/STM32MP215DK-AshMX/stm32mp2/a35-td/optee/

Full log is:

sdk_compilation-stm32mp2-mx-my-custom-board.sh programmer

Your configuration:
 sdk_absolute_path = /home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/SDK
 sdk_env_file = environment-setup-cortexa35-ostl-linux
 your_board_name = stm32mp215f-stm32mp215dk-ashmx-mx
 your_soc_name = stm32mp21
 your_storage_boot_scheme_security = optee
 your_storage_boot_scheme_cortex_a = optee-sdcard
 your_deploy_dir_path = /home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18/sources/ostl-linux/output-sdk-stm32mp215fdk-ash
 your_build_subdir_path = ../build
 your_cubemx_project_name = STM32MP215DK-AshMX
 externaldt_path = /home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp2-openstlinux-26.02.18/sources/STM32MP215DK-AshMX

**** stm32mp-ddr-phy_set ****START****
[CMD]:> cd stm32mp-ddr-phy-A2022.11-r0
[CMD]:> cd stm32mp-ddr-phy-A2022.11
[CMD]:> cd ..
[CMD]:> export FWDDR_DIR=/home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18/sources/ostl-linux/stm32mp-ddr-phy-A2022.11-r0/stm32mp-ddr-phy-A2022.11
**** stm32mp-ddr-phy_set ****END****
**** external-dt_set ****START****
[CMD]:> cd external-dt-v6.0-stm32mp-r3-r0
[CMD]:> cd external-dt-v6.0-stm32mp-r3
**** external-dt_set ****END****
**** optee-os-stm32mp_set ****START****
[CMD]:> cd optee-os-stm32mp-4.0.0-stm32mp-r3-r0
[CMD]:> cd optee-os-stm32mp-4.0.0-stm32mp-r3
[CMD]:> export FIP_DEPLOYDIR_ROOT=/home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18/sources/ostl-linux/output-sdk-stm32mp215fdk-ash
**** optee-os-stm32mp_set ****END****
**** u-boot-stm32mp_set ****START****
[CMD]:> cd u-boot-stm32mp-v2023.10-stm32mp-r3-r0
[CMD]:> cd u-boot-stm32mp-v2023.10-stm32mp-r3
[CMD]:> export FIP_DEPLOYDIR_ROOT=/home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18/sources/ostl-linux/output-sdk-stm32mp215fdk-ash
**** u-boot-stm32mp_set ****END****
**** tf-a-stm32mp_set ****START****
[CMD]:> cd tf-a-stm32mp-v2.10.24-stm32mp-r3-r0
[CMD]:> cd tf-a-stm32mp-v2.10.24-stm32mp-r3
[CMD]:> export FIP_DEPLOYDIR_ROOT=/home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18/sources/ostl-linux/output-sdk-stm32mp215fdk-ash
**** tf-a-stm32mp_set ****END****
**** linux-stm32mp_set ****START****
[CMD]:> cd linux-stm32mp-6.6.116-stm32mp-r3-r0
[CMD]:> cd linux-6.6.116
[CMD]:> export KERNEL_BUILDDIR=/home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18/sources/ostl-linux/linux-stm32mp-6.6.116-stm32mp-r3-r0/build
**** linux-stm32mp_set ****END****
**** gcnano-driver-stm32mp_set ****START****
**** gcnano-driver-stm32mp_set ****END****
**** stm32mp-ddr-phy_programmer_compile ****START****
**** stm32mp-ddr-phy_programmer_compile ****END****
**** external-dt_programmer_compile ****START****
**** external-dt_programmer_compile ****END****
**** optee-os-stm32mp_programmer_compile ****START****
[CMD]:> cd optee-os-stm32mp-4.0.0-stm32mp-r3-r0
[CMD]:> cd optee-os-stm32mp-4.0.0-stm32mp-r3
[CMD]:> export BLD_PATH=/home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18/sources/ostl-linux/optee-os-stm32mp-4.0.0-stm32mp-r3-r0/build-programmer
[CMD]:> make -f /home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18/sources/ostl-linux/optee-os-stm32mp-4.0.0-stm32mp-r3-r0/optee-os-stm32mp-4.0.0-stm32mp-r3/../Makefile.sdk.stm32mp2 OPTEE_CONFIG=optee-programmer CFG_EMBED_DTB_SOURCE_FILE=stm32mp215f-stm32mp215dk-ashmx-mx DEPLOYDIR=/home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18/sources/ostl-linux/output-sdk-stm32mp215fdk-ash/optee EXTDT_DIR=/home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp2-openstlinux-26.02.18/sources/STM32MP215DK-AshMX EXTDT_DIR_OPTEE=CA35/DeviceTree/STM32MP215DK-AshMX/optee-os optee
make[1]: Entering directory '/home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18/sources/ostl-linux/optee-os-stm32mp-4.0.0-stm32mp-r3-r0/optee-os-stm32mp-4.0.0-stm32mp-r3'
core/arch/arm/plat-stm32mp2/conf.mk:25: *** Cannot find DTS file /home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp2-openstlinux-26.02.18/sources/STM32MP215DK-AshMX/stm32mp2/a35-td/optee/stm32mp215f-stm32mp215dk-ashmx-mx.dts. Stop.
make[1]: Leaving directory '/home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18/sources/ostl-linux/optee-os-stm32mp-4.0.0-stm32mp-r3-r0/optee-os-stm32mp-4.0.0-stm32mp-r3'
[OPTEE-OS BUILD ERROR] OPTEE_CONFIG: optee-programmer devicetree: stm32mp215f-stm32mp215dk-ashmx-mx
make: *** [/home/ashley/STM32MPU-Ecosystem-v6.2.0/Developer-Package/stm32mp-openstlinux-6.6-yocto-scarthgap-mpu-v26.02.18/sources/ostl-linux/optee-os-stm32mp-4.0.0-stm32mp-r3-r0/optee-os-stm32mp-4.0.0-stm32mp-r3/../Makefile.sdk.stm32mp2:174: tee-optee-programmer-stm32mp21-stm32mp215f-stm32mp215dk-ashmx-mx] Error 1
FAILED > BUILD ISSUE on optee-os-stm32mp

Edit:

It would appear the problem is related to EXTDT_DIR_OPTEE_SERIAL not being set in Makefile.sdk.stm32mp2.  Setting this to default to EXTDT_DIR_OPTEE_SERIAL ?= $(EXTDT_DIR_OPTEE) resolves the issue.  Unfortunately it results in other errors further down the track, so may not be the root cause of the problem.  In the error messages below, the dts file name is correct, but the path to it is incorrect (it is the default path rather than external path).

Device Tree Source (arch/arm/dts/stm32mp215f-stm32mp215dk-ashmx-mx.dtb) is not correctly specified.
Please define 'CONFIG_DEFAULT_DEVICE_TREE'
or build with 'DEVICE_TREE=<device_tree>' argument