Hi.
I’m trying to use CAN bus to get data using OBD2.
I have attached 2 CAN transceivers and enabled can0 and can1 with following command.
#check current values of related registers
sudo busybox devmem 0x0c303000
sudo busybox devmem 0x0c303008
sudo busybox devmem 0x0c303010
sudo busybox devmem 0x0c303018
#0x0000C055
#0x0000C055
#0x0000C059
#0x0000C059
#use devmem to modify registers
sudo busybox devmem 0x0c303000 32 0x0000C400
sudo busybox devmem 0x0c303008 32 0x0000C458
sudo busybox devmem 0x0c303010 32 0x0000C400
sudo busybox devmem 0x0c303018 32 0x0000C458
#check modified values of relate registers
sudo busybox devmem 0x0c303000
sudo busybox devmem 0x0c303008
sudo busybox devmem 0x0c303010
sudo busybox devmem 0x0c303018
#0x0000C400
#0x0000C458
#0x0000C400
#0x0000C458
#or use modeprobe to mount CAN controller
sudo modprobe can
sudo modprobe can-raw
sudo modprobe can-dev
sudo modprobe mttcan
#configure CAN controllers with 1Mbps baudrate
sudo ip link set can0 type can bitrate 1000000
sudo ip link set can1 type can bitrate 1000000
#loopback test
sudo ip link set can0 type can bitrate 1000000 loopback on
sudo ip link set can1 type can bitrate 1000000 loopback on
#open CAN controller
sudo ip link set up can0
sudo ip link set up can1
Question 1.
when I am testing on loopback mode, even I didn’t attach 2 CAN transceivers to xavier, why are can0 and can1 detected?
Question 2.
I have configured CAN controllers with 1Mbps baudrate with following command, and sent packet using can-utils. According to “Enabling CAN on Nvidia Jetson Xavier Developer Kit | by Ramin Nabati | Medium” this blog and “GitHub - hmxf/can_xavier: CAN Bus Drive Script to this git” if I send packet using “cansend can1 5A1#1122334455667788” this command, I should receive message on “candump can0”, which looks like “can0 5A1 [8] 11 22 33 44 55 66 77 88” this. But, I am not receiving any messages. What is wrong with it?
Question 3.
I am trying to connect OBD2 to DB9 cable. I have enabled CAN as far as I can, and tried to get CAN packets with wireshark. But I have failed to get packets. Any advise on OBD&CAN? For example is there any software I can use on xavier development kit? Or guide line for CAN and OBD.
Thank you.