{
  "id": "embedded/can-bus-bit-stuffing-error",
  "signature": "CAN: Bit stuffing error detected at bit position 47, frame ID 0x123",
  "signature_zh": "CAN: 在位位置47检测到位填充错误，帧ID 0x123",
  "regex": "CAN: Bit stuffing error detected at bit position \\d+, frame ID 0x[0-9A-Fa-f]+",
  "domain": "embedded",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "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.",
  "root_cause_type": "generic",
  "root_cause_zh": "CAN总线帧包含超过五个连续相同极性的位，违反了位填充规则，可能是由于波特率不匹配或电气噪声。",
  "versions": [
    {
      "version": "STM32Cube_FW_F1 v1.8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CANopenNode v4.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "MCP2515 v1.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increase the CAN bus termination resistor value to 150 ohms",
      "why_fails": "Termination resistors should be 120 ohms for standard CAN; changing the value can cause signal reflections and worsen bit errors.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Reduce the CAN baud rate arbitrarily without checking the bus configuration",
      "why_fails": "Reducing baud rate may not match other nodes on the bus, causing synchronization errors and more stuffing violations.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "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%).",
      "success_rate": 0.85,
      "how": "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%).",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add a CAN bus error counter check and reset the CAN controller if error count exceeds 96, using HAL_CAN_ResetError() and reinitialization.",
      "success_rate": 0.75,
      "how": "Add a CAN bus error counter check and reset the CAN controller if error count exceeds 96, using HAL_CAN_ResetError() and reinitialization.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "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%).",
    "Add a CAN bus error counter check and reset the CAN controller if error count exceeds 96, using HAL_CAN_ResetError() and reinitialization."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.can-cia.org/can-knowledge/can/can-fd/",
  "official_doc_section": null,
  "error_code": "CAN_STUFF_ERR",
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.78,
  "resolvable": "true",
  "first_seen": "2024-04-18",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}