{
  "id": "embedded/uart-cts-flow-control-timeout",
  "signature": "UART: CTS flow control timeout, transmission stalled on USART2",
  "signature_zh": "UART：CTS流控制超时，USART2上传输停滞",
  "regex": "UART: CTS flow control timeout, transmission stalled on USART\\d+",
  "domain": "embedded",
  "category": "communication_error",
  "subcategory": null,
  "root_cause": "UART CTS (Clear to Send) line held high by remote device or stuck due to hardware fault, causing transmitter to wait indefinitely.",
  "root_cause_type": "generic",
  "root_cause_zh": "UART CTS（清除发送）线被远程设备拉高或因硬件故障卡住，导致发送器无限期等待。",
  "versions": [
    {
      "version": "STM32F405 HAL 1.8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Zephyr RTOS 3.6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Disabling hardware flow control entirely may cause data loss; it is not a fix for CTS timeout but a workaround that changes protocol.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Increasing UART baud rate does not resolve CTS line stuck high; the issue is external signal, not internal timing.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Implement CTS timeout in firmware: if (HAL_UART_GetState(&huart2) == HAL_UART_STATE_BUSY_TX) { HAL_UART_Abort(&huart2); HAL_UART_Transmit_IT(&huart2, pData, Size); }",
      "success_rate": 0.87,
      "how": "Implement CTS timeout in firmware: if (HAL_UART_GetState(&huart2) == HAL_UART_STATE_BUSY_TX) { HAL_UART_Abort(&huart2); HAL_UART_Transmit_IT(&huart2, pData, Size); }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add a pull-down resistor on CTS line to force low in case of floating signal; measure CTS voltage with oscilloscope.",
      "success_rate": 0.92,
      "how": "Add a pull-down resistor on CTS line to force low in case of floating signal; measure CTS voltage with oscilloscope.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Implement CTS timeout in firmware: if (HAL_UART_GetState(&huart2) == HAL_UART_STATE_BUSY_TX) { HAL_UART_Abort(&huart2); HAL_UART_Transmit_IT(&huart2, pData, Size); }",
    "Add a pull-down resistor on CTS line to force low in case of floating signal; measure CTS voltage with oscilloscope."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.st.com/resource/en/reference_manual/dm00031020-stm32f405-415-l4-series-reference-manual-stmicroelectronics.pdf",
  "official_doc_section": null,
  "error_code": "0x00020001",
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.89,
  "resolvable": "true",
  "first_seen": "2023-08-14",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}