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

Possible error in nRF5 SDK for ESB DPL transmissions with "selective auto ack" (

Hi folks,

I've found no beeter way of reporting this (no public SDK repo which allows issues with code reference).

I tried to TX ESB DPL frames from an nRF52840 to different versions of nRF24. The frames made it on air, but didn't get acknowledged.

To make a long story short, I assume the following code in  `nrf_esb.c` is wrong:

static void start_tx_transaction()
{
    ...snip...

    switch (m_config_local.protocol)
    {
        case NRF_ESB_PROTOCOL_ESB:
            ...snip...
            break;

        case NRF_ESB_PROTOCOL_ESB_DPL:
            ... snip ...
            // note: noack shouldn't be negated befor OR'ing onto S1 field
            //m_tx_payload_buffer[1] |= mp_current_payload->noack ? 0x00 : 0x01;
            m_tx_payload_buffer[1] |= mp_current_payload->noack ? 0x01 : 0x00;

            memcpy(&m_tx_payload_buffer[2], mp_current_payload->data, mp_current_payload->length);

... snip ...

The unmodified code leads to RF frames with "no ack" bit in PCF set if the "noack" bool in the `nrf_esb_payload_t` struct is false.

So the flag is effectivly negated, leading to unintended behavior in PTX mode with selective acknowledgement.

Regards,

Marcus

Parents Reply Children
  • The forum thread didn't add up much for clarification, thus I try to sum up in my own words ...

    Setting the `noack` bool on a `nrf_esb_payload_t` struct to true results in a RF frame with 'no ack' bit unset in PCF (or S1 field if you like better) after TX. This could be inspected with SDR or whatever you like, no need to use another peer, with (in)compatible chipset. If this is intended behavior, we could close this issue immediately (although IMO this is weird). BUT if setting the `noack` bool of `nrf_esb_payload_t` to true should result in a RF frame with `no ack` bit set, the line of code highlighted in the initial post has to be changed.

    Nothing complicated here ... the simple  question is: Should the application layer logic (nrf_esb_payload_t) be consistent with the RF layer (no ack bit of RF frame) or should it not?

    If it should not be consistent, which isn't the natural expectation, I'd be happy to receive a link to proper documentation.

  • The ESB library in nRF5 SDK have been fully tested with the nRFgo SDK v2.3.0 (nRF24L-series), and all modes verified to work. So it should not be a problem here as long as the same mode is used on both transmitter and receiver, and you do the following:
    http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v14.0.0%2Fesb_users_guide.html&cp=4_0_0_5_0_2&anchor=esb_backwards 

    It is important that the same mode is used on both transmitter and receiver, because once you enable the FEATURE->EN_DYN_ACK bit, then the behavior of the NO_ACK bit is reversed; '0' means NOACK, '1' means ACK.

    Best regards,
    Kenneth

Related