CAN_STUFF_ERR embedded protocol_error ai_generated true

CAN: 在位位置47检测到位填充错误,帧ID 0x123

CAN: Bit stuffing error detected at bit position 47, frame ID 0x123

ID: embedded/can-bus-bit-stuffing-error

其他格式: JSON · Markdown 中文 · English
78%修复率
86%置信度
1证据数
2024-04-18首次发现

版本兼容性

版本状态引入弃用备注
STM32Cube_FW_F1 v1.8.0 active
CANopenNode v4.0.0 active
MCP2515 v1.0.0 active

根因分析

CAN总线帧包含超过五个连续相同极性的位,违反了位填充规则,可能是由于波特率不匹配或电气噪声。

English

The CAN bus frame contained more than five consecutive bits of the same polarity, violating the bit stuffing rule, likely due to baud rate mismatch or electrical noise.

generic

官方文档

https://www.can-cia.org/can-knowledge/can/can-fd/

解决方案

  1. Verify CAN bus baud rate using an oscilloscope to measure bit time, then configure all nodes to the same rate (e.g., 500 kbps with sample point at 87.5%).
  2. Add a CAN bus error counter check and reset the CAN controller if error count exceeds 96, using HAL_CAN_ResetError() and reinitialization.

无效尝试

常见但无效的做法:

  1. Increase the CAN bus termination resistor value to 150 ohms 90% 失败

    Termination resistors should be 120 ohms for standard CAN; changing the value can cause signal reflections and worsen bit errors.

  2. Reduce the CAN baud rate arbitrarily without checking the bus configuration 85% 失败

    Reducing baud rate may not match other nodes on the bus, causing synchronization errors and more stuffing violations.