cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP157 ECO 6.0.0 Kernel custom device tree compilation fails

debugging
Lead

Executed from the linux tree root where the kernel was build from

The dts was placed in the arch/arm/boot/dts/st/ folder. {STM32MP_PROJECT} is the filename (and hardcoding the dt filename gives the same result)

Followed the wiki and the kernel HOWTO readme (both have different instructions)

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

 

make V=1 ARCH=arm st/stm32mp157a-dk1.dtb LOADADDR=0xC2000040 O="${OUTPUT_BUILD_DIR}" 

OK

 

make V=1 ARCH=arm st/${STM32MP_PROJECT}.dtb LOADADDR=0xC2000040 O="${OUTPUT_BUILD_DIR}" 

FAILS

 

make ${IMAGE_KERNEL} O="${OUTPUT_BUILD_DIR}" KBUILD_EXTDTS="${EXTDT_DIR}/linux" ${STM32MP_PROJECT}.dtb

FAILS

 

The error reported  is No rule to make ... etc..

Since ECO 6.0 boards are now in subfolders under configs. ST's dt's in the same folder compile fine. The file is there with the correct name. Make/Makefile seems to execute some kind of scripts which i can't follow. Perhaps custom DT's not in the Makefile were never tested/considered ? P.S Why is there a LOADADDR needed for this ?

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Erwan SZYMANSKI
ST Employee

Hello @debugging ,
From what I understand, you added manually your device tree into kernel sources "in tree". In this context, you do not have to use the last compilation command you gave as this is for External device tree purpose.

Your error let me think about a missing dtb added in the Makefile of the same folder. Did you well add it below the other STM32 ones ? 

 stm32mp157f-dk2-a7-examples.dtb \
	stm32mp157f-dk2-m4-examples.dtb \
	stm32mp157f-ed1.dtb \
	stm32mp157f-ev1.dtb \
	stm32mp157f-ev1-a7-examples.dtb \
	stm32mp157f-ev1-m4-examples.dtb \
	YOUR_DT.dtb \
dtb-$(CONFIG_ARCH_U8500) += \
	ste-snowball.dtb \
	ste-hrefprev60-stuib.dtb \
	ste-hrefprev60-tvk.dtb \
	ste-hrefv60plus-stuib.dtb \

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.

View solution in original post

5 REPLIES 5
Erwan SZYMANSKI
ST Employee

Hello @debugging ,
From what I understand, you added manually your device tree into kernel sources "in tree". In this context, you do not have to use the last compilation command you gave as this is for External device tree purpose.

Your error let me think about a missing dtb added in the Makefile of the same folder. Did you well add it below the other STM32 ones ? 

 stm32mp157f-dk2-a7-examples.dtb \
	stm32mp157f-dk2-m4-examples.dtb \
	stm32mp157f-ed1.dtb \
	stm32mp157f-ev1.dtb \
	stm32mp157f-ev1-a7-examples.dtb \
	stm32mp157f-ev1-m4-examples.dtb \
	YOUR_DT.dtb \
dtb-$(CONFIG_ARCH_U8500) += \
	ste-snowball.dtb \
	ste-hrefprev60-stuib.dtb \
	ste-hrefprev60-tvk.dtb \
	ste-hrefv60plus-stuib.dtb \

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.
debugging
Lead

The wiki does not mention the dts should be added to the Makefile:

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

5.3. Kernel : regenerate the kernel DTB

make ARCH=arm st/stm32mp135f-stm32mp135f-dk-mx.dtb LOADADDR=0xC2000040 O="${OUTPUT_BUILD_DIR}"

This worked (also with a custom DT not in the Makefile) with ECO 5.0 but not with 6.0

 

As a quick test on OSTL v6, I tested to copy a dk dts and name it something such as stm32mp135f-dk-copy.dts.
The command you used worked on my side in this case.

Are you sure you have no syntax issue with your dts filename ? 

Another test would be to add your specific DT in the Makefile and try a make dtbs.

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.
debugging
Lead

Adding it to the Makefile worked.

Found the same issue with u-boot, the .dts file exists, is not in the Makefile, and does not build the dtb. in ECO 5.0 the DT was not added to makefile and the make did not fail

make DEVICE_TREE=$STM32MP_PROJECT DEBUG=1 LOG_LEVEL=LOG_LEVEL_INFO all

/media/user/H3D2P1/Develop/STMICRO/STM_ECO_6.0.0/Developer-Package/u-boot-stm32mp-v2023.10-stm32mp-r1-r0/u-boot-stm32mp-v2023.10-stm32mp-r1/arch/arm/dts/stm32mp157a-board-mx-lcd.dts

Device Tree Source (arch/arm/dts/stm32mp157a-board-mx-lcd.dtb) is not correctly specified.
Please define 'CONFIG_DEFAULT_DEVICE_TREE'
or build with 'DEVICE_TREE=<device_tree>' argument
make[1]: *** [dts/Makefile:34: arch/arm/dts/stm32mp157a-board-mx-lcd.dtb] Error 1
make: *** [Makefile:1156: dts/dt.dtb] Error 2

I do add the DEVICE_TREE option but still the error is reports

Used this for u-boot and the dtb was generated. Curious why DEVICE_TREE doesn't ?

CONFIG_DEFAULT_DEVICE_TREE=Device tree name

 

debugging
Lead

Correction: I did add the device tree files to the Makefile in ECO 5.0 to make it work. Suggest to add this in the WIKI to help others.