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

Dynamic switching of prefixes not working with ESB

I am using the '840 to construct a small network using the ESB stack.  In this design, a master (dongle) transmits to each slave and receives an ACK w/payload response.  The ACK payload contains all data coming from the slave (<100 bytes).  The master operates in PTX mode while the slaves are always in PRX mode.  This design uses 8 1 MS time-slots in a 120 Hz frame.  Each slave is configured with a different prefix before operation to provide for individual addressing. The master pings each slave using the assigned prefix over pipe 0, dynamically changing the prefix for each slave as it proceeds.  This design works with a single slave (no prefix changes) but stops working when prefix swapping is enabled.  I get a NRF_ESB_EVENT_TX_SUCCESS event on the master each time it sends the data query but the slave never responds (the ESB event handler never sees a NRF_ESB_EVENT_RX_RECEIVED).  Are there any constraints to when/how the prefix is changed in the '840 radio that might explain this behavior?

  • I've been unable to resolve this issue and have moved to a system where one pipe is used for both RX and TX.  In this system there is a master and multiple slaves.  The master broadcasts a beacon packet that is received by all slaves, this beacon defines time slot 0 and the slaves synchronize to it.  At the end of time slot 0 the master changes to PRX and the slaves to PTX to provide for packet from the slave to the master.  At the end of  the last time slot the modes are again changed with master as PTX and slave as PRX.  All transmissions are NO_ACK so selective ACK is true and packet NO_ACK is true at all times.  I have the beacon in this system working but when I change modes, the radio hangs.  Right now I call nrf_esb_init() each time I change modes (followed by nrf_esb_rx_start() for PRX).  Calling nrf_esb_init() without a change in mode does not hang the system.  Any ideas?

  • I have verified that the master is hung after switching back to PTX from PRX.  In this state there is no NRF_ESB_EVENT_SUCCESS" in ESB event handler despite nrf_esb_write_payload() returning a "SUCCESS" exit code.  When there is no mode swapping I get the NRF_ESB_EVENT_SUCCESS" in the event handler after writing a payload.  I suspect it is waiting for an ACK even though I have SELECTIVE_ACK true and payload NO_ACK true.

  • It may be that the ESB protocol is not what you need. Dynamically changing PTX/PRX mode is not something that is common use case with ESB (there may be race conditions that is not met, that prevent it to work as intended). Maybe you can build your application on the very simple:

    \nRF5_SDK_16.0.0_98a08e2\examples\peripheral\radio

    Best regards,
    Kenneth

Related