{
  "id": "embedded/uart-overrun-error-dma-mode",
  "signature": "UART: overrun error (ORE) detected in DMA mode, data lost",
  "signature_zh": "UART：DMA 模式下检测到溢出错误（ORE），数据丢失",
  "regex": "UART: overrun error.*detected in DMA mode",
  "domain": "embedded",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "UART overrun occurred because DMA transfer rate insufficient to empty receive buffer before next byte arrives.",
  "root_cause_type": "generic",
  "root_cause_zh": "UART 溢出因 DMA 传输速率不足以在下个字节到达前清空接收缓冲区而发生。",
  "versions": [
    {
      "version": "STM32Cube_FW_F4 V1.27.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "HAL V1.8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Increasing UART baud rate worsens overrun as data arrives faster.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Disabling DMA and using interrupt mode shifts bottleneck but does not fix root cause.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase DMA buffer size and use circular mode to allow more time for processing: `HAL_UART_Receive_DMA(&huart, buffer, BUFFER_SIZE);` with BUFFER_SIZE >= 512.",
      "success_rate": 0.85,
      "how": "Increase DMA buffer size and use circular mode to allow more time for processing: `HAL_UART_Receive_DMA(&huart, buffer, BUFFER_SIZE);` with BUFFER_SIZE >= 512.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Enable UART hardware flow control (RTS/CTS) to throttle sender: set `huart.Init.HwFlowCtl = UART_HWCONTROL_RTS_CTS;`",
      "success_rate": 0.9,
      "how": "Enable UART hardware flow control (RTS/CTS) to throttle sender: set `huart.Init.HwFlowCtl = UART_HWCONTROL_RTS_CTS;`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reduce interrupt priority of DMA and increase priority of UART global interrupt to handle ORE flag faster.",
      "success_rate": 0.75,
      "how": "Reduce interrupt priority of DMA and increase priority of UART global interrupt to handle ORE flag faster.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "增加 DMA 缓冲区大小并使用循环模式以提供更多处理时间：`HAL_UART_Receive_DMA(&huart, buffer, BUFFER_SIZE);` 其中 BUFFER_SIZE >= 512。",
    "使能 UART 硬件流控制（RTS/CTS）以限制发送端：设置 `huart.Init.HwFlowCtl = UART_HWCONTROL_RTS_CTS;`",
    "降低 DMA 的中断优先级，提高 UART 全局中断优先级以更快处理 ORE 标志。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.st.com/resource/en/application_note/dm00110233.pdf",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2023-11-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}