Here is a properly structured issue report in professional English.
Project ID
SOFTUART-NRF52-19200-RTT-DEPENDENCY
Subject
Soft UART at 19200 baud works only when RTT logging is enabled
Description
During development of a software UART (bit-banging implementation using nrfx_timer) on the nRF52832 (nRF52 DK), an issue was observed where communication at 19200 baud rate operates correctly only when SEGGER RTT logging is enabled.
When RTT is disabled, the Soft UART receiver experiences frequent framing errors and unstable communication. However, at 9600 baud, communication remains stable regardless of RTT being enabled or disabled.
Observed Behavior
-
9600 baud → Stable with or without RTT
-
19200 baud + RTT enabled → Stable
-
19200 baud + RTT disabled → Frequent framing errors
-
Framing error counter increases continuously when RTT is disabled
Technical Context
-
MCU: nRF52832
-
SDK: nRF Connect SDK v3.1.0
-
Soft UART implemented using:
-
GPIO interrupt for start-bit detection
-
nrfx_timer(TIMER1) for bit sampling
-
-
Sampling is based on calculated bit timing:
-
BIT_TIME_US ≈ 52 µs at 19200 baud
-
FIRST_SAMPLE ≈ 1.5 × bit time (with latency compensation)
-
Root Cause Analysis
The issue is caused by timing instability when RTT is disabled.
RTT logging keeps the CPU more active and prevents aggressive idle/sleep behavior. When RTT is disabled:
-
The system enters low-power idle states more frequently.
-
HFCLK behavior and interrupt latency become less deterministic.
-
Timer-based sampling at 19200 baud becomes sensitive to jitter.
-
Small timing shifts (even a few microseconds) cause incorrect sampling of data or stop bits.
-
This results in framing errors.
At 9600 baud, the bit duration (~104 µs) provides sufficient timing margin to tolerate such jitter. At 19200 baud (~52 µs per bit), the margin is significantly reduced, making the system more sensitive to timing variation.