扫一扫,手机浏览English  wiki  真伪

微博微信020-38373101

开发板资讯

CONTACT US

联系方式

020-38373101

地址:广州市番禺区大石街道石北工业路728号8栋3楼301

sales@embedsky.net

产品新闻您的位置:首页 >开发板资讯>产品新闻

CAN接口测试方法
日期:2017-10-18

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

1. 配置:

配置使用iproute2)工具。

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

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

# ip -V
ip utility, iproute2-ss160314

以下是配置的命令

ifconfig can0 down
ip link set can0 type can bitrate 100000 triple-sampling on
ip 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 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 接收到的数据

相关产品

TQiMX6UL开发板

Cortex-A7工控板核心

详细内容
TQi.MX6UL_BASEB开发板

Cortex-A7 IMX6UL开发

详细内容
技术支持 天嵌科技