Tutorials
How Long Can an RP2040 UART RX Interrupt Wait at 115200 Baud?
Published · Updated
Increasing the software receive queue helps only after bytes have left the UART hardware. A short interrupt blackout can still overflow the hardware FIFO before the queue gets a chance to accept a byte.
Budget the empty FIFO entries at the instant service is delayed

On the RP2040 UART, confirm FIFO mode and the receive interrupt trigger level. Use the number of entries still available at the start of the delay. A byte already in the shifter and an ongoing frame make the exact phase uncertain.
Also check whether the transmitter can send continuously, whether flow control is wired, and when the software can actually drain the FIFO. ISR entry alone does not remove any data.
Calculate asynchronous baud rate error · Budget FIFO capacity during a service stall
Convert spare entries into a maximum contiguous delay

A continuous 115200-baud link using one start bit, eight data bits, no parity and one stop bit occupies ten bit times per byte. That gives roughly 86.8 µs per received byte. If sixteen entries remain available, sixteen arriving bytes occupy about 1.39 ms.
A 2 ms critical section can exceed that allowance. Leave margin for a partially received frame and scheduling jitter. Exercise the receiver with a continuously numbered pattern and record both the UART overrun indication and gaps in the application sequence.
Will a larger software queue fix repeated UART overrun errors?
Only if the software queue is the limiting stage. Shorten the hardware service gap, use an appropriate DMA configuration or arrange end-to-end hardware flow control when the UART FIFO overflows first.
Replay the worked example

- 8N1 frame · 10 / 115,200 · 86.8 µs per byte
- 16 spare entries · 16 × 86.8 µs · 1.39 ms
- 2 ms unserviced · 2 ms / 86.8 µs · About 23 byte times
Separate throughput from transaction latency · Capture the first rejected FIFO write
Work through a sensor FIFO watermark.
Raspberry Pi RP2040 Datasheet, 4.2 UART.
Photograph credit and licence
Dilshan Jayakody from Maharagama, Sri Lanka (Wikimedia Commons), CC BY-SA 2.0. Site-sized copy.
Original photograph https://commons.wikimedia.org/wiki/File:8_Channel_USB_logic_analyzer_(5172098012).jpg
Licence https://creativecommons.org/licenses/by-sa/2.0
Back to Tutorials