CAN(Controller Area Network)是ISO国际标准化的串行通信协议。广泛应用于汽车、船舶等。具有已经被大家认可的高性能和可靠性。CAN已经成为全球范围内最重要的总线之一 —— 甚至领导着串行总线。TQi.MX6UL开发板平台有2路CAN接口,具体测试方法如下: 1. 配置: 配置使用ip(route2)工具。 注意:busybox 里也有集成了ip 工具,但busybox 里的是阉割版本。不支持can 的操作。故使用 前请先确定ip 命令的版本: 以下是配置的命令 2.接收: 3. 发送: - cansend can0 123#DEADBEEF
复制代码短接can0 与can1 的H 与L 以下是测试过程: - # ifconfig can0 down
- # ip link set can0 type can bitrate 1000000 triple-sampling on
- # ifconfig can0 up
- flexcan 2090000.can can0: writing ctrl=0x012320d4
- # ifconfig can1 down
- # ip link set can1 type can bitrate 1000000 triple-sampling on
- # ifconfig can1 up
- flexcan 2094000.can can1: writing ctrl=0x012320d4
- # candump can1& #监听can1
- # cansend can0 111#1122334455667788 #can0 发送数据
- can1 111 [8] 11 22 33 44 55 66 77 88 #can1 接收到的数据
复制代码 阅读更多:http://www.embedsky.com/index.ph ... mp;a=show&id=62 |