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

UART event handler continually called with event APP_UART_TX_EMPTY

We are using nRF52832 with SDK_15.3.0 running the Nordic UART service (NUS) example.

Out of the box we find that the uart event handler is continually being called with event APP_UART_TX_EMPTY..   I would  expect that this event would only occur at the point the TX FIFO becomes empty.  

Looking into the source it appears that NRF_DRV_UART_EVT_TX_DONE event is continually being triggered.  I am assuming (and could be wrong) that this  event is set when the UART hardware transmit buffer becomes empty, after the last bit is clocked out.  

My concern is that the uart event handler is a call-back function that ultimately is called from the uart interrupt.  This would indicate that the uart interrupt is continually occurring.  It's as if an interrupt is not being acknowledged in the driver. 

Could someone please confirm this.

How can we prevent the uart event handler being called contrinuously, preferably without modifying the uart driver source?  Is there a setting to enable this event?

  • Problem sorted.  Debug code was sending a byte to the UART, from within the UART interrupt.  Of course sending a byte causes the TXRDY event to occur and triggers another interrupt, which caused the debug code to run....   A circular problem.

    My mistake.  However, the upside is that we will change to using the Serial Port Driver in SDK_15.3.0 and use UARTE.

    Thanks for everyone's suggestions.

Related