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

Trouble with Ack payloads, nrf51822 to nrf24L01+

Hello all!

I'm having a bit of trouble with complete communication between an nrf51 DK running the micro esb wireless uart example and an nrf24L01+ which is running TMRh20/maniacbug's RF24 library for arduino.

Any packet I send from the RF51 DK successfully is picked up and acted on by my nrf24l01+, however, there seems to be trouble with the ACK being sent back to the 51422. The event handler on the wireless uart example will only ever execute the 'transmission failed' portion of uesb_event_handler, even though I can see data coming through on the other side.

Current register configuration for the nrf24:

STATUS.. = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=1
RX_ADDR_P0-1. = 0xf0f0f0f0e1 0xf0f0f0f0d2
RX_ADDR_P2-5. = 0xc3 0xc4 0xc5 0xc6
TX_ADDR.. = 0xf0f0f0f0e1
RX_PW_P0-6. = 0x0c 0x0c 0x00 0x00 0x00 0x00
EN_AA.. = 0x3f
EN_RXADDR. = 0x02
RF_CH.. = 0x05
RF_SETUP. = 0x07
CONFIG.. = 0x0f
DYNPD/FEATURE. = 0x3f 0x07
Data Rate. = 1MBPS
Model.. = nRF24L01+
CRC Length. = 16 bits
PA Power. = PA_MAX

Configuration for the nrf51 DK:

uint8_t rx_addr_p0[] = {0xD2, 0xF0, 0xF0, 0xF0, 0xF0};
uint8_t rx_addr_p1[] = {0xE1, 0xF0, 0xF0, 0xF0, 0xF0};
uint8_t rx_addr_p2   = 0x66;    

uesb_config_t uesb_config       = UESB_DEFAULT_CONFIG;
uesb_config.rf_channel          = 5;
uesb_config.crc                 = UESB_CRC_16BIT;
uesb_config.retransmit_count    = 6;
uesb_config.retransmit_delay    = 500;
uesb_config.dynamic_ack_enabled = true;
uesb_config.protocol            = UESB_PROTOCOL_ESB_DPL;
uesb_config.bitrate             = UESB_BITRATE_1MBPS;
uesb_config.event_handler       = uesb_event_handler;

Code for nrf51 DK (main.c) and arduino + nRF24L01+ (51to24.ino) are also attached for reference. Any ideas what I'm doing wrong? I'm guessing it must be some ack setting on the 24 side, but am not quite sure how to address the problem.

Thanks!

main.c

51to24.ino

  • I seem to have found the solution. In the latest github release of the micro-esb library, the polarity of the NOACK bit was reversed. Reverting to the previous commit in micro-esb.c fixed my problem.

    Steps:

    1.) in the start_tx_transaction() function change

    m_tx_payload_buffer[1] = m_pid << 1 | ((ack == 0 && m_config_local.dynamic_ack_enabled) ? 0x00 : 0x01);
    

    to

    m_tx_payload_buffer[1] = m_pid << 1 | ((ack == 0 && m_config_local.dynamic_ack_enabled) ? 0x01 : 0x00);
    

    around line #327

    2.) in the on_radio_disabled_esb_dpl_rx() function change

    if (1 == (m_rx_payload_buffer[1] & 0x01))
    {
          send_ack = true;
    }
    

    to

    if (0 == (m_rx_payload_buffer[1] & 0x01))
    {
          send_ack = true;
    }
    

    around line #746

  • I just stumbled across this issue, too and wondered why Nordic did this change and break compatibility with nRF24 devices. It still is like this in the SDK 15.3 ESB implementation. It's a bit of a shame that the known issues of the nrf_esb component were never addressed.

Related