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

Radio locks in the state of NRF_ESB_STATE_PTX_RX_ACK

Hello, I am trying to broadcast a data among 2 receivers with a special ACK payload. I transmit and gather ACK with one receiver properly yet m_nrf_esb_mainstate locks in NRF_ESB_STATE_PTX_RX_ACK. As I understand from nrf_esb.c after a certain time if no ack is recieved radio must disable itself am I correct?

I can not start transmitting payloads unless m_nrf_esb_mainstate changed to NRF_ESB_STATE_IDLE.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static void on_radio_disabled_tx()
{
// Remove the DISABLED -> RXEN shortcut, to make sure the radio stays
// disabled after the RX window
NRF_RADIO->SHORTS = m_radio_shorts_common;
// Make sure the timer is started the next time the radio is ready,
// and that it will disable the radio automatically if no packet is
// received by the time defined in m_wait_for_ack_timeout_us
NRF_ESB_SYS_TIMER->CC[0] = m_wait_for_ack_timeout_us;
NRF_ESB_SYS_TIMER->CC[1] = m_config_local.retransmit_delay - 130;
NRF_ESB_SYS_TIMER->TASKS_CLEAR = 1;
NRF_ESB_SYS_TIMER->EVENTS_COMPARE[0] = 0;
NRF_ESB_SYS_TIMER->EVENTS_COMPARE[1] = 0;
NRF_PPI->CHENSET = (1 << NRF_ESB_PPI_TIMER_START) |
(1 << NRF_ESB_PPI_RX_TIMEOUT) |
(1 << NRF_ESB_PPI_TIMER_STOP);
NRF_PPI->CHENCLR = (1 << NRF_ESB_PPI_TX_START);
NRF_RADIO->EVENTS_END = 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

And this is my code, a bit sloppy but meh,

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*********************************************************************
* SEGGER MICROCONTROLLER GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 2014 - 2017 SEGGER Microcontroller GmbH & Co. KG *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
-------------------------- END-OF-HEADER -----------------------------
File : main.c
Purpose : Generic application start
*/
#include <stdio.h>
#include <stdlib.h>
#include "sdk_config.h"
#include "nrf_gpio.h"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hello,

    Not sure what the problem is, but a few things to check:

    - If you are using ACK then make sure you are only transmitting from one transmitter to one receiver, otherwise both receivers may ACK the packet, which cause interference between the two ACK packets.

    - If you are receiving a packet (NRF_ESB_EVENT_RX_RECEIVED), then there is no need to call nrf_esb_stop_rx(), as this will stop receive mode and also may prevent outgoing ACK.

    - It might be a good idea to use the example project from the SDK as-is before doing modifications, just to make sure basic functionality works as intended.

    Best regards,
    Kenneth