Can I copy the ESB code from SDK v3.3.0-preview3 into SDK v2.9.0, and then get the functionality in esb_ptx_ble & esb_prx_ble?
Is there any way to achieve it quickly?
Can I copy the ESB code from SDK v3.3.0-preview3 into SDK v2.9.0, and then get the functionality in esb_ptx_ble & esb_prx_ble?
Is there any way to achieve it quickly?
Hi Leo,
You can try to reset the radio using the POWER register, write 0 then 1, and then re-configure the radio:
https://docs.nordicsemi.com/r/bundle/ps_nrf52840/page/radio.html?section=register.POWER
Kenneth
Hi Kenneth,
Thanks!
Yes, I can do that, but the key point is when to re-configure the radio, because TX devices only broadcasts data when a critical event occurs, so RX devices can only re-configure the radio when a error code occurs. Currently, I will reset MCU when an error code occurs.
By the way, why does the ESB of nRF Connect SDK v3.3 no longer have the options of 125Kbits and 250Kbits?
Leo Mo
Hi Leo,
Kenneth is currently on PTO. I will follow up this case and get you an answer to the latest question, but I will need a little while to get up to speed here.
I'll get back to you before the weekend.
Kind regards,
Andreas
Hello AHaug,
Thanks!
Another question is why sending 8 bytes, 16 bytes, and 32 bytes takes about the same amount of time? Is it time-consuming to prepare before sending?
ESB_MPSL_TIMESLOT and ESB_NEVER_DISABLE_TX cannot be set to y at the same time.
Is there any way to reduce the preparation time before launch.


while (1) {
err = esb_initialize();
if (err) {
LOG_ERR("ESB initialization failed, err %d", err);
return 0;
}
tx_payload.length = 32;
for (int i = 0; i < 3; i++) {
tx_count += !esb_write_payload(&tx_payload);
}
while (!esb_is_idle());
k_sleep(K_MSEC(100));
esb_disable();
seq_num++;
tx_payload.data[6] = seq_num & 0xFF;
tx_payload.data[5] = (seq_num >> 8) & 0x7F;
tx_count = 0;
k_sleep(K_MSEC(1000));
}Hi Leo,
Leo Mo said:Another question is why sending 8 bytes, 16 bytes, and 32 bytes takes about the same amount of time? Is it time-consuming to prepare before sending?
There is a payload discrepancy, it is just very small.
Looking at your snippet, this stems from your code snippet mainly. As you can see in the image, the period where you do TX differs from the 3 images, but the sleep time in between each operation is so large compared to the Tx window that it is hard to notice. Measure this window instead of the pause to see the actual difference of the TX time.

Roughly summarized what each cycle is
The payload is the only part of the transaction that scales with size.
The time between the packs you queue up is governed by esb_config.retransmit_delay, not by payload length. In the NCS samples that is typically ~600 µs. Three packets at that spacing is your largest contributor to on-air time, and it's identical whether each is 8 or 32 bytes.
Is this test set up to do initialization every time before each pack? If this is not a test case, then the following might improve the time used for preparation in between each burst.
esb_initialize() out of the loop. Re-initializing every iteration reconfigures the radio and can force an HFCLK cold start. The initialization is the plateau you see in between each TXesb_disable() between bursts unless you need the radio released, since disabling can drop HFCLK and you re-pay the crystal ramp next time.Kind regards,
Andreas