ESB anomaly when using Fast ramp-up

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?

  • Clarification: 1700 kbit/s is without reverse packets. Reverse packets will certainly reduce the speed. Here the question is not in getting the maximum speed, but in the abnormal behavior of the ESB protocol with the enabled setting fast ramp-up.

    How to get rid of it? In reality, my ACK packets rarely contain a payload, but when it is present, its length is 252 bytes, and this anomaly prevents me from working.

  • Hi

    The ESB library hasn't been tested for use with fast mode, so possibly there is some timing issues that could pop up in this case. 

    You have checked that receiving 252 byte ACK payloads work fine without this change?

    You could try to increase the RX_ACK_TIMEOUT_US_2MBPS parameter, but it doesn't really make logical sense that you would have to increase this when using faster startup. 

    Possibly the issue is caused by the preparation of the ACK payload taking too much time when you have a long payload and a fast startup, since the MCU has much less time before the radio expects a packet to be ready. 

    Best regards
    Torbjørn

Related