STM32之CAN---错误管理分析

本文详细介绍了STM32中CAN错误管理的原理和实现,包括错误界定规则、错误计数、主动错误与被动错误状态转换以及离线管理。讨论了CAN节点如何在不同错误状态下操作,并阐述了STM32的bxCAN模块如何处理错误,以及如何通过CAN_ESR寄存器监控错误状态。
摘要由CSDN通过智能技术生成

1 几个重要概念

根据ISO11898有如下几个重要的与CAN相关的定义:

  • Fault confinement(错误界定)

CAN nodes shall be able to distinguish short disturbances from permanent failures. Defective transmitting nodes shall be switched off. Switched off means a node is logically disconnected from the bus, so that it can neither send nor receive any frames.

CAN节点可以区分常规错误和永久故障。有故障的发送节点将切换到离线状态。离线意味着在逻辑上与总线断开,既不能发送也不能接收。

  • Error-active(主动错误)

An error-active node shall normally take part in bus communication and send an active error flag when an error has been detected. The active error flag shall consist of six (6) consecutive dominant bits and shall violate the rule of bit stuffing and all fixed formats appearing in a regular frame .

处于主动错误状态的节点能正常参与总线通信的收发和当检测到错误时将发送错误标志,错误标志由6个连续的显示位组成(这种连续的6个显示位与常规的填充位和其它帧固定格式不相同,正因为如此,硬件才容易区别)。

  • Erro
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值