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
  • Here is a scene appeared quiet easy:

    [CASE]

    16535 ENDRX events and 16536 RXSTARTED events were handled.

    an error was generated while NO.16537 RXSTARTED event was handling.

      

    [call stacks]

    _isr_wrapper -> uarte_nrfx_isr_async -> rx_started_isr -> uart_event_handler -> uarte_nrfx_rx_buf_rsp err: -EBUSY.

      

    [reg tables]

    @before NO.16535 ENDRX event was handled:

    EVENT_ENDRX = 1, EVENT_RXSTARTED = 1, SHORTS = 0x20, INTEN = 0x4A0210, INTENSET = 0x4A0210, INTENCLR = 0x4A0210, RXD.PTR=0x200082D4

    @after NO.16535 ENDRX event was handled:

    EVENT_ENDRX = 0, EVENT_RXSTARTED = 1, SHORTS = 0, INTEN = 0x4A0210, INTENSET = 0x4A0210, INTENCLR = 0x4A0210, RXD.PTR=0x200082D4

      

    @before NO.16536 RXSTARTED event was handled:

    EVENT_ENDRX = 0, EVENT_RXSTARTED = 1, SHORTS = 0, INTEN = 0x4A0210, INTENSET = 0x4A0210, INTENCLR = 0x4A0210, RXD.PTR=0x200082D4

    @after NO.16536 RXSTARTED event was handled:

    EVENT_ENDRX = 0, EVENT_RXSTARTED = 0, SHORTS = 0x20, INTEN = 0x4A0210, INTENSET = 0x4A0210, INTENCLR = 0x4A0210, RXD.PTR=0x200082C0

      

    @before NO.16537 RXSTARTED event was handled:

    EVENT_ENDRX = 1, EVENT_RXSTARTED = 1, SHORTS = 0x20, INTEN = 0x4A0210, INTENSET = 0x4A0210, INTENCLR = 0x4A0210, RXD.PTR=0x200082C0

    Here is a  doubt:

    After Rx is enabled, in most cases ENDRX generated first and RXSTARTED generated right behind ENDRX.

    But now RXSTARTED event generated before ENDRX, and ENDRX generated right behind RXSTARTED.

    Thus ISR missed to handling ENDRX, just went to handle RXSTARTED first.

    @after NO.16536 RXSTARTED event was handling with  [CASE]:

    EVENT_ENDRX = 1, EVENT_RXSTARTED = 0, SHORTS = 0x20, INTEN = 0x4A0210, INTENSET = 0x4A0210, INTENCLR = 0x4A0210, RXD.PTR=0x200082C0

     

Reply
  • Here is a scene appeared quiet easy:

    [CASE]

    16535 ENDRX events and 16536 RXSTARTED events were handled.

    an error was generated while NO.16537 RXSTARTED event was handling.

      

    [call stacks]

    _isr_wrapper -> uarte_nrfx_isr_async -> rx_started_isr -> uart_event_handler -> uarte_nrfx_rx_buf_rsp err: -EBUSY.

      

    [reg tables]

    @before NO.16535 ENDRX event was handled:

    EVENT_ENDRX = 1, EVENT_RXSTARTED = 1, SHORTS = 0x20, INTEN = 0x4A0210, INTENSET = 0x4A0210, INTENCLR = 0x4A0210, RXD.PTR=0x200082D4

    @after NO.16535 ENDRX event was handled:

    EVENT_ENDRX = 0, EVENT_RXSTARTED = 1, SHORTS = 0, INTEN = 0x4A0210, INTENSET = 0x4A0210, INTENCLR = 0x4A0210, RXD.PTR=0x200082D4

      

    @before NO.16536 RXSTARTED event was handled:

    EVENT_ENDRX = 0, EVENT_RXSTARTED = 1, SHORTS = 0, INTEN = 0x4A0210, INTENSET = 0x4A0210, INTENCLR = 0x4A0210, RXD.PTR=0x200082D4

    @after NO.16536 RXSTARTED event was handled:

    EVENT_ENDRX = 0, EVENT_RXSTARTED = 0, SHORTS = 0x20, INTEN = 0x4A0210, INTENSET = 0x4A0210, INTENCLR = 0x4A0210, RXD.PTR=0x200082C0

      

    @before NO.16537 RXSTARTED event was handled:

    EVENT_ENDRX = 1, EVENT_RXSTARTED = 1, SHORTS = 0x20, INTEN = 0x4A0210, INTENSET = 0x4A0210, INTENCLR = 0x4A0210, RXD.PTR=0x200082C0

    Here is a  doubt:

    After Rx is enabled, in most cases ENDRX generated first and RXSTARTED generated right behind ENDRX.

    But now RXSTARTED event generated before ENDRX, and ENDRX generated right behind RXSTARTED.

    Thus ISR missed to handling ENDRX, just went to handle RXSTARTED first.

    @after NO.16536 RXSTARTED event was handling with  [CASE]:

    EVENT_ENDRX = 1, EVENT_RXSTARTED = 0, SHORTS = 0x20, INTEN = 0x4A0210, INTENSET = 0x4A0210, INTENCLR = 0x4A0210, RXD.PTR=0x200082C0

     

Children
No Data
Related