cancel
Showing results for 
Search instead for 
Did you mean: 

FDCAN can not start, no clock found

Huibean
Associate II

after follow the wiki, the can0(m_can2) can not start up on stm32mp157d-dk1

root@stm32mp1:~# dmesg | grep can
[ 0.384348] can: controller area network core
[ 0.384666] can: raw protocol
[ 0.384678] can: broadcast manager protocol
[ 0.384695] can: netlink gateway - max_hops=1
[ 0.663370] m_can_platform 4400f000.can: no clock found

 

root@stm32mp1:~# cat /sys/kernel/debug/clk/clk_summary | grep fdcan
fdcan_k 0 0 0 74250000 0 0 50000 N
fdcan 0 0 0 104438965 0 0 50000 N

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @Huibean ,
With taking a better look at your device tree, I see that you include stm32mp157a-dk1-scmi.dtsi.

I ask myself, as this file has been made to configure only IPs that are on the board in question, I think the configuration for m_can2 is missing in your own case.

Can you please add this into the file, and tell me if it corrects something :

 

&m_can2 {
	clocks = <&scmi_clk CK_SCMI_HSE>, <&rcc FDCAN_K>;
};

 

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

9 REPLIES 9
Erwan SZYMANSKI
ST Employee

Hello @Huibean,
What gives you the following command :
Board $> cat /sys/kernel/debug/clk/clk-summary 

Moreover, can you show us how did you configure your device tree for can node ?(cf: https://wiki.stmicroelectronics.cn/stm32mpu/wiki/FDCAN_device_tree_configuration)

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.

I have the clk_summary output like blew, full opuput need to get it tomorrow, the device tree are posted in the file

 

root@stm32mp1:~# cat /sys/kernel/debug/clk/clk_summary | grep fdcan
fdcan_k 0 0 0 74250000 0 0 50000 N
fdcan 0 0 0 104438965 0 0 50000 N

 

by decode the dtb I can get content like below

 

can@4400f000 {
compatible = "bosch,m_can";
reg = <0x4400f000 0x400 0x44011000 0x2800>;
reg-names = "m_can\0message_ram";
interrupts = <0x00 0x14 0x04 0x00 0x16 0x04>;
interrupt-names = "int0\0int1";
clocks = <0x0b 0x00 0x0b 0x9d>;
clock-names = "hclk\0cclk";
bosch,mram-cfg = <0x1400 0x00 0x00 0x20 0x00 0x00 0x02 0x02>;
feature-domains = <0x24 0x3e>;
status = "okay";
pinctrl-names = "default\0sleep";
pinctrl-0 = <0x5f>;
pinctrl-1 = <0x60>;
phandle = <0xd7>;
};

updated:

full clk_summary in file

 

Hello,
This topic has been answered on this link : https://community.st.com/t5/stm32-mpus-products/no-clock-found-for-fdcan-stm32mp157d-dk1/m-p/612096

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.

I saw this post before, but it is not soloved, there is CLK_FDCAN_PLL4R in the optee device tree(generated by CUBE MX with FDCAN enabled and FDCAN colok set to PLL4R)

Hello @Huibean ,
With taking a better look at your device tree, I see that you include stm32mp157a-dk1-scmi.dtsi.

I ask myself, as this file has been made to configure only IPs that are on the board in question, I think the configuration for m_can2 is missing in your own case.

Can you please add this into the file, and tell me if it corrects something :

 

&m_can2 {
	clocks = <&scmi_clk CK_SCMI_HSE>, <&rcc FDCAN_K>;
};

 

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.

@Erwan SZYMANSKI it works! appreciated

I have the same issue with the stm32mp157c-DK2 and I'm not sure where this block belongs

&m_can2 {
	clocks = <&scmi_clk CK_SCMI_HSE>, <&rcc FDCAN_K>;
};

 @Huibean created their own dts file with the tool but I'm trying to do this with the files that are already there. I guess it doesn't matter which dts file I use but I do need to feed the resulting dtb file to the correct stage in the boot chain, right? Which dtb file do I need to create and at what stage do I load it?

I am using yocto & OpenStLinux Dev Package.

I put it in the top dts file, ie. stm32mp157c-dk2.dts in your case

I dont think it matters where in the dts file it goes, the question is in which one? The file you named exists in multiple places to create different dtb files for the various boot stages. 

Here is what I'm working with in Yocto:

ryan2_0-1704394959678.png

@Erwan SZYMANSKI mentioned needing to add it to st,clksrc so I grepped this dir for that string and came up with this.

ryan2_1-1704395276003.png

I decided to work with the CubeMX tool to see what it generated. I get a similar directory structure as above with the addition of optee-os. When I grepped the root dir for fdcan, the only instance of CLK_FDCAN (or anything can+clk) is in the optee-os directory.

 

ryan2_2-1704395806144.png

so I'm still not sure where to put it in order to make dtc happy with the includes and then where to put the resulting dtb, either manually or through the bitbake automation.