HI!
I'm using two nRF52840 boards to communicate using ESB. The ESB API doesn't have a pairing protocol so I figured I'd write one without encryption or any bells and whistles.
Since ESB has 8 pipes, with pipe 0 having its own base address, I'm using that as a default pairing address. Once the device is put into "pairing mode", a PTX device sends a payload on pipe 0 to the PRX device, also in pairing mode. It's listening for messages on pipe 0. Once it receives a message on this pipe, it sends back a payload with its own base 1 address. So far, that has been working.
It gets odd when the PTX device wants to change its own address for pipes 1-7 (base address 1). I store the new address into the same array used to initialize the ESB. Then I call
nrf_esb_set_base_address_1(base_addr_1); nrf_esb_set_prefixes(addr_prefix, 8);
base_addr_1 contains the new base 1 address gotten from the PRX device.
However, at some point on the PTX device, the base_addr_1 array gets changed back to the address that was used to set it up in esb_init.
Is there some other function I'm missing that I need to call to change to address? I know that the address can change as because I ran a test with the example ESB code so that the address changes from two separate addresses on the device to the same address. The results were that, at first the packets weren't received, but then after enough packets, the address changes and the packets are received.
Maybe it's something simple that I'm missing or something elsewhere in my code. My question is, what could cause the base_addr_1 value to go back to its default value?
Thanks!