Intermittent Uart Frame Errors

Hello,

I'm running an nrf52832 (fanstel module) communicating over UART with another MCU at 460800 baud. The Uarts both have matching configurations. The baud rates are both set to 460800 using the internal clocks. The UART implementation is similar to the implementation here: https://github.com/nrfconnect/sdk-nrf/blob/main/samples/bluetooth/central_uart/src/main.c however it incorporates a ring buffer.

The UART is receiving a fairly constant stream of data and regularly gets two UART_RX_STOPPED interrupts in a row with reason framing error and then a UART_RX_DISABLED. I've attempted running at lower baud rates of 115200 and 230400 as well with no improvement.

I've analyzed the data sent with a logic analyzer and found that the LA had no errors reading the same uart frames that caused a frame error.

Parents
  • Hello, I located the issue.

    tldr: Need to enable HW async and timer

    CONFIG_UART_0_ASYNC=y
    CONFIG_UART_0_NRF_HW_ASYNC=y
    CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2
    CONFIG_NRFX_TIMER2=y

    The issue stems from the async uart not being fast enough without a timer to assist as described here:docs.nordicsemi.com/.../CONFIG_UART_0_NRF_HW_ASYNC.html

    It really seems like this should be enabled by default if you use the async uart on nordic or possibly a warning when your device tree sets the baud rate to a higher speed. Feels like handling this with sw would be the fallback if you don't have timers to allocate to the task.

    Thank you for your replies. I appreciate the assistance.

Reply
  • Hello, I located the issue.

    tldr: Need to enable HW async and timer

    CONFIG_UART_0_ASYNC=y
    CONFIG_UART_0_NRF_HW_ASYNC=y
    CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2
    CONFIG_NRFX_TIMER2=y

    The issue stems from the async uart not being fast enough without a timer to assist as described here:docs.nordicsemi.com/.../CONFIG_UART_0_NRF_HW_ASYNC.html

    It really seems like this should be enabled by default if you use the async uart on nordic or possibly a warning when your device tree sets the baud rate to a higher speed. Feels like handling this with sw would be the fallback if you don't have timers to allocate to the task.

    Thank you for your replies. I appreciate the assistance.

Children
No Data
Related