Hi team
I'm working on i.MX8 based custom board.
TCAN4550 is implemented on the spi bus.
Our custom board have two spi bus and two TCAN4550 Respectively.
After porting Linux driver tcan4x5x,
I'm conducting loopback test by connecting each CANH and CANL of two chips.
However, the behavior is different depending on the CAN bitrate.
Loopback is possible without any problem up to around 200kbps.
root@localhost:~# ip link set can1 type can bitrate 200000 root@localhost:~# ip link set can1 up root@localhost:~# candump -d -x -e -a any,0:0,#FFFFFFFF & [1] 3733 root@localhost:~# ip link set can0 type can bitrate 200000 root@localhost:~# ip link set can0 up root@localhost:~# root@localhost:~# cansend can0 123#45 can0 TX - - 123 [1] 45 'E' can1 RX - - 123 [1] 45 'E'
But, if it exceeds 300kbps, it seems that an error occurs from CAN BUS.
root@localhost:~# ip link set can1 type can bitrate 300000 root@localhost:~# ip link set can1 up root@localhost:~# candump -d -x -e -a any,0:0,#FFFFFFFF & [1] 3696 root@localhost:~# ip link set can0 type can bitrate 300000 root@localhost:~# ip link set can0 up root@localhost:~# root@localhost:~# cansend can0 123#45 can1 RX - - 20000004 [8] 00 10 00 00 00 00 00 7F ERRORFRAME controller-problem{rx-error-passive} error-counter-tx-rx{{0}{127}} can0 RX - - 20000004 [8] 00 10 00 00 00 00 00 7F ERRORFRAME controller-problem{rx-error-passive} error-counter-tx-rx{{0}{127}}
In the case of 200kbps / 300kbps, we compared the SPI Read/Write sequence just before sending can message,
all were the same except for NBTP Register(0x101c).
200kbps: 0x00090f02 300kbps: 0x00060e02
In addition, we analyzed and compared SPI communication with Logic Analyzer,
SPI data was fine. By the way, SPI frequency is 1Mhz.
As a difference, After sending CAN Message and receive interrupts,
Interrupt register(0x1050) value has changed.
200kbps : 0x00005800 : Okay
300kbps : 0x09000000 : PEA | EW
In addition, when analyzing and comparing CAN communication with Logic Analyzer,
Normal at 200 kbps.
At 300 kbps, abnormal data was transmitted.
・Could you tell me the tcan455x conditions that transmitted abnormal data such as above?
・What Interrupt register errors point to and when do they occur in loopback environment?
I think this is not SPI bus problem between MCU <=> TCAN4550 , but TCAN4550/CAN bus problem.