Trucrux Inc

Testing CAN

Login to device

To check for the can0 node run the following command

root@imx8mm-trux-q01:~# ifconfig -a

Search for below log

can0: flags=193<UP,RUNNING,NOARP> mtu 16 metric 1
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 73

If not enabled, enable it by running the below command

root@imx8mm-trux-q01:~# ip link set can0 up type can bitrate 125000

 

Device-to-device CAN communication #

Connect board A and board B over CAN

On device A run the following command

root@imx8mm-trux-q01:~# candump can0

On device B run the following command

root@imx8mm-trux-q01:~# cansend can0 500#1B.12.11