2025-04-16 10:01 AM
Hi all,
Following the guide at https://wiki.st.com/stm32mpu/index.php/How_to_create_your_own_machine, I generated Device Tree .dts files using STM32CubeMX (version 6.14.1) for the STM32MP257F-EV1 board (selected via Board Selector) in a project named demo, aiming to use a custom device tree setup.
In CubeMX, I set the project location to:
/Distribution-Package/layers/meta-st/meta-st-stm32mp-addons/mx
(I manually created the mx folder beforehand.)
This resulted in the expected output files being generated under:
Distribution-Package/layers/meta-st/meta-st-stm32mp-addons/mx/demo
├── CA35
│ ├── DeviceTree
│ │ └── demo
│ │ ├── kernel
│ │ │ ├── Makefile
│ │ │ ├── stm32mp257f-demo-mx.dts
│ │ │ └── stm32mp257f-demo-mx-resmem.dtsi
│ │ ├── optee-os
│ │ │ ├── conf.mk
│ │ │ ├── stm32mp257f-demo-mx.dts
│ │ │ ├── stm32mp257f-demo-mx-rcc.dtsi
│ │ │ ├── stm32mp257f-demo-mx-resmem.dtsi
│ │ │ └── stm32mp257f-demo-mx-rif.dtsi
│ │ ├── tf-a
│ │ │ ├── stm32mp257f-demo-mx.dts
│ │ │ ├── stm32mp257f-demo-mx-fw-config.dts
│ │ │ ├── stm32mp257f-demo-mx-rcc.dtsi
│ │ │ └── stm32mp25-mx.dtsi
│ │ └── u-boot
│ │ ├── Makefile
│ │ ├── stm32mp257f-demo-mx.dts
│ │ ├── stm32mp257f-demo-mx-resmem.dtsi
│ │ └── stm32mp257f-demo-mx-u-boot.dtsi
│ └── manifest.prop
├── CM33
│ ├── DeviceTree
│ │ └── demo
│ │ └── tf-m
│ │ ├── stm32mp257f-demo-mx.dts
│ │ ├── stm32mp257f-demo-mx-rcc.dtsi
│ │ └── stm32mp257f-demo-mx-resmem.dtsi
...
Then, I created a custom machine config `/layers/meta-st/meta-st-stm32mp-addons/conf/machine/stm32mp25-demo.conf` based on `/conf/machine/stm32mp25-mx.conf` and the example at `/conf/machine/examples/stm32mp25-eval-mx.conf.sample.`
I only modified the path so it points to my project:
CUBEMX_DTB = "stm32mp257f-demo-mx"
CUBEMX_PROJECT = "mx/demo/CA35/DeviceTree/demo"
I also created the required EULA file at /conf/eula/stm32mp25-demo.
After initializing Yocto with:
DISTRO=openstlinux-weston MACHINE=stm32mp2 source layers/meta-st/scripts/envsetup.sh
...everything seems to work — until I try building an image using:
bitbake st-image-weston
MACHINE=stm32mp25-demo is invalid. Please set a valid MACHINE in your local.conf, environment or other configuration file.
The same issue occurs for other existing machine files in /conf/machine/, as if bitbake doesn't recognize them at all.
Any ideas or suggestions on what might be missing or misconfigured?
Thanks in advance for your help!
2025-04-18 6:35 AM
Hello @Bar01 ,
Your
DISTRO=openstlinux-weston MACHINE=stm32mp2 source layers/meta-st/scripts/envsetup.sh
source command line is strange. If you created your own machine, this is your own machine that should replace stm32mp2 after MACHINE=.
If you want to check if your own machine configuration is well detected, very simple. Launch source layers/meta-st/scripts/envsetup.sh without precising DISTRO and MACHINE. Then a menu will ask you to choose manually both arguments. Choose the same DISTRO but for MACHINE check that you have your own one.
Kind regards,
Erwan.