cancel
Showing results for 
Search instead for 
Did you mean: 

Starting the CAN device on DK2 Board

Niklas Voi
Associate II

Hi,

i created a DT in Cubemx and now everythings works fine, with the exception of the CAN Bus.

Here are the Snippets of the Device in DT:

/// Clocks section
CLK_FDCAN_PLL4R in the Clocks Section
///
&m_can1{
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&fdcan1_pins_mx>;
	pinctrl-1 = <&fdcan1_sleep_pins_mx>;
	status = "okay";
 
	/* USER CODE BEGIN m_can1 */
	/* USER CODE END m_can1 */
};
 

And here are some debugs things from the Console:

root@stm32mp1~# ip link set can0 type can bitrate 125000
root@stm32mp1:~# ip link set can0 up
[ 2704.826934] IPv6: ADDRCONF(NETDEV_UP): can0: link is not ready
[ 2704.831483] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
root@stm32mp1:~# cansend can0 1337#34.23.44 
interface = can0, family = 29, type = 3, proto = 1
[ 2720.472282] m_can 4400e000.can can0: bus-off
root@stm32mp1:~# 

I connected a scope FDCAN_RX / TX. I also have a complete Transceiver on a PCB connected to this device, with a termination.

Is there any hint, why the device is getting in bus-off?

1 REPLY 1
Olivier GALLIEN
ST Employee

Hi @Niklas Voi​ 

Be careful that Device Tree generated by CubeMX may require some customization inside USER_CODE tags in order to complete configuration.

I recommanded you to go through https://wiki.st.com/stm32mpu/wiki/CAN_overview and related https://wiki.st.com/stm32mpu/wiki/FDCAN_device_tree_configuration in order to check this.

Hope it help

Olivier

Olivier GALLIEN
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.