Hi,
I am working with the ESB (Enhanced Shockburst) library using the nRF Connect SDK 2.6.1.
The library seems easy to use and has the main things that I need.
However, I want to get RX acknowledgement with specific payload for each transmission. It should be supported by the library, but I have difficulty to get it working.
The very simple sample code (esb_ptx and esb_prx) does not address this since it only acknowledges the first transmission and nothing after that.
The question is that how to reliably acknowledge every transmission, and not just the first one, or some subset.
My basic use case on the RX side is to flush the ack TX buffer (esb_flush_tx()) and re-write it (esb_write_payload(&tx_payload)) before every expected RX (and subsequent ack TX).
Flushing and rewriting the ack TX buffer ensures that I always have current data waiting as a response, whether previous transmission succeeded or not.
But when I do that, then clearly acknowledgement does not reliably happen. Something about the flush makes it not to work.
This old post is giving some context why flushing and rewriting the ack TX buffer is needed, and it is also suggested in the answer.
https://devzone.nordicsemi.com/f/nordic-q-a/22009/modifying-queued-esb-ack-payload
I found old posts about the same/similar problem. These relate to the old SDK, but the problem is the same: flushing makes ack not to happen.
https://devzone.nordicsemi.com/f/nordic-q-a/74008/problem-with-esb-ack-and-tx-flush/306402
https://devzone.nordicsemi.com/f/nordic-q-a/65016/my-esb-ptx-receives-delayed-duplicate-ack-packets-from-my-prx
https://devzone.nordicsemi.com/f/nordic-q-a/27042/esb-on-nrf52-sdk11-not-sending-ack-payloads
There are many others. The last link above is particularly relevant and it suggests a bug in the old SDK which is acknowledged, even offering a fix.
I tried to compare the old SDK code with the current one, but it is difficult. However, I am not convinced that the problem has been fixed.
My question is: Is it possible that this problem is not yet fixed? Is there still some problem with RX acknowledgements related to flushing the TX buffer?
My work-around is the same that is discussed in the posts above: Initializing the whole ESB library (esb_init(&config)) before every RX, but it seems ridiculous.