+8618758069661 [email protected]
Product Search Guide: space = AND, | = OR, ! = NOT

Why Can Serial Bytes Disappear Without Parity Errors? UART Receive FIFO Overrun

Got any Questions? Call us Today!

+8618758069661

Or leave us a message

Online Message

Why Can Serial Bytes Disappear Without Parity Errors? UART Receive FIFO Overrun

Views: 22 +2Original by FCTELEAuthor: FCTELE Technical Team

UART / RECEIVE OVERRUN

Why can correctly decoded bytes disappear?

A UART can assemble a character correctly and still fail to store it when receive space is full. Timely service must move data onward before storage margin is exhausted. Interrupts and DMA can help, but do not create unlimited capacity. Parity checks, hardware storage and application message completeness answer different questions.

01 · Assemble a character

Functional teaching illustration, no product capacity or measured timing.

The receive shift register collects serial bits into a character before handing it to storage.

02 · A full queue blocks handoff

Functional teaching illustration, no product capacity or measured timing.

In a four-position teaching FIFO, 01–04 fill all positions. The next character can fail handoff; real device policies vary.

03 · Service must keep up

Functional teaching illustration, no product capacity or measured timing.

Interrupts or DMA help move characters, but downstream memory and application consumption are still finite.

Identify the stage

Separate hardware FIFO, driver queue and application buffer in the actual documentation.

Budget character time

At 115200 baud, 8N1, each character takes ten bit times, approximately 86.8 microseconds.

Correlate evidence

Compare known sequence gaps with supported error status and service timing.

Selection and verification checklist — expand
Check What to confirm How to verify
Hardware FIFO depth and error semantics Exact applicable documentation
Service Worst gap, not just average load Controlled traffic and available diagnostics
Outcome Complete ordered messages Sequence, length and checksum records

An instrument’s characters appear to decode correctly and parity errors do not keep increasing, yet the host occasionally misses bytes. The problem can occur after character reception: the UART reconstructs a character, but the receiving system does not remove characters quickly enough. Finite storage fills, and later characters can be lost. This receive overrun is distinct from electrical noise, normal stream fragmentation and an application failing to assemble a complete message. Replacing a network cable is not a universal remedy.

Characters are assembled in a shift register first

A UART is a universal asynchronous receiver/transmitter. Consider an RS485 instrument connected through a serial server. The line transceiver first converts differential electrical states into internal logic signals. The UART then identifies characters using the start bit, configured data bits and stop-bit conditions. An RS485 terminal does not lead straight into a software buffer; electrical reception and sampling occur first.

The receiver shift register is the location assembling the current character. Bits enter according to the receive timing. Once a character is complete, hardware hands it to a receive holding location or FIFO. FIFO means first in, first out: earlier characters are normally read first, so software need not remove every character at the instant it finishes. Register structure, FIFO depth, error status and enable conditions depend on the hardware. The four positions in the teaching illustration are not a Feichang product capacity.

Separate the hardware FIFO, driver memory queue and application receive buffer. They temporarily hold data at different stages, but need not share capacities or error indicators. Enlarging an application array does not automatically enlarge the UART FIFO. A reliable TCP byte stream received on the network side also cannot establish that the earlier serial input lost no characters.

UART receive shift register, FIFO and processor data path
Figure 1. Generic cutaway separating electrical reception, UART character assembly and finite FIFO storage. Silicon shows functions, not a product interior, pinout or actual capacity. Illustration by FCTELE with AI assistance.

Where a new character is blocked when the FIFO is full

Assume a teaching FIFO has four positions and the CPU temporarily reads nothing. Characters 01, 02, 03 and 04 complete and enter the queue in order. No free position remains. Character 05 then finishes in the shift register but cannot be handed normally to the full queue, creating an overrun condition. This example does not turn the fifth byte into a noise-corrupted line character; it illustrates a correctly received character with no available storage position.

UART implementations differ. Some retain existing FIFO contents while subsequent received data cannot be written; further incoming characters may overwrite a receive-shift location. When an error flag is set, how it relates to a character, and how it must be read and cleared require the applicable manual. Do not promise that an overrun loses only the last byte, or transplant one chip’s flag-clearing sequence into every serial server.

A receive trigger threshold is not FIFO capacity. It generally determines when occupancy should request service. A low threshold can prompt earlier processing but generate more requests. A higher threshold can improve batch-transfer efficiency while leaving less margin. Passing the threshold does not itself mean a byte was lost. The full-queue condition and subsequent character handoff still matter.

Turn baud rate into a service-time budget

At 115200 baud with 8N1, one start bit, eight data bits and one stop bit use ten bit times per character. Without extra intercharacter gaps, this is approximately 11520 characters per second, or 86.8 microseconds per character. It is not 115200 eight-bit bytes per second. Other character formats require a different count of transmitted bits.

Continue with an initially empty four-position FIFO and count from the first character’s start boundary. If the CPU never reads, four continuous characters fill the queue in approximately 347.2 microseconds. Completion of the fifth character introduces the next handoff problem. Queue-full time and arrival at an already full queue are separate events. A real observation can begin with a character in flight or existing occupancy, so this interval is not permission for software to sleep safely for that long.

Bursts, simultaneous requests from several ports, temporary interrupt masking and other processor work can all consume margin. Low average CPU utilization does not establish timely service during the busiest short interval. Diagnosis should consider the longest service gap and input rate, rather than one-minute average traffic alone. Reducing baud rate can sometimes ease symptoms; it is a service-margin clue, not proof of a specific cause.

Fifth character cannot enter a full receive FIFO
Figure 2. Teaching four-position FIFO: 01 through 04 occupy all positions; completed 05 cannot be handed off normally. Retention, overwriting and error flags vary by device. Not measured data. Illustration by FCTELE with AI assistance.

How interrupts and DMA help move data

In one common design, the UART requests a CPU interrupt when a condition is met. The driver reads arrived characters during service and transfers them to a memory queue. Issuing a request is not the same as completing a read. Response latency, service code and the amount moved per visit all contribute to the budget. Reading one character and then doing other lengthy work can still exhaust hardware space quickly.

Another implementation uses direct memory access, or DMA, to transfer data into RAM under defined conditions, reducing the CPU’s per-character transfer burden. DMA does not create unlimited memory. Destination buffers, ring positions, completion notifications and application consumption still need correct coordination. Even after UART input overrun is avoided, unprocessed memory data can be overwritten or discarded at the next stage.

Hardware flow control can also help regulate the sender when both interfaces and their configuration support it. Do not transfer the RS232 names RTS/CTS directly to a two-wire RS485 instrument, or expect enabling an option at one end to pause an unsupported instrument automatically. Verify complete-link capability and protocol constraints before changing behavior and inadvertently stopping normal polling.

Error-status read timing also affects interpretation. Some flags clear on register reads, some accompany queued characters and others require a prescribed read order. Clearing every buffer before reporting no current errors may destroy the evidence. Confirm units, accumulation scope and reset behavior of supported diagnostics. If no indicator is accessible, report the observation limit rather than inventing a FIFO-level display.

Later recovery is not data restoration. When the CPU resumes reading, space becomes available and new characters can enter, but previously lost characters do not return automatically. If an upper protocol supports sequence numbers, timeouts and retries, follow those rules to recover the transaction. After changing receive service, repeat the same load and check content, order and application results, not merely a temporarily extinguished error light.

UART-to-memory transfer and CPU consumption have separate roles
Figure 3. UART, RAM and CPU have different duties. DMA can transfer data but does not create unlimited memory; software still must consume it. Generic functional paths, not a model-specific design. Illustration by FCTELE with AI assistance.

Verification that separates overrun from fragmentation and line errors

On a controlled bench, transmit known messages with sequence numbers, lengths and checksums. Record serial-input observations, accessible driver error status and final application data separately. Sequence numbers reveal missing messages and application checksums reveal content anomalies; neither directly reads an internal chip state. Use data and rates appropriate to the equipment, without injecting arbitrary test load into an operating production link.

If raw characters are complete but application read lengths vary, first parse messages from the byte stream. Normal splitting is not an overrun. If hardware reports receive overrun while a known sequence develops gaps, service timing deserves closer investigation. Parity or stop-bit errors call for further format and electrical checks. Multiple faults can coexist, and one combined error count cannot assign them all to the CPU.

Feichang serial-server product information provides a real reference for serial interfaces and network access. This article does not infer UART chips, FIFO depth, DMA or diagnostics from an enclosure or model name. Record model and firmware, character format, load pattern, per-stage counters and observation times, then verify complete operation after recovery. Correct input decoding, timely hardware storage and sustained software consumption are three separate requirements. The absence of parity errors establishes only a limited part of that chain.

Sources and scope

TI AM17x/AM18x UART User Guide — receiver and exceptions · TI TL16C750E — FIFO, status and service · Feichang serial-server product reference (Chinese)

Chip documents establish general mechanisms, not the chip selection or capacity of a Feichang product. Four positions and character numbers are teaching assumptions.

Translated from the Chinese technical article: Read the original Chinese article.

Common questions

Do no parity errors establish that no bytes were lost?

No. Correctly decoded characters can still fail handoff to a full FIFO. Parity does not establish timely storage and service.

Is the FIFO trigger threshold its capacity?

No. A threshold normally requests service; crossing it does not itself establish overrun. Occupancy and later handoff still matter.

Does DMA guarantee no data loss?

No. DMA reduces transfer burden, but target memory and application consumption remain finite. Lost characters do not return automatically.

Further reading

UART bytes and TCP stream boundaries · UART parity error limits

Share this article