This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf_drv_uart & RXTO

Hi,

I'm working with UARTE using a receipt timeout. So far so good, I tweaker nrf_drv_uart to get notified upon RXDRDY interrupt (char received but not yet DMA transfered). I stop/start a timer when receiving the event. My timer handler performs a nrf_drv_uart_rx_abort() to trigger a RXTO (and corresponding ENDRX), it works correctly for that part.

Now comme the (2) issues :

  • No RXTO interrupt is generated (I breakpointed in uart_irq_handler from the driver). I correctly get the ENDRX with partial buffer (which is ignored by driver, I guess it's to have it handled by the RXTO part), but no RXTO interrupt comes after (It is enabled, see interrupts_enable + I added an assert on it)
  • Second issue (at a first sight) is that driver seems to be broken anyway on partial rx. It only forward endrx and update its buffers based on "amount" var, which contains number of bytes transfered since last endrx (not the absolute count of bytes in the receipt buffer). This mean that the buffers actually used by underlying UARTE and those maintained in the drivers are out of sync leading to rather unpredictable results

Hope some NordicSemi guy can shed some light…

  • I confirm that there's a bug in the driver, independent from the fact that RXTO never seem to get triggered. In case of partial RX, UARTE switches on second buffer, but not the driver layer. In the following scenario (pseudo-code): rx_start(buf1); rx_start(buf2); [partial rx] => ignored by drv [full rx] => drv provides buf1 to handler whereas UARTE stored data in buf2

    Issue would be the same if RXTO was correctly triggered since it doesn't swap buffers neither.

    Still no clue about why RXTO doesn't get triggered.

Related