2025-12-02 9:42 AM
I'm facing a problem when trying to build an image for my mp257f-eval board using a custom device tree generated from cubemx. I've followed the instructions from the following wiki : https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Distribution_Package#Creating_a_new_open_embedded_layer_for_your_demo But the build fails when trying to compile optee, because the device tree does contains a reference for a pll device not declared earlier. i did some lookups inside the working directory, and i found it declared in the recipes-security/optee folder under meta-st-stm32mp meta layer (https://github.com/STMicroelectronics/meta-st-stm32mp/blob/scarthgap/recipes-security/optee/optee-os/0001-4.0.0-stm32mp-r2.patch). i guess the patch is not applied to the device tree, only the standard device trees for common boards get patched. i don't know if someone has faced a similar problem and can help? I'll attach the log and configs files using for the build. thanks in advance.
The log of the error is the following :
This is the log : DEBUG: Executing python function check_cubemx_extdt DEBUG: Python function check_cubemx_extdt finished DEBUG: Executing shell function do_compile NOTE: make -j 24 PLATFORM=stm32mp2 CROSS_COMPILE_core=aarch64-ostl-linux- ARCH=arm CFG_ARM64_core=y CROSS_COMPILE_ta_arm64=aarch64-ostl-linux- NOWERROR=1 LDFLAGS= CFG_TEE_CORE_LOG_LEVEL=2 CFG_TEE_CORE_DEBUG=y -C /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/git O=/home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx CFG_EMBED_DTB_SOURCE_FILE=stm32mp257f-revision1-mx.dts CFG_EXT_DTS=/home/eng-lab/Documents/stm32mp2-yocto/layers/my-custom-layer/mx/Revision1/CA35/DeviceTree/Revision1/optee-os CFG_STM32MP_PROFILE=secure_and_system_services make: Entering directory '/home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/git' GEN /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx/core/include/generated/arm32_sysreg.h GEN /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx/core/include/generated/arm32_sysreg.S CHK /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx/conf.mk UPD /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx/conf.mk GEN /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx/core/ta_pub_key.c INSTALL /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx/export-ta_arm64/include/time.h ...... GEN /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx/core/pta/rproc_pub_key.c INSTALL /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx/export-ta_arm64/mk/compile.mk DTC /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx/core/arch/arm/dts/stm32mp257f-revision1-mx.dtb INSTALL /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx/export-ta_arm64/mk/subdir.mk /home/eng-lab/Documents/stm32mp2-yocto/layers/my-custom-layer/mx/Revision1/CA35/DeviceTree/Revision1/optee-os/stm32mp257f-revision1-mx.dts:622.9-625.6: ERROR (phandle_references): /soc@0/rcc@44200000/st,clk_opp/st,ck_cpu1/cfg_2: Reference to non-existent node or label "pll1_cfg_1200MHz" ERROR: Input tree has errors, aborting (use -f to force output) INSTALL /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx/export-ta_arm64/mk/gcc.mk make: *** [core/sub.mk:65: /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx/core/arch/arm/dts/stm32mp257f-revision1-mx.dtb] Error 2 make: *** Waiting for unfinished jobs.... INSTALL /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx/export-ta_arm64/mk/clang.mk UPD /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx/ta/remoteproc/dyn_list UPD /home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/build/optee-stm32mp257f-revision1-mx/ta/stm32mp_nvmem/dyn_list make: Leaving directory '/home/eng-lab/Documents/stm32mp2-yocto/build-eglfs/tmp-glibc/work/new_mp257f_eval-ostl-linux/optee-os-stm32mp/4.0.0-stm32mp-r2/git' ERROR: oe_runmake failed WARNING: exit code 1 from a shell command.
#@TYPE: Machine
#@NAME: stm32mp25-mx
#@DESCRIPTION: Configuration for STM32CubeMX generated project
#@NEEDED_BSPLAYERS: layers/meta-openembedded/meta-oe layers/meta-openembedded/meta-python
###########################################################################
#
# Default machine configuration sections
#
###########################################################################
# Define specific common machine name
MACHINEOVERRIDES =. "stm32mpcommonmx:stm32mp2commonmx:stm32mp25commonmx:"
MACHINEOVERRIDES =. "stm32mp2common:stm32mp25common:"
include conf/machine/include/st-machine-common-stm32mp.inc
include conf/machine/include/st-machine-providers-stm32mp.inc
# =========================================================================
# Chip architecture
# =========================================================================
DEFAULTTUNE = "cortexa35"
include conf/machine/include/arm/armv8a/tune-cortexa35.inc
# =========================================================================
# boot scheme
# =========================================================================
BOOTSCHEME_LABELS ?= "optee"
# =========================================================================
# boot device
# =========================================================================
BOOTDEVICE_LABELS ?= "sdcard"
# =========================================================================
# Machine settings
# =========================================================================
# Enable the board device storage support with CUBEMX_DTB
STM32MP_DT_FILES_NAND += "${CUBEMX_DTB}"
STM32MP_DT_FILES_NOR_all += "${CUBEMX_DTB}"
STM32MP_DT_FILES_NOR_mb += "${CUBEMX_DTB}"
STM32MP_DT_FILES_NOR_mb_sb += "${CUBEMX_DTB}"
STM32MP_DT_FILES_EMMC += "${CUBEMX_DTB}"
STM32MP_DT_FILES_SDCARD += "${CUBEMX_DTB}"
STM32MP_DT_FILES_SPINAND += "${CUBEMX_DTB}"
# =========================================================================
# Machine features (default for stm32mp2 like)
# =========================================================================
MACHINE_FEATURES += "splashscreen"
MACHINE_FEATURES += "watchdog"
MACHINE_FEATURES += "${@'gpu' if d.getVar('ACCEPT_EULA_'+d.getVar('MACHINE')) == '1' else ''}"
# =========================================================================
# fip
# =========================================================================
FIP_BL31_ENABLE = "1"
# =========================================================================
# Flashlayout
# =========================================================================
# Set the FLASHLAYOUT_TYPE_LABELS for 'extensible' to CUBEMX_DTB
FLASHLAYOUT_TYPE_LABELS:extensible = "${CUBEMX_DTB}"
FLASHLAYOUT_TYPE_LABELS:optee = "${CUBEMX_DTB}"
# ==========================================================================
# M33 Copro
# ==========================================================================
# Set M33_TZ configuration
CUBEMX_M33_TZ ?= "0"
M33PROJECT_TF_M_TRUSTZONE = "${@bb.utils.contains('MACHINE_FEATURES', 'm33td', '0', '${CUBEMX_M33_TZ}', d)}"
# =========================================================================
# CubeMX extra config
# =========================================================================
ENABLE_CUBEMX_DTB = "1"
###########################################################################
#
# User machine customization sections
#
###########################################################################
# Boot Scheme
# =========================================================================
BOOTSCHEME_LABELS += "optee"
# Boot Device Choice
# =========================================================================
# Define the boot device supported
BOOTDEVICE_LABELS += "sdcard"
BOOTDEVICE_LABELS += "emmc"
#BOOTDEVICE_LABELS += "nand-4-256-1024"
#BOOTDEVICE_LABELS += "nor-sdcard"
# Support Feature Choice
# =========================================================================
# Define the features to enable on board
#MACHINE_FEATURES += "bluetooth"
#MACHINE_FEATURES += "wifi"
#MACHINE_FEATURES += "m33td"
# Specific firmwares and kernel modules configuration
# =========================================================================
# Set the list of kernel module to be auto-loaded during boot
#KERNEL_MODULE_AUTOLOAD += ""
# Set Bluetooth related package list needed when 'bluetooth' feature is enabled
#BLUETOOTH_LIST += ""
# Set Wifi related package list needed when 'wifi' feature is enabled
#WIFI_LIST += ""
# CubeMX Project Config
# =========================================================================
# Assign CubeMX Board devicetree and project path name
CUBEMX_DTB = "stm32mp257f-revision1-mx"
CUBEMX_PROJECT = "mx/Revision1"
CUBEMX_PROJECT_NAME = "Revision1"
# Indicate if M33 co-processor is used with Trustzone enabled or not
CUBEMX_M33_TZ = "0"
I will attach the config files used for the build.
@Gregory PLANCHON @PatrickF @Christophe Guibout Thanks is advance.