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 abccc6626ffaa4d9645af8848dee96abbd087303
Author: raiden00pl <[email protected]>
AuthorDate: Fri Oct 16 18:56:27 2026 +0200

    arch/arm/nrf52: default extended address from FICR
    
    The extended address was all zeros on every node. Build a unique default
    from the Nordic OUI and the FICR device identifier, as the Zephyr nRF5
    802.15.4 driver does (IEEE 802.15.4-2011 4.1, macExtendedAddress).
    
    Assisted-by: Claude Code
    Signed-off-by: raiden00pl <[email protected]>
---
 arch/arm/src/nrf52/nrf52_ieee802154.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm/src/nrf52/nrf52_ieee802154.c 
b/arch/arm/src/nrf52/nrf52_ieee802154.c
index 0e3d3d3ac58..4c5e6934bd5 100644
--- a/arch/arm/src/nrf52/nrf52_ieee802154.c
+++ b/arch/arm/src/nrf52/nrf52_ieee802154.c
@@ -35,6 +35,9 @@
 
 #include <nuttx/mm/iob.h>
 
+#include "arm_internal.h"
+#include "hardware/nrf52_ficr.h"
+
 #include "nrf52_ieee802154_trace.h"
 
 #include "nrf52_ieee802154_priv.h"
@@ -294,6 +297,29 @@ static int nrf52_radioi8_bind(struct ieee802154_radio_s 
*radio,
   return OK;
 }
 
+/****************************************************************************
+ * Name: nrf52_radioi8_eui64
+ *
+ * Description:
+ *   EUI-64 from the Nordic OUI and the FICR device identifier.
+ *
+ ****************************************************************************/
+
+static void nrf52_radioi8_eui64(uint8_t *eaddr)
+{
+  uint32_t id0 = getreg32(NRF52_FICR_DEVICEID0);
+  uint32_t id1 = getreg32(NRF52_FICR_DEVICEID1);
+
+  eaddr[0] = 0xf4;
+  eaddr[1] = 0xce;
+  eaddr[2] = 0x36;
+  eaddr[3] = id1 & 0xff;
+  eaddr[4] = (id1 >> 8) & 0xff;
+  eaddr[5] = (id1 >> 16) & 0xff;
+  eaddr[6] = (id1 >> 24) & 0xff;
+  eaddr[7] = id0 & 0xff;
+}
+
 /****************************************************************************
  * Name: nrf52_radioi8_reset
  *
@@ -318,6 +344,10 @@ static int nrf52_radioi8_reset(struct ieee802154_radio_s 
*radio)
 
   memset(&dev->state, 0, sizeof(struct nrf52_radioi8_state_s));
 
+  /* Unique default extended address */
+
+  nrf52_radioi8_eui64(dev->state.addr.eaddr);
+
   /* Initialize radio in IEEE 802.15.4 mode */
 
   ret = dev->radio->ops->reset(dev->radio);

Reply via email to