cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP257F-EV1 unable to compile External Device Tree from Developer Package

rossU
Associate II

I'm following this guide https://wiki.st.com/stm32mpu/wiki/STM32MPU_Developer_Package and I'm stuck at 5.2.3. Building and deploying the Linux kernel for the first time. I followed all ST recommendations for directories names and structures, so everything is exactly how they say. 

Following this README: https://github.com/STMicroelectronics/meta-st-stm32mp/blob/scarthgap/recipes-kernel/linux/linux-stm32mp/README.HOW_TO.txt, I'm stuck at 6.2 Compile External Device tree. When executing this make command with stm32mp257f-ev1-ca35tdcid-ostl.dtb as name of external devicetree:

make ${IMAGE_KERNEL} O="${OUTPUT_BUILD_DIR}" KBUILD_EXTDTS="${EXTDT_DIR}/linux" <name of external devicetree .dtb>

 I get these errors:

make[1]: Entering directory '/home/vboxuser/STM32MPU-Dev/Developer-Package/stm32mp2-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sources/aarch64-ostl-linux/linux-stm32mp-6.6.48-stm32mp-r1-r0/build' GEN Makefile CALL /home/vboxuser/STM32MPU-Dev/Developer-Package/stm32mp2-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sources/aarch64-ostl-linux/linux-stm32mp-6.6.48-stm32mp-r1-r0/linux-6.6.48/scripts/checksyscalls.sh make[3]: *** No rule to make target 'arch/arm64/boot/dts/stm32mp257f-ev1-ca35tdcid-ostl.dtb'. Stop. Looking for stm32mp257f-ev1-ca35tdcid-ostl.dtb into /home/vboxuser/STM32MPU-Dev/Developer-Package/stm32mp2-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sources/aarch64-ostl-linux/external-dt-6.0-r0/external-dt-6.0-r0/external-dt-6.0/linux make[3]: *** No rule to make target 'arch/arm64/boot/dts/stm32mp257f-ev1-ca35tdcid-ostl.dtb'. Stop. make[2]: *** [/home/vboxuser/STM32MPU-Dev/Developer-Package/stm32mp2-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sources/aarch64-ostl-linux/linux-stm32mp-6.6.48-stm32mp-r1-r0/linux-6.6.48/Makefile:1409: stm32mp257f-ev1-ca35tdcid-ostl.dtb] Error 1 make[1]: *** [/home/vboxuser/STM32MPU-Dev/Developer-Package/stm32mp2-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sources/aarch64-ostl-linux/linux-stm32mp-6.6.48-stm32mp-r1-r0/linux-6.6.48/Makefile:234: __sub-make] Error 2 make[1]: Leaving directory '/home/vboxuser/STM32MPU-Dev/Developer-Package/stm32mp2-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sources/aarch64-ostl-linux/linux-stm32mp-6.6.48-stm32mp-r1-r0/build' make: *** [Makefile:234: __sub-make] Error 2

EXTDT_DIR is /home/vboxuser/STM32MPU-Dev/Developer-Package/stm32mp2-openstlinux-6.6-yocto-scarthgap-mpu-v24.11.06/sources/aarch64-ostl-linux/external-dt-6.0-r0/external-dt-6.0-r0/external-dt-6.0 and it indeed has linux directory inside which has Makefile and the following files:
stm32mp257f-ev1-ca35tdcid-ostl.dts
stm32mp257f-ev1-ca35tdcid-ostl-m33-examples.dts
stm32mp257f-ev1-ca35tdcid-ostl-m33-examples-resmem.dtsi
stm32mp257f-ev1-ca35tdcid-ostl-m33-examples-sram.dts
stm32mp257f-ev1-ca35tdcid-ostl-m33-examples-sram-resmem.dtsi
stm32mp257f-ev1-ca35tdcid-ostl-resmem.dtsi
stm32mp257f-ev1-cm33tdcid-ostl.dts
stm32mp257f-ev1-cm33tdcid-ostl-resmem.dtsi
stm32mp257f-ev1-cm33tdcid-ostl-serial-ca35tdcid.dts
stm32mp257f-ev1-psci-osi.dts
stm32mp257f-ev1-tampers.dts

Also, I'm running the latest Ubuntu version 24.10 on VM if that makes any difference.

I followed everything in ST guide step-by-step, didn't do anything other than what they say, and it still fails. I feel like their guide is definitely missing something, because at the previous steps when they offer to manage source code with git, they tell you to create git repo directly from tarball but never tell you to extract it. They only instruct to extract if you don't want to use git for code management. So, they do make assumptions and I believe this is also the case.

Please, help.

1 ACCEPTED SOLUTION

Accepted Solutions

Finally figured out today what the exact issue was. On Ecosystem 6.0.0 with all ST source code, if you want to compile External Device Tree in step 6.2 of Linux instructions you will ALWAYS FAIL using:

 

make ${IMAGE_KERNEL} O="${OUTPUT_BUILD_DIR}" KBUILD_EXTDTS="${EXTDT_DIR}/linux" <name of external devicetree .dtb>

 

First, you need to make sure EXTDT_DIR is set to the location of your or ST's example external device tree source files (this step is obvious and defined in External Device Tree README). /linux after EXTDT_DIR is where ST's sample external dts files are located, your personal files could be elsewhere.

Second and the most important thing is that <name of external devicetree .dtb> in  the command above MUST be prefixed with st/ because that's where Makefile is looking for dts files that come with kernel source code. If it can't find your <name of external devicetree .dtb> file there, it will first throw an error and then look into EXTDT_DIR where your file is indeed located, DTC will be invoked and voila, dtb file has been successfully created.

Sometimes ST instructions really suck.

View solution in original post

8 REPLIES 8
rossU
Associate II

up

debugging
Lead

Probably the same interpretation of the wiki as what I encountered. it seems mandatory to add the dtb to the makefile. 

https://community.st.com/t5/stm32-mpus-software-development/stm32mp157-eco-6-0-0-kernel-custom-device-tree-compilation-fails/td-p/789099

 

Finally figured out today what the exact issue was. On Ecosystem 6.0.0 with all ST source code, if you want to compile External Device Tree in step 6.2 of Linux instructions you will ALWAYS FAIL using:

 

make ${IMAGE_KERNEL} O="${OUTPUT_BUILD_DIR}" KBUILD_EXTDTS="${EXTDT_DIR}/linux" <name of external devicetree .dtb>

 

First, you need to make sure EXTDT_DIR is set to the location of your or ST's example external device tree source files (this step is obvious and defined in External Device Tree README). /linux after EXTDT_DIR is where ST's sample external dts files are located, your personal files could be elsewhere.

Second and the most important thing is that <name of external devicetree .dtb> in  the command above MUST be prefixed with st/ because that's where Makefile is looking for dts files that come with kernel source code. If it can't find your <name of external devicetree .dtb> file there, it will first throw an error and then look into EXTDT_DIR where your file is indeed located, DTC will be invoked and voila, dtb file has been successfully created.

Sometimes ST instructions really suck.

RichKnight
Associate III

Same issue, could you share how to "build all", @rossU Thx mate!

What I meant by building all is that I only executed Step 6.1 Compile kernel image and Devicetree and skipped Step 6.2 Compile External Device tree entirely since it technically was irrelevant for my project at that time. Step 6.1 generated all device tree blobs suitable for my board and I just used one of them.

Also, Step 6.2 output will ONLY be device tree blobs, while Step 6.1 also generates kernel image.

HTH.

I used make dtbs O="${OUTPUT_BUILD_DIR}" KBUILD_EXTDTS="${EXTDT_DIR}/linux" to build the external device tree, is this OK? Or I have to build kernal with external device tree? Because step 6.2 only need to compile the external device tree.

Thx 

Richknight

Updated the solution

I updated the solution