Dear NV_Team,
We use SPI bus and MCP2515 to extand a new can bus, and can0 loop test is fine, but it can’t conmunicate with other can devices. Can you give some advice about how to debug it?
- SPI1(J57/A56/D55/E55) works fine (loop test spi and spi driver of mcp2515 works fine).
- MCP2515 can controller( with SN65HVD231DG4 as tranciever) loop test is fine.
- MCP2515(with SN65HVD231DG4 as tranciever) comunicate with Xavier SOM can controller(SN65HVD231DG4 tranciever) both failed, CAN_H/L hardware connection is fine.
- MCP2515 Xavier driver code using L4T source code.
dmesg log about spi and mcp2515:
mcp251x spi0.0 can0: MCP2515 successfully initialized.
can: controller area network core (rev 20120528 abi 9)
can: raw protocol (rev 20120528)
nvidia@xavier:~$ ifconfig
can0: flags=193<UP,RUNNING,NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 9 bytes 32 (32.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 32 (32.0 B)
TX errors 1 dropped 1 overruns 0 carrier 1 collisions 0
can1: flags=193<UP,RUNNING,NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 2 bytes 16 (16.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 4 overruns 0 carrier 4 collisions 0
device interrupt 68
can2: flags=193<UP,RUNNING,NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 69
CAN0 Loop test
nvidia@xavier:~$ sudo ip link set can0 type can bitrate 1000000 loopback on
nvidia@xavier:~$ sudo ip link set up can0
nvidia@xavier:~$ candump can0 &
nvidia@xavier:~$ cansend can0 123#abcdabcd
nvidia@xavier:~$
can0 123 [4] AB CD AB CD
can0 123 [4] AB CD AB CD
nvidia@xavier:~$ cansend can0 123#abcdabcd
nvidia@xavier:~$
can0 123 [4] AB CD AB CD
can0 123 [4] AB CD AB CD
CAN0 connect to Xavier CAN1(MTTCAN), transmit to each other and no data received (both side)
nvidia@xavier:~$ sudo ip link set can0 type can bitrate 80000
nvidia@xavier:~$ sudo ip link set up can0
nvidia@xavier:~$ sudo ip link set can1 type can bitrate 80000
nvidia@xavier:~$ sudo ip link set up can1
nvidia@xavier:~$ cansend can1 123#abcdabcd
Another terminal to receive can data (can0 is mcp2515, can1 is xaviver can controller)
nvidia@xavier:~$ candump can0
can0 0AE9CB27 [0] remote request
But CAN0 send and CAN1 receive no date.
nvidia@xavier:~$ cansend can0 123#abcdabcd
Another terminal to receive can data (can0 is mcp2515, can1 is xaviver can controller)
nvidia@xavier:~$ candump can1 #no data