2023-11-26 05:44 AM - edited 2023-11-26 05:51 AM
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
Solved! Go to Solution.
2023-12-08 06:27 AM - edited 2023-12-08 06:28 AM
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.
2023-11-27 11:47 PM
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.
2023-11-28 05:53 AM - edited 2023-11-28 07:21 PM
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
2023-12-08 05:10 AM
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.
2023-12-08 05:16 AM
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)
2023-12-08 06:27 AM - edited 2023-12-08 06:28 AM
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.
2023-12-10 05:52 PM
@Erwan SZYMANSKI it works! appreciated
2024-01-03 04:38 PM
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.
2024-01-03 06:14 PM
I put it in the top dts file, ie. stm32mp157c-dk2.dts in your case
2024-01-04 11:20 AM
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:
@Erwan SZYMANSKI mentioned needing to add it to st,clksrc so I grepped this dir for that string and came up with this.
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.
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.