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

  • Hi Nathan,

     

    Nathan Boyd said:

    To be clear, I don't seem to lose any characters simply by being swamped, and the RX timeout seems to be handled correctly.

    The problem seems to occur when there is a frame error, which results in the Nordic driver disabling RX, which then has to be re-enabled in the application (which is using the async driver interface). This means that not only a single "bad" character is lost, but potentially some others. The problem really seems to be in two parts:

    Thank you for clarifying, this was very helpful for me to understand.

    I believe that the issue is directly related to this function call in our driver:

    https://github.com/nrfconnect/sdk-zephyr/blob/v3.7.99-ncs3/drivers/serial/uart_nrfx_uarte.c#L1408

     

    Right now, we stop the UART RX if a ERRORSRC event occurs, and then have to follow the whole sequence outlined in the zephyr uart.h API:

    https://github.com/zephyrproject-rtos/zephyr/blob/v4.0.0/include/zephyr/drivers/uart.h#L188-L191

    And this causes a larger delay for when you're able to re-enable the uart receiver in the application space.

     

    For testing purposes:

    If you comment out the disable line(uart_nrfx_uarte.c, line 1408), are you able to see improvements on the overall serial communication?

     

    Kind regards,

    Håkon

  • Hello! I am facing the same issue with the NRF54L15 (I have checked it on the nRF54L15-DK).

    I am using UARTE30 on the P0. I use the following configuration:
    1200 bauds, 7 bits, even parity, 1 stop bit.

    I get the framing error, but only when receiving the certain bytes. For example, I send the following ASCII sequence:
    1234567 and always get framing error for the symbols 3, 5, 6. All other symbols are always received correctly.

    This happens only when I use a USB-UART adapter (FTDI232 or CH340, does not matter). However, if I connect RX and TX pins on a DK, so it receives what it sends, everything works fine.

    Did you manage to resolve the issue?

  • Hi,

     

    Your issue sounds like a different one, as this is a consistent behavior on your side, and it also sounds like it is repeatable in a given pattern/configuration. Could you please create a dedicated ticket with this behavior, and please share a sample/full configuration of your setup.

     

    Kind regards,

    Håkon

Related