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

When exactly does NRF_SERIAL_EVENT_TX_DONE get triggered?

If you call nrf_serial_write() once to transmit some data, and before the data from this first call is transmitted, you call nrf_serial_write() again, will the NRF_SERIAL_EVENT_TX_DONE event only be triggered when the entire Tx buffer is empty (i.e., after both messages are transmitted)? Or does it trigger after each individual message (corresponding to each individual call of nrf_serial_write()) is transmitted?

Parents
  • Hi,

    If you call nrf_serial_write() once to transmit some data, and before the data from this first call is transmitted, you call nrf_serial_write() again, will the NRF_SERIAL_EVENT_TX_DONE event only be triggered when the entire Tx buffer is empty (i.e., after both messages are transmitted)?

    The write requests are queued if there is already an ongoing TX transaction. Each pull from the queue after the first TX is completed is treated as a new transaction. So you should get two  NRF_SERIAL_EVENT_TX_DONE, one for each TX transaction you initiated in your example.

  • Thanks Susheel!

    Is there a way to check if the queue is still full? I want to be able to turn off "Transmit Enable" (GPIO to external chip) when TX is done for all messages in the queue. 

    Also, when the queue is being emptied, does it transmit message after message in a continuous stream, or is there idle time between messages? 

Reply Children
Related