CAN-FD 使用
AIBOX-9075 提供 2 路 CAN-FD 接口(光耦隔离),可连接 CAN 总线设备进行通信。
接线时 CAN_H 接 CAN_H,CAN_L 接 CAN_L。
Ubuntu 系统可先执行 apt update && apt install can-utils 安装测试工具,通信测试命令如下:
# 关闭 can0 设备
ip link set can0 down
# 设置比特率为 250Kbps
ip link set can0 type can bitrate 250000
# 打开 can0 设备
ip link set can0 up
# 接收端执行 candump,阻塞等待报文
candump can0
# 发送端执行 cansend,发送报文
cansend can0 123#1122334455667788更多 can 工具的使用详见 can-utils 手册。