I follow Controller Area Network (CAN) to set the can-bus.
First, the pinmux register settings:
sudo busybox devmem 0x0c303018 w 0xc458
sudo busybox devmem 0x0c303010 w 0xc400
Next, load the CAN kernel drivers:
sudo modprobe can
sudo modprobe can_raw
sudo modprobe can_dev
sudo modprobe mttcan
Next, managing the network:
sudo ip link set can0 type can bitrate 500000 loopback on
sudo ip link set can0 up
cansend can0 601#40.60.40.00.01.00.00.02
candump -x any
The data successfully transmited and received.
However, once I don’t open the loopback mode, the data can’t be sent out.
I connect the jetson orin nano to the WaveShare SN65HVD230 CAN board, and connect it to a usbcan analyzer.
For the loopback mode(mttcan_controller_config: ctrlmode 1), the usbcan analyzer can receive the data that send by jetson, but cannot transmit data to jetson.
For the other mode(mttcan_controller_config: ctrlmode 0), the usbcan analyzer cannot receive the data.
Any help would be greatly appreciated, thank you.