cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with custom MACHINE config not recognized by BitBake (STM32MP257F-EV1)

Bar01
Associate II

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
Then I get the following error:
 
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!

6 REPLIES 6
Erwan SZYMANSKI
ST Employee

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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Midhul_Pk
Associate II

"Hi, Have you successfully generated a custom image using CubeMX?"

Bar01
Associate II

Hello @Erwan SZYMANSKI,

Thank you for your response. You're absolutely right — there was a small typo in my original post. I did in fact declare the machine as stm32mp25-demo, apologies for the confusion.

When I run envsetup.sh without specifying MACHINE or DISTRO, the script correctly shows the menu, and I can select openstlinux-weston as the DISTRO. It also correctly detects and lists all the machine configurations from meta-st-stm32mp-addons/conf/machine, including my custom one - stm32mp25-demo.

However, after selecting it and initializing the environment, attempting to build (st-image-core and st-image-weston) the image still results in the same error:

MACHINE=stm32mp25-demo is invalid. Please set a valid MACHINE in your local.conf, environment or other configuration file.

I'm attaching my local.conf and stm32mp25-demo.conf files — perhaps there's a mistake I'm overlooking.


Also

  • I’m seeing the exact same issue with all the other machine config files in meta-st-stm32mp-addons/conf/machine (like stm32mp**-mx.conf) — BitBake doesn’t seem to recognize any of them and gives the same error.
  • On the other hand, the default machine configs from meta-st-stm32mp/conf/machine (like stm32mp25-eval.conf) build just fine.
  • I also double-checked that the meta-st-stm32mp-addons layer is correctly detected by BitBake:
layer                 path
=================================================================================================================
stm-st-stm32mp-mx     /home/bar/STM32MPU_workspace/STM32MPU-Ecosystem-v6.0.1/Distribution-Package/layers/meta-st/meta-st-stm32mp-addons  7
​

Any further insight into what could be missing or misconfigured would be greatly appreciated!

Kind regards

Hello @Bar01 ,
Is it the only error that Yocto reports, or do you have a bit more logs to share from Yocto ?

Moreover, can you tell me what is the meta-st-stm32mp-addons version (SHA1) that is pointed in your release ?  Is it well the one pointed by the 6.0.1 manifest ? (SHA1 should be 97617f888513d89c4070f59bfdfa2a91e8175d5c)

Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Bar01
Associate II

Hi Erwan,

I checked the SHA1, and it matches the expected one - 97617f888513d89c4070f59bfdfa2a91e8175d5c - so that looks correct.

Below is the full error message I get when trying to build:

ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    MACHINE=stm32mp25-demo is invalid. Please set a valid MACHINE in your local.conf, environment or other configuration file.

Also, my layers/openembedded-core/meta/conf/sanity.conf file is unchanged and looks like the default:

BB_MIN_VERSION = "2.7.3"

SANITY_ABIFILE = "${TMPDIR}/abi_version"

SANITY_VERSION ?= "1"
LOCALCONF_VERSION  ?= "2"
LAYER_CONF_VERSION ?= "7"
SITE_CONF_VERSION  ?= "1"

INHERIT += "sanity"

Let me know if there’s anything else I should check or try.

Thanks again for your support!

Hello back @Bar01 ,
Really strange Indeed. Did you move some Yocto folders manually between your repo sync and your build ? Can you try to reinstall from scratch the distribution aside of your current one and make a new try ?

This kind of sanity checker is not common, and it is such as it detected a kind of non coherent configuration on your addon layer. The fact that other machine configs give you the same kind of error push in this direction.

(I am not sure at all about the root cause, but maybe it could help to explain).

Kind regards,
Erwan. 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.