# UART: CTS flow control timeout, transmission stalled on USART2

- **ID:** `embedded/uart-cts-flow-control-timeout`
- **Domain:** embedded
- **Category:** communication_error
- **Error Code:** `0x00020001`
- **Verification:** ai_generated
- **Fix Rate:** 89%

## Root Cause

UART CTS (Clear to Send) line held high by remote device or stuck due to hardware fault, causing transmitter to wait indefinitely.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| STM32F405 HAL 1.8.0 | active | — | — |
| Zephyr RTOS 3.6.0 | active | — | — |

## Workarounds

1. **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); }** (87% success)
   ```
   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); }
   ```
2. **Add a pull-down resistor on CTS line to force low in case of floating signal; measure CTS voltage with oscilloscope.** (92% success)
   ```
   Add a pull-down resistor on CTS line to force low in case of floating signal; measure CTS voltage with oscilloscope.
   ```

## Dead Ends

- **** — Disabling hardware flow control entirely may cause data loss; it is not a fix for CTS timeout but a workaround that changes protocol. (75% fail)
- **** — Increasing UART baud rate does not resolve CTS line stuck high; the issue is external signal, not internal timing. (90% fail)
