Documentation/Allspark2-Orin NX WikiEnglish · NX
Browse documentation
10 Interface Function Test Demos

10.12 CAN Function Test

Power adapter, Allspark 2 Orin main unit, and USBCAN analyzer (USBCAN IIC+ upgraded black enclosure).

1 min read · English documentation
PIN1 PIN2 PIN3 PIN4
3V3 CANH CANL GND

Test Equipment

Power adapter, Allspark 2-Orin main unit, and USBCAN analyzer (USBCAN-IIC+ upgraded black enclosure).

Test Objective

Test the functionality of the CAN-related circuitry

Test Procedure

  1. Connect the main unit's CAN port to the USBCAN analyzer: connect CAN_H to CAN_H and CAN_L to CAN_L.

图片.png

  1. Activate CAN.
sudo modprobe mttcan
  1. Configure the CAN bit rate.
sudo ip link set can0 type can bitrate 500000
  1. Enable CAN.
sudo ip link set up can0
  1. Receive data: monitor the can0 channel and display received CAN frames in the console.
sudo candump can0

图片.png

  1. Send data: send a CAN frame using the following command. It sends a 4-byte CAN message on the can0 channel with the data 11223344AABBCCDD at CAN ID 001.
cansend can0 001#11223344AABBCCDD

图片.png