This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UARTE missed ISR ENDRX or generated excess ISR RXSTARTED

[Environment]

nrf52833 chip, NCS 1.6.0

using uarte 1 with async API, baudrate 1Mbps, CONFIG_UART_1_NRF_HW_ASYNC=y and CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2.

using ring buffer put in user callback.

Relate page but not answered: devzone.nordicsemi.com/f/nordic-q-a/78419/zephyr-uarte-library-missing-uart_rx_buf_released-events

[CASE]

set rx dma buffer size 20 bytes, timeout 5ms. (PS: small value to catch CASE easiler, lager value can reduce the probability of CASE but still happen.)

sent plenty of bytes to uarte1 rx, minutes later we catched a case:

6748 ENDRX events generated and handled.

6750 RXSTARTED events generated and 6749 were handled.

The No. 6750 RXSTARTED event was failed to handle while @uart_nrfx_uarte: uarte_nrfx_rx_buf_rsp() was called an return with error -16 (-EBUSY), whtich means rx_next_buf is not empty.

In other words, UARTE1 generated an excess RXSTARTED event or missed an ENDRX event.

Parents
  • I reproduced the [CASE] in the NCS 1.6.0 sample: nrd/samples/bluetooth/peripheral_uart.

    Here are the environment:

    1. modify *.overlay:

        set uart1 baudrate 1Mbps for data tx/rx, and uart0 921600 for logging.

    2. modify prj.conf:

        CONFIG_NRFX_UARTE1=y, CONFIG_UART_1_NRF_HW_ASYNC=y, CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2.

        CONFIG_HEAP_MEM_POOL_SIZE=4096

        CONFIG_USE_SEGGER_RTT=n, CONFIG_LOG_BACKEND_RTT=n, CONFIG_LOG_BACKEND_UART=n.

    3. modify nrf/samples/bluetooth/peripheral/src/main.c:

        comment out ble related function call in main().

        set uart_init() binding to uart1.

        set UART_BUF_SIZE=20U and UART_WAIT_FOR_RX=5U;

        create thread rx_task() to count total recv bytes and release buffer.

        create thread tx_task() to send bytes as 20Byte 20Hz and count send bytes.

        check the return value of uart_rx_buf_rsp() function.

    4. run this sample on DK board.

    5. send 267 bytes string to uarte1 rx in 100Hz.

    6. Minutes later, An error return from uart_rx_buf_rsp() and them uarte1 rx always missed bytes in recving string.

Reply
  • I reproduced the [CASE] in the NCS 1.6.0 sample: nrd/samples/bluetooth/peripheral_uart.

    Here are the environment:

    1. modify *.overlay:

        set uart1 baudrate 1Mbps for data tx/rx, and uart0 921600 for logging.

    2. modify prj.conf:

        CONFIG_NRFX_UARTE1=y, CONFIG_UART_1_NRF_HW_ASYNC=y, CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2.

        CONFIG_HEAP_MEM_POOL_SIZE=4096

        CONFIG_USE_SEGGER_RTT=n, CONFIG_LOG_BACKEND_RTT=n, CONFIG_LOG_BACKEND_UART=n.

    3. modify nrf/samples/bluetooth/peripheral/src/main.c:

        comment out ble related function call in main().

        set uart_init() binding to uart1.

        set UART_BUF_SIZE=20U and UART_WAIT_FOR_RX=5U;

        create thread rx_task() to count total recv bytes and release buffer.

        create thread tx_task() to send bytes as 20Byte 20Hz and count send bytes.

        check the return value of uart_rx_buf_rsp() function.

    4. run this sample on DK board.

    5. send 267 bytes string to uarte1 rx in 100Hz.

    6. Minutes later, An error return from uart_rx_buf_rsp() and them uarte1 rx always missed bytes in recving string.

Children
Related