打印
[i.MX]

can 使能后接收不到数据

[复制链接]
2332|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
Wonderself|  楼主 | 2016-3-29 14:37 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
CAN, se, ST, TE, sd
参考文档i.MX_6_Linux_Reference_Manual.pdf,使能can1后loopback模式接收不到数据,论坛大神能否帮我看看。

以下是具体操作
root@imx6dlsabresd:~# ip link set can0 down
root@imx6dlsabresd:~# ip link set can0 type can bitrate 125000 loopback on
root@imx6dlsabresd:~# ip -details -statistics link show can0
2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
    link/can  promiscuity 0
    can <LOOPBACK> state STOPPED (berr-counter tx 0 rx 0) restart-ms 0
          bitrate 125000 sample-point 0.875
          tq 500 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
          flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1
          clock 30000000
          re-started bus-errors arbit-lost error-warn error-pass bus-off
          0          0          0          0          0          0         
    RX: bytes  packets  errors  dropped overrun mcast   
    0          0        0       0       0       0      
    TX: bytes  packets  errors  dropped carrier collsns
    0          0        0       0       0       0      
root@imx6dlsabresd:~# ip link set can0 up
flexcan 2090000.can can0: writing ctrl=0x0e313005
root@imx6dlsabresd:~# candump can0 &
[1] 945
root@imx6dlsabresd:~# cansend can0 123#11223344556677
root@imx6dlsabresd:~#   can0  123   [7]  11 22 33 44 55 66 77

root@imx6dlsabresd:~# ip -details -statistics link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
    link/can  promiscuity 0
    can <LOOPBACK> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
          bitrate 125000 sample-point 0.875
          tq 500 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
          flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1
          clock 30000000
          re-started bus-errors arbit-lost error-warn error-pass bus-off
          0          0          0          0          0          0         
    RX: bytes  packets  errors  dropped overrun mcast   
    0          0        0       0       0       0      
    TX: bytes  packets  errors  dropped carrier collsns
    7          1        0       0       0       0      

相关帖子

沙发
Wonderself|  楼主 | 2016-3-29 14:41 | 只看该作者
发送之后显示TX有数据,但RX没有接收到。
想问下TX,RX需要短接吗?
芯片连的是CAN1,CAN2,为什么这边一直是CAN0?
还有, cansend can0 123#11223344556677 前面的123是什么意思?
刚接触CAN,还不太懂,麻烦知道的不吝赐教啊。

使用特权

评论回复
板凳
Wonderself|  楼主 | 2016-3-31 10:14 | 只看该作者
有做过的能帮我看下吗?谢谢了!

使用特权

评论回复
地板
mini1986| | 2016-4-14 09:40 | 只看该作者
看看cansend的用法......确定can驱动没有问题......

使用特权

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

本版积分规则

4

主题

23

帖子

0

粉丝