Framing Errors seen on nRF54L15 UART. Is it super sensitive to stop bit timing?

Hi,

I am getting framing error notifications from the nrfx uarte driver on a zephyr platform when receiving data from a certain external device, but only when there are large bursts of data.

The data is at 115200bps, 8 bit, no parity, so not particularly fast.

The device I am receiving from has very tight timing (the stop bit is exactly one bit time well within tolerance), and often sends large (multiple hundreds of bytes) streams with no idle time between stop bit and following start bit. This device cannot have its serial settings modified (to increase the number of stop bits to 2 for example).

Looking at the data with both an oscilloscope and a very oversampled logic analyser (which will report formatting problems), the actual data on the line seems fine, but I can't be sure that it is consistent.

When I look at the data received from the driver, I generally just see missing bytes, rather than bad data (with a few exceptions), which seem to come from the data being dropped when the driver cancels the rx, and I suspect that I can't re-enable it fast enough.

As far as I can tell, I have the external oscillator enabled, and constant latency mode enabled, but I am not sure if there is any interplay with the nordic/zephyr code that may be altering this.

I am using the zephyr async API, with a slab buffer with 8 128 byte receive buffers handled, which seems to me to be the highest performing approach.

I have previously seen some UARTs which required ever so slightly more than a single bit time for the STOP before a new START bit, with very similar symptoms to what I have seen here.

My questions are:

  • Is the baud rate divisor in SDK 2.9.1 for 115200 bps still correct? I have noticed that there are forum posts that state that this shouldn't be modified, but also that it doesn't line up with the formula also reported on the forums. Is the special adjusted baud rate divisor only for running from internal RC oscillator (and therefore tuned to it)?
  • Is there a surefire way to disable any change on clock source/latency settings so that I can be sure that I am testing under the correct conditions?

My concern is that effectively the same code was talking to a cellular modem at a much high baud rate with total reliability, suggesting to me that the UARTE hardware might be a bit fussy about stop bit length.

Regards,

Nathan Boyd

Parents
  • Hello Nathan,

    We encountered a very similar issue and had been following this thread closely. In our case, a framing error occurred unexpectedly, and a few bytes were lost in the following frame.

    After analyzing the timing more closely, we noticed that the issue consistently happened when the interval between the end of the current frame and the start of the next frame was close to the configured frame timeout. The behavior then made sense: the RX reception stops and restarts when the frame timeout is triggered - right around the time the next frame begins transmission.

    I'm not certain if this matches the issue you're seeing, but I thought it might be good to share our experience.

    Best regards,

    Sathiya

Reply
  • Hello Nathan,

    We encountered a very similar issue and had been following this thread closely. In our case, a framing error occurred unexpectedly, and a few bytes were lost in the following frame.

    After analyzing the timing more closely, we noticed that the issue consistently happened when the interval between the end of the current frame and the start of the next frame was close to the configured frame timeout. The behavior then made sense: the RX reception stops and restarts when the frame timeout is triggered - right around the time the next frame begins transmission.

    I'm not certain if this matches the issue you're seeing, but I thought it might be good to share our experience.

    Best regards,

    Sathiya

Children
No Data
Related