To achieve the maximum transfer rate over ESB, I added the following expression to the ESB initialization function:
NRF_RADIO->MODECNF0 = (NRF_RADIO->MODECNF0 & ~RADIO_MODECNF0_RU_Msk) | RADIO_MODECNF0_RU_Fast << RADIO_MODECNF0_RU_Pos;
uint32_t esb_init (void)
{
uint32_t err_code;
nrf_esb_set_rf_channel(32); // 2450 Mhz, for 2 Mbit is -+320 kHz
nrf_esb_config_t nrf_esb_config = NRF_ESB_DEFAULT_CONFIG;
nrf_esb_config.retransmit_count = 1;
nrf_esb_config.tx_output_power = NRF_ESB_TX_POWER_8DBM;
nrf_esb_config.selective_auto_ack = true;
nrf_esb_config.protocol = NRF_ESB_PROTOCOL_ESB_DPL;
nrf_esb_config.bitrate = NRF_ESB_BITRATE_2MBPS;
nrf_esb_config.payload_length = NRF_ESB_MAX_PAYLOAD_LENGTH;
nrf_esb_config.event_handler = nrf_esb_event_handler;
nrf_esb_config.retransmit_delay = 2000;
#ifdef MODE_PRX
nrf_esb_config.mode = NRF_ESB_MODE_PRX;
#else
nrf_esb_config.mode = NRF_ESB_MODE_PTX;
#endif
nrf_esb_init(&nrf_esb_config);
nrf_esb_set_base_address_0(base_addr_0);
nrf_esb_set_base_address_1(base_addr_1);
nrf_esb_set_prefixes(addr_prefix, 8);
NRF_RADIO->MODECNF0 = (NRF_RADIO->MODECNF0 & ~RADIO_MODECNF0_RU_Msk) | (RADIO_MODECNF0_RU_Fast << RADIO_MODECNF0_RU_Pos);
return NRF_SUCCESS;
}
This really helped to raise the speed to 1700 kbit/s from PTX to PRX in ideal communication conditions and a packet length of 252 bytes.
But abnormal behavior with reverse packets from PR Xto PTX. The length of the return packet cannot exceed 199 - 205 bytes (depending on the implementation of the test program). If the length of the return packet does not exceed this value, then it reaches normally, if it exceeds it, then it is not a packet from PRX that turns out to be a pinned packet in PTX, but its own, which it sent (it looks incredible, so I can't understand what is happening for a long time). If I perform initialization without additional radio settings for fast switching, then everything is fine, the return packets can be the full length of 252 bytes.
What additional configuration should be done so that the return packets are received normally?