[ARM入门]

天嵌i.MX6UL开发板平台CAN接口测试方法

[复制链接]
681|0
手机看帖
扫描二维码
随时随地手机跟帖
Margaple|  楼主 | 2018-1-17 16:01 | 显示全部楼层 |阅读模式

       CAN(Controller Area Network)是ISO国际标准化的串行通信协议。广泛应用于汽车、船舶等。具有已经被大家认可的高性能和可靠性。CAN已经成为全球范围内最重要的总线之一 —— 甚至领导着串行总线。TQi.MX6UL开发板平台有2路CAN接口,具体测试方法如下:

1. 配置:

配置使用ip(route2)工具。

注意:busybox 里也有集成了ip 工具,但busybox 里的是阉割版本。不支持can 的操作。故使用

前请先确定ip 命令的版本:

# ip -Vip utility, iproute2-ss160314

以下是配置的命令

ifconfig can0 downip link set can0 type can bitrate 100000 triple-sampling onip link set can0 up

2.接收:

candump can0

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 upflexcan 2090000.can can0: writing ctrl=0x012320d4# ifconfig can1 down# ip link set can1 type can bitrate 1000000 triple-sampling on# ifconfig can1 upflexcan 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 接收到的数据

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

99

主题

105

帖子

1

粉丝