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个显示位与常规的填充位和其它帧固定格式不相同,正因为如此,硬件才容易区别)。
- Error-passive(被动错误)
An error

本文详细介绍了STM32中CAN错误管理的原理和实现,包括错误界定规则、错误计数、主动错误与被动错误状态转换以及离线管理。讨论了CAN节点如何在不同错误状态下操作,并阐述了STM32的bxCAN模块如何处理错误,以及如何通过CAN_ESR寄存器监控错误状态。
最低0.47元/天 解锁文章
2821

被折叠的 条评论
为什么被折叠?



