2020-06-04 03:25 AM
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?
2020-06-04 11:55 PM
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