This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 773737a3a8cac96e366a0ac8a526dab4f9c7172e
Author: raiden00pl <[email protected]>
AuthorDate: Sat Oct 17 12:31:28 2026 +0200

    arch/arm/nrf52: restart an active receiver on a channel change
    
    Setting the channel only wrote FREQUENCY. A receiver that was already
    enabled kept receiving on the previous channel, so a coordinator that
    was in RX when its channel was set did not receive the association
    requests and the devices got NO_ACK on every channel except the reset
    default. Restart RX after the channel change when it is active, as the
    Nordic nrf_802154 driver does on a channel update.
    
    Assisted-by: Claude Code
    Signed-off-by: raiden00pl <[email protected]>
---
 arch/arm/src/nrf52/nrf52_ieee802154_radio.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/arch/arm/src/nrf52/nrf52_ieee802154_radio.c 
b/arch/arm/src/nrf52/nrf52_ieee802154_radio.c
index 62026eab161..183ee1d0df5 100644
--- a/arch/arm/src/nrf52/nrf52_ieee802154_radio.c
+++ b/arch/arm/src/nrf52/nrf52_ieee802154_radio.c
@@ -809,11 +809,31 @@ static int nrf52_radioi8_setchannel(struct 
nrf52_radioi8_dev_s *dev,
 {
   struct nrf52_radio_dev_s *lower = NULL;
   uint32_t                  freq  = 2405 + 5 * (chan - 11);
+  int                       ret;
 
   DEBUGASSERT(dev);
   lower = dev->radio->lower;
 
-  return NRF52_RADIO_FREQSET(lower, freq);
+  ret = NRF52_RADIO_FREQSET(lower, freq);
+  if (ret < 0)
+    {
+      return ret;
+    }
+
+  /* Restart an active receiver on the new channel */
+
+  if (dev->radio->state.state == NRF52_RADIO_STATE_RX &&
+      dev->radio->state.rxenabled)
+    {
+      dev->radio->ops->rxenable(dev, false);
+
+      while (NRF52_RADIO_GETREG(lower, NRF52_RADIO_STATE_OFFSET) !=
+             RADIO_STATE_DISABLED);
+
+      dev->radio->ops->rxenable(dev, true);
+    }
+
+  return OK;
 }
 
 /****************************************************************************

Reply via email to