查看: 5710|回复: 4

[其他] can总线上为什么会收到自己发的帧?

[复制链接]

该用户从未签到

5

主题

14

帖子

0

新手上路

Rank: 1

积分
40
最后登录
1970-1-1
发表于 2012-1-8 23:20:53 | 显示全部楼层 |阅读模式
我用mcf52259调试can总线,可以进行正常的数据收发工作,但是比较奇怪的是在发送端同时会收到自己发出的数据帧。我是用中断方式进行接收的,请问这是正常的吗?如果不正常应该怎么处理或者屏蔽?
 
我知道答案 目前已有3人回答
回复

使用道具 举报

  • TA的每日心情
    难过
    2021-12-15 16:01
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]初来乍到

    305

    主题

    4701

    帖子

    0

    中级会员

    Rank: 3Rank: 3

    积分
    377
    最后登录
    2023-8-16
    发表于 2012-1-9 14:48:05 | 显示全部楼层

    RE:can总线上为什么会收到自己发的帧?

    不正常,你是不是把自我测试功能打开了?
    该会员没有填写今日想说内容.
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    5

    主题

    14

    帖子

    0

    新手上路

    Rank: 1

    积分
    40
    最后登录
    1970-1-1
     楼主| 发表于 2012-1-9 16:37:44 | 显示全部楼层

    回复:can总线上为什么会收到自己发的帧?

    回复第 2 楼 于2012-01-09 06:48:05发表:
    不正常,你是不是把自我测试功能打开了? 

    没有啊,而且帧确实发出去了。
    我在网上查了一下,看到也有人问,好像这是正常的现象?
    http://forums.freescale.com/t5/Freescale-MQX-trade-Software/Flexcan-example/td-p/59317
     
    I get contact with Freescale and they answer me:
     
    The statement of the reference manual that you say is wrong. The statement should say the next:

    "Note that FlexCAN only receive frames transmitted by itself if another device (node) on the CAN bus acknowledges the frame, which device has an ID that matches the FlexCAN Rx MB ID. If no other node acknowledges the frame, an ACK error is generated and, in this case, the module does not receive the frame sent by itself."

    And  unfortunately it's not possible to disable the Self-Received Frames.
    The FlexCAN will receive frames transmitted by itself if another device on the CAN bus acknowledges the frame. If no other node acknowledges the frame, an ACK error is generated and, in this case, the module does not receive the frame sent by itself. That means the same FlexCAN module can't acknowledge its own message.
    So all you can as an alternate to disabling this feature would be to set up a filter that ignores the frame when the ID of the frame matches the ID of the FlexCAN MB.
    You may filter out self-received frames on hardware level by configuring ID masking (Rx Mask Registers RXGMASK, RX14MASK and RX15MASK).
     
    So, you can reject your own messages unless you put a software mask
     
    按照上面说法这是无法避免收到自己发出的帧数据的,除非在mask这边进行屏蔽,不知道理解的是否对。
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    1

    主题

    12

    帖子

    0

    新手上路

    Rank: 1

    积分
    14
    最后登录
    1970-1-1
    发表于 2013-5-23 09:49:48 | 显示全部楼层

    RE:can总线上为什么会收到自己发的帧?

    我也遇到了,好郁闷,再仔细看看咋回事
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    1

    主题

    12

    帖子

    0

    新手上路

    Rank: 1

    积分
    14
    最后登录
    1970-1-1
    发表于 2013-5-30 13:47:01 | 显示全部楼层

    RE:can总线上为什么会收到自己发的帧?

    做mask屏蔽自己发出去的帧确实可行。
    估计是故意这样设计,或是bug吧。
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /3 下一条

    Archiver|手机版|小黑屋|恩智浦技术社区

    GMT+8, 2025-7-22 20:25 , Processed in 0.153938 second(s), 25 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.

    快速回复 返回顶部 返回列表