cancel
Showing results for 
Search instead for 
Did you mean: 

STdistro mickledore - u-boot-stm32mp fails - Device Tree Source not correctly specified

luaiza
Associate II

Hello,

I am facing the issue below when build up my image (or u-boot-stm32mp alone)
I mainly followed instructions in https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Distribution_Package.
But it did not work.

make -f /home/luisa/dev/st/st_distro/stdistro/build-try-test1/tmp-glibc/work-shared/stm32mp151a-bitron-som/uboot-source/scripts/Makefile.build obj=arch/arm/dts dtbs
test -e arch/arm/dts/stm32mp151a-bitron-som-mx.dtb || ( \
echo >&2; \
echo >&2 "Device Tree Source (arch/arm/dts/stm32mp151a-bitron-som-mx.dtb) is not correctly specified."; \
echo >&2 "Please define 'CONFIG_DEFAULT_DEVICE_TREE'"; \
echo >&2 "or build with 'DEVICE_TREE=<device_tree>' argument"; \
echo >&2; \
/bin/false)

My .dts file

stm32mp151a-bitron-som-mx.dts 
stm32mp151a-bitron-som-mx-u-boot.dtsi

are below my building path <builddir>/tmp-glibc/work-shared/stm32mp151a-bitron-som/uboot-source/arch/arm/dts and are as the ones below my mx/bitron_som_20634519_06/CA7/DeviceTree/bitron-som/u-boot directory. I noticed that folder arch/arm/dts holds only .dts and .dtsi files but no .dtb - so why it is expecting a dtb there?

In general, when using OpenSTLinux distribution, is Yocto sufficient to build dtb files?
When one needs to take steps listed in https://wiki.st.com/stm32mpu/wiki/How_to_configure_U-Boot_for_your_board ?

Attached my conf/machine/<machine>.conf file (extended extension to .txt for uploading)

This issue is just the same as 583813  and 53885  but I have found no answer there - so I would thank you for any help.

1 ACCEPTED SOLUTION

Accepted Solutions
luaiza
Associate II

I solved my issue, by #including missing .dtsi in my u-boot/xxx.dts and u-boot/xxx.dtsi files.  They way they are generated by the CubeMx is not sufficient. 
Beyond the above error,

When bitbaking u-boot-stm32mp individually, I got the following error related to scmi_clsk


 

 

/ahb/m4@10000000/m4_system_resources/can@4400e000: Reference to non-existent node or label "scmi_clk"​

 

 


I resolved that by #including stm32mp15-scmi.dtsi 

In general, I used stm32mp157c-ev1.dts and stm32mp157c-ev1-u-boot.dtsi (from u-boot repository) as guideline.  Providing to my files same #include directives present there, just searching for those matching my board stm32m151a.

In addition, to fix the errors below

 

| arch/arm/dts/stm32mp151a-ac_wmini_eu_mp151a-mx.dtb: ERROR (phandle_references): /soc/rcc@50000000: Reference to non-existent node or label "clk_hse"
| arch/arm/dts/stm32mp151a-ac_wmini_eu_mp151a-mx.dtb: ERROR (phandle_references): /soc/rcc@50000000: Reference to non-existent node or label "clk_hsi"
| arch/arm/dts/stm32mp151a-ac_wmini_eu_mp151a-mx.dtb: ERROR (phandle_references): /soc/rcc@50000000: Reference to non-existent node or label "clk_csi"
| arch/arm/dts/stm32mp151a-ac_wmini_eu_mp151a-mx.dtb: ERROR (phandle_references): /soc/rcc@50000000: Reference to non-existent node or label "clk_lse"
| arch/arm/dts/stm32mp151a-ac_wmini_eu_mp151a-mx.dtb: ERROR (phandle_references): /soc/rcc@50000000: Reference to non-existent node or label "clk_lsi"

 

 I re-declared  clocks clk_hse, clk_hsi, clk_csi,... within the clocks node of my .dts file, which was empty

 

	clocks{
		/* USER CODE BEGIN clocks */
		clk_csi: clk-csi {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		clock-frequency = <4000000>;
		};

		clk_hse: clk-hse {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		clock-frequency = <24000000>;
		};

		clk_hsi: clk-hsi {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		clock-frequency = <64000000>;
		};

		clk_lse: clk-lse {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		clock-frequency = <32768>;
		};

		clk_lsi: clk-lsi {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		clock-frequency = <32000>;
		};			
		/* USER CODE END clocks */	
	};

 

 

NOTICE:  those clocks are declared in stm32mp151.dti , which is also  #included in my .dts, but the fact that the clock node was initially empty in my .dts file, make me think that the result was not clocks declared at all.

View solution in original post

5 REPLIES 5
luaiza
Associate II

I solved my issue, by #including missing .dtsi in my u-boot/xxx.dts and u-boot/xxx.dtsi files.  They way they are generated by the CubeMx is not sufficient. 
Beyond the above error,

When bitbaking u-boot-stm32mp individually, I got the following error related to scmi_clsk


 

 

/ahb/m4@10000000/m4_system_resources/can@4400e000: Reference to non-existent node or label "scmi_clk"​

 

 


I resolved that by #including stm32mp15-scmi.dtsi 

In general, I used stm32mp157c-ev1.dts and stm32mp157c-ev1-u-boot.dtsi (from u-boot repository) as guideline.  Providing to my files same #include directives present there, just searching for those matching my board stm32m151a.

In addition, to fix the errors below

 

| arch/arm/dts/stm32mp151a-ac_wmini_eu_mp151a-mx.dtb: ERROR (phandle_references): /soc/rcc@50000000: Reference to non-existent node or label "clk_hse"
| arch/arm/dts/stm32mp151a-ac_wmini_eu_mp151a-mx.dtb: ERROR (phandle_references): /soc/rcc@50000000: Reference to non-existent node or label "clk_hsi"
| arch/arm/dts/stm32mp151a-ac_wmini_eu_mp151a-mx.dtb: ERROR (phandle_references): /soc/rcc@50000000: Reference to non-existent node or label "clk_csi"
| arch/arm/dts/stm32mp151a-ac_wmini_eu_mp151a-mx.dtb: ERROR (phandle_references): /soc/rcc@50000000: Reference to non-existent node or label "clk_lse"
| arch/arm/dts/stm32mp151a-ac_wmini_eu_mp151a-mx.dtb: ERROR (phandle_references): /soc/rcc@50000000: Reference to non-existent node or label "clk_lsi"

 

 I re-declared  clocks clk_hse, clk_hsi, clk_csi,... within the clocks node of my .dts file, which was empty

 

	clocks{
		/* USER CODE BEGIN clocks */
		clk_csi: clk-csi {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		clock-frequency = <4000000>;
		};

		clk_hse: clk-hse {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		clock-frequency = <24000000>;
		};

		clk_hsi: clk-hsi {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		clock-frequency = <64000000>;
		};

		clk_lse: clk-lse {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		clock-frequency = <32768>;
		};

		clk_lsi: clk-lsi {
		#clock-cells = <0>;
		compatible = "fixed-clock";
		clock-frequency = <32000>;
		};			
		/* USER CODE END clocks */	
	};

 

 

NOTICE:  those clocks are declared in stm32mp151.dti , which is also  #included in my .dts, but the fact that the clock node was initially empty in my .dts file, make me think that the result was not clocks declared at all.

debugging
Lead

We walked into the same problems and solutions around the same time. :beaming_face_with_smiling_eyes:

 

I got the exact BUG as you do. @luaiza 

 

I solved this by adding this into the .dts file

 

 

/* USER CODE BEGIN includes */
#include "stm32mp15-scmi.dtsi"
#include "stm32mp15-scmi-u-boot.dtsi"
/* USER CODE END includes */

 

 

  And of course the clocks. It seems that STM32CudeIDE won't generate these clocks. Perhaps this thread should be reported to the ST-developers so they can take a look at it.

 

 

 

clocks{

		/* USER CODE BEGIN clocks */
		clk_csi: clk-csi {
				#clock-cells = <0>;
				compatible = "fixed-clock";
				clock-frequency = <4000000>;
		};

		clk_hse: clk-hse {
				#clock-cells = <0>;
				compatible = "fixed-clock";
				clock-frequency = <24000000>;
		};

		clk_hsi: clk-hsi {
				#clock-cells = <0>;
				compatible = "fixed-clock";
				clock-frequency = <64000000>;
		};

		clk_lse: clk-lse {
				#clock-cells = <0>;
				compatible = "fixed-clock";
				clock-frequency = <32768>;
		};

		clk_lsi: clk-lsi {
				#clock-cells = <0>;
				compatible = "fixed-clock";
				clock-frequency = <32000>;
		};			
		/* USER CODE END clocks */
	};

}; /*root*/

 

 

 

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer
UVV
Associate II

You should define a dtsi similar to arch/arm/dts/stm32mp157c-ed1-scmi.dts, which redefines the clocks for your devices.

@UVV  Hi. I solved this issue and have build my stm32mp151 board. It's working great!

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer