cancel
Showing results for 
Search instead for 
Did you mean: 

FDCAN not working properly

JYune
Associate II

I am trying to enable FDCAN on STM32MP157C. I modified Linux Kernel (STM32MP15-Ecosystem-v2.0.0) and U-Boot, following the steps explained in the Developer Package guide. I get these messages, which are suggesting I setup everything correctly.

root@stm32mp1:~# dmesg | grep m_can
[    3.032730] m_can_platform 4400e000.can: m_can device registered (irq=51, version=32)
[   44.537911] m_can_platform 4400e000.can can0: bitrate error 0.3%
[   44.542503] m_can_platform 4400e000.can can0: bitrate error 0.3%

root@stm32mp1:/sys/kernel/debug/pinctrl/soc:pin-controller@50002000# cat pinconf-pins | grep CAN
pin 11 (PA11): alternate 9 (FDCAN1_RX) - push pull - floating - low speed
pin 12 (PA12): alternate 9 (FDCAN1_TX) - push pull - floating - low speed

The board seems to pass the internal loopback test as well (https://wiki.st.com/stm32mpu/wiki/How_to_send_or_receive_CAN_data#Hardware_self-test).

The problem is that I cannot get anything on the physical ports. What could have gone wrong?

4 REPLIES 4
Olivier GALLIEN
ST Employee

Hi @JYune​ 

We have a known bug with CAN we have already identified and pending to integrate :

You can find a version of patch here : https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b0342b87cad88894a989604df549e88ff47fb513

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.
NBhat.1
Associate III

Hi Olivier,

I'm having the exact same problem as described in this issue. I'm testing FDCAN on our custom board based on STM32MP153C using Ecosystem v2.1.0 . Internal CAN loopback works fine but nothing on the physical pins. I also tried the kernel patch you suggested above but it didn't make any difference. I've also removed the "sleep" mode for the CAN pins and from m_can1 node from the kernel DT, but still no data on FDCAN1_TX pin when I try sending some data out. Am I missing something? Thanks.

@NBhat.1​ I disabled loopback and was able to get physical signals.

Thanks @JYune​  I got it working with the above patch.