embedded communication_error ai_generated true

UART framing error: start/stop bit mismatch

ID: embedded/uart-framing-error

Also available as: JSON · Markdown
88%Fix Rate
90%Confidence
3Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
32 active
32 active

Root Cause

UART produces garbage or framing errors. Almost always baud rate mismatch or parity mismatch.

generic

Workarounds

  1. 95% success Verify both sides use identical settings: baud, data bits, stop bits, parity
    Common default: 115200 8N1 (115200 baud, 8 data bits, no parity, 1 stop bit)
  2. 85% success Check clock source accuracy - HSI can drift causing baud errors
    STM32 HSI is +/-1% at 25C but worse at extremes. Use HSE crystal for reliable UART.
  3. 88% success Use oscilloscope or logic analyzer to measure actual bit timing
    Measure shortest pulse; 1/width = actual baud rate

Dead Ends

Common approaches that don't work:

  1. Swap TX and RX wires assuming they are crossed 75% fail

    TX/RX swap produces silence, not framing errors. Framing errors mean data arrives but cannot be decoded.

  2. Add pull-up resistors to TX/RX lines 70% fail

    UART is push-pull, not open-drain. Pull-ups do not fix framing errors.

  3. Increase baud rate for faster communication 82% fail

    The issue is mismatch, not speed. Both sides must agree on identical settings.