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

Problem with ESB ACK and TX Flush

Hello,

I am having an issue where I am trying to send a payload in the ACK in the ESB protocol. The issue is when the PRX gets a payload it was not expecting (i.e anything but a fetch packet), I need to be able to flush the outgoing TX and start over.  If I call nrf_esb_flush_tx(), it does successfully flush the TX FIFO in the NRF_ESB library.  However, the next time a payload needs to be sent in the ACK, the following line from the NRF_ESB library (line #840)

 

if (m_tx_fifo.count > 0 && m_ack_pl_container_entry_point_pr_pipe[NRF_RADIO->RXMATCH] != 0)

becomes false and the m_ack_pl_container never gets cleared of pre-existing payloads.  What ends up happening is, every time a payload gets preloaded in the ACK, the payload that was added before calling nrf_esb_flush_tx, will be sent instead.

The only workaround is by calling nrf_esb_init instead of nrf_esb_flush_tx, to reinitialize all FIFOs.  This feels like a hack.  Do you have other recommendations?

Thanks!

Parents Reply Children
No Data
Related