I’ve follow the developer guide to validate the CAN in our carrier boards.
CAN of developer guide
There is our hardware mapping for validate
- We’ve been follow the loopback test and the result seems same as the
CAN loopback test
Sorry, there is no log now, I will prepare a loopback log if you need.
root@lanner-desktop:~# cat /sys/kernel/debug/tegra_pinctrl_reg | grep can0 Bank: 1 Reg: 0x0c303010 Val: 0x0000c400 -> can0_dout_paa2 Bank: 1 Reg: 0x0c303018 Val: 0x0000c450 -> can0_din_paa3 Bank: 1 Reg: 0x0c303020 Val: 0x0000c414 -> can0_stb_paa4 Bank: 1 Reg: 0x0c303028 Val: 0x0000c000 -> can0_en_paa5 Bank: 1 Reg: 0x0c303030 Val: 0x0000c414 -> can0_wake_paa6 Bank: 1 Reg: 0x0c303038 Val: 0x0000c414 -> can0_err_paa7 root@lanner-desktop:~# busybox devmem 0x0c303018 w 0x458 root@lanner-desktop:~# busybox devmem 0x0c303010 w 0x400 root@lanner-desktop:~# cat /proc/device-tree/mttcan\@c310000/status okayroot@lanner-desktop:~# modprobe can root@lanner-desktop:~# modprobe can_raw root@lanner-desktop:~# modprobe mttcan root@lanner-desktop:~# ip link set can0 type can bitrate 500000 loopback on root@lanner-desktop:~# ip link set can0 up root@lanner-desktop:~# ifconfig can0 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 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 64 root@lanner-desktop:~# candump can0 &  9169 root@lanner-desktop:~# cansend can0 123#abcdabcd can0 123  AB CD AB CD can0 123  AB CD AB CD
- Start to validate CAN with two Carrier Board.
One is transmitter with cansend.
One is receiver with candump.
This attachment is the log which our operate flow in transmitter.
As the log show, it will issue the huge message as below after ‘cansend’.
Those message will stop after I remove/umount/rmmod the ‘mttcan’ module.
This log also include the dmesg in the before/after of ‘cansend’
mttcan c310000.mttcan can0: Stuff Error Detected
Xavier_NX_CAN0_001_20220512_1044.log (383.4 KB)
We also add the ‘ifconfig can0’ in this log below for check packet transmit/receive status,
it seems only increase the RX packet, the TX packet is always 0.
Xavier_NX_CAN0_001_20220512_1102.log (214.9 KB)
This packet status is same in the receiver/candump side.
- Sorry for photo, there is only one UART cable we have.
This photo is fetch with ssh via pitty.
- Why there is the stuff error, what is that meaning?
- Why this validation only increase RX packet in transmitter/receiver. the TX is always be zero.
- Is that possible to fixed it or find out the root cause?
Please give us some advice for these kindly, thanks a lot.