cancel
Showing results for 
Search instead for 
Did you mean: 

How to create "mx" directory in "meta-st-stm32mp-addons"?

HMasu.1
Senior

I want to create my own machine.

I'm trying to create with reference to following Wiki Page.

https://wiki.st.com/stm32mpu/wiki/How_to_create_your_own_machine

In "2 Generate device tree" in the wiki page, I need to set device tree from STM32CubeMX to "mx" directory.

However, OpenSTLinux Distribution Package (openstlinux-20-02-19) that I have install has no "mx" directory  in "meta-st-stm32mp-addons".

Do I need any other steps to create "mx" directory in "meta-st-stm32mp-addons" automatically?

And, in the case that I want to change kernel or u-boot or tf-a device tree, all I need is to change device tree in "mx" directory?

Do I need any other steps to reflect the change of device tree setting?

For reference, I have tried to create "mx" directory manually and set device tree to "mx" directory, but bitbake failed.

(Error message shows "No rule to make target arch/arm/boot/dts/xxxxxxxx.dtb")

Best regards,

H. Masuda

1 ACCEPTED SOLUTION

Accepted Solutions
Yves C
ST Employee

Hi ArmanDG & HMasu.1

I checked the conf file and it seems to be OK except the name of the machine #@NAME : should be stm32mp1- portmap_20200330.

Your yocto environment should be be set with the command :

MACHINE=stm32mp1- portmap_20200330 DISTRO=openstlinux-weston source layers/meta-st/script/envsetup.sh

According to your config file the mx folder is .../layers/meta-st/meta-st-stm32mp-addons/mx/portmap_20200330 + subfolder tf-a, u-boot, kernel, optee-os.

In the tmp-glibc/work-shared/stm32mp1-mx/kernel-source/arch/arm/boot/dts/ you should have a link to the location on your customized Linux dts in /layers/meta-st/meta-st-stm32mp-addons/mx/portmap_20200330/kernel .

To force the update of the linux kernel and the dts in the image:

bitbake linux-stm32mp -c cleanall

bitbake linux-stm32mp

bitbake st-image-weston

Yves C

View solution in original post

10 REPLIES 10
ArmandG
ST Employee

Hi @HMasu.1​ ,

Yes you just have to create a "mx" directory with a <ProjectName> sub directory containing the device tree generated by STM32CubeMX.

And if you want to change the kernel/tf-a/u-boot you can indeed modify directly in this directory and use bitbake again.

For your error, did you uncomment the proper lines as indicated in 3.2 ? You can see some examples in conf/machine/example if you are not sure what to uncomment.

Best regards,

Armand

HI @ArmandG​ 

Thank you for your reply.

I could make Bitbake successful.

However, the change of device trees in "/layers/meta-st/meta-st-stm32mp-addons/mx/" directory can not be reflected.

if I copy the device trees to following directory manually, sometimes the change of device trees is able to be reflected.

-kernel device tree: /tmp-glibc/work-shared/stm32mp1-***/kernel-source/arch/arm/boot/dts

-u-boot device tree: /tmp-glibc/work-shared/stm32mp1-***/uboot-source/arch/arm/dts

-u-boot device tree: /tmp-glibc/work-shared/stm32mp1-***/tfa-source/fdts

But even in same condition as above, sometimes can not.​

Why are the results different even though I'm bitbaking in the same condition?

For example, is it possible to be excluded from bitbake due to the last update date of the device tree? (In case that the last update date of the device tree source is older than dtb file, is it excluded from bitbake even if the device tree source has be changed?)

Do I need any other steps to reflect the change of device tree other than changing device tree?

​Best regards,

H. Masuda

Hi @HMasu.1​ ,

I am not sure if this is the answer you are expecting, if you modify the device tree in mx directory, changes are applied as well in tmp-glibc/work-shared/... Do you have concrete examples where modifications are not done ?

Best regards,

Armand

Hi @ArmandG​ 

For example, in case that I change usbh_ohci node of kernel device tree in "mx" directory to make USB available in my custom board, I can not make USB available with created linux image. In this case, after bitbake, device tree source in tmp-glibc/work-shared/... are not same as device tree source in "mx" folder. (the change is not reflected to device tree in tmp-glibc/work-shared/... . In other words device tree source files are not copied from "mx" directory to tmp-glibc/work-shared/...)

In case that I change directly usbh_ohci node of kernel device tree in tmp-glibc/work-shared/... , I can make USB available with created linux image.

​Best regards,

H. Masuda

Hi @HMasu.1​ ,

Normally if you change your device tree in "mx" directory it is instantly changed in work-shared/ it is not due to bitbake, bitbaking doesn't write in the device tree file.

Can I check your stm32mp1-<ProjectName>.conf file ?

Best regards,

Armand

Hi @ArmandG​ 

Thank you for your quick reply.

I will share my ​stm32mp1-<ProjectName>.conf file.

This file is located in .../layers/meta-st/meta-st-stm32mp-addons/conf/machine.

Please check it.

Yves C
ST Employee

Hi ArmanDG & HMasu.1

I checked the conf file and it seems to be OK except the name of the machine #@NAME : should be stm32mp1- portmap_20200330.

Your yocto environment should be be set with the command :

MACHINE=stm32mp1- portmap_20200330 DISTRO=openstlinux-weston source layers/meta-st/script/envsetup.sh

According to your config file the mx folder is .../layers/meta-st/meta-st-stm32mp-addons/mx/portmap_20200330 + subfolder tf-a, u-boot, kernel, optee-os.

In the tmp-glibc/work-shared/stm32mp1-mx/kernel-source/arch/arm/boot/dts/ you should have a link to the location on your customized Linux dts in /layers/meta-st/meta-st-stm32mp-addons/mx/portmap_20200330/kernel .

To force the update of the linux kernel and the dts in the image:

bitbake linux-stm32mp -c cleanall

bitbake linux-stm32mp

bitbake st-image-weston

Yves C

Hi @Yves C​ ,

Thank you for your reply.

I have already set with above command.

I removed all the products produced by bitbake and executed bitbake again, now the change of device trees in "mx" directory can be reflected.

> In the tmp-glibc/work-shared/stm32mp1-mx/kernel-source/arch/arm/boot/dts/ you should have a link to the location on your customized Linux dts

> in /layers/meta-st/meta-st-stm32mp-addons/mx/portmap_20200330/kernel .

I have a question ​about this comment.

My understanding was that I don't have to do something intentionally to have a link to the location "/layers/meta-st/meta-st-stm32mp-addons/mx/portmap_20200330/kernel" (it is automatically linked. If I modify dts file in "/layers/meta-st/meta-st-stm32mp-addons/mx/portmap_20200330/kernel", the change are automatically reflected to dts file in "tmp-glibc/work-shared/stm32mp1-mx/kernel-source/arch/arm/boot/dts/").

Is my understanding wrong?

Best regards,

​H. Masuda

Yves C
ST Employee

Hi HMasu.1

Your understanding is correct

Best regards,

Yves C