Hi,

As per the commit a8e1620f3c9f2248e90449ecb6dd65d512ff713d by Anthony Merlino


```The extended address is a read-only attribute and thus an attempt to write 
the extended address should be denied. Instead, the extended address should 
really be either set by the PHY/radio itself, or provided at board bring-up 
time to the radio layer. The MAC layer now pulls in the extended address from 
the radio any time the MAC is reset.```


I am setting the extended address at the board bring-up time before calling 
mac802154_create(). However, after the mac802154_create() it gets back to 
IEEE802154_EADDR_UNSPEC. After reviewing, I found out that 
mac802154_req_reset() calls mac802154_setcoordeaddr(priv, 
IEEE802154_EADDR_UNSPEC); which ultimately calls mrf24j40_setcoordeaddr to 
setup my extended address to IEEE802154_EADDR_UNSPEC. The definition of  
mrf24j40_setcoordeaddr? as mentioned in 
drivers/wireless/ieee802154/mrf24j40/mrf24j40_getset.c? is as


int mrf24j40_setcoordeaddr(FAR struct mrf24j40_radio_s *dev,
                           FAR const uint8_t *eaddr)
{
  int i;

  for (i = 0; i < 8; i++)
    {
      mrf24j40_setreg(dev->spi, MRF24J40_ASSOEADR0 + i, eaddr[i]);
      dev->addr.eaddr[i] = eaddr[i];
    }

  wlinfo("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", eaddr[0], eaddr[1],
         eaddr[2], eaddr[3], eaddr[4], eaddr[5], eaddr[6], eaddr[7]);
  return OK;
}

dev->addr.eaddr must be set by mrf24j40_seteaddr() only. The structure 
mrf24j40_radio_s is missing struct ieee802154_addr_s coordaddr;? which should 
be used to hold values of coordinator short and extended address

In this way, extended address value will not get modified at time of reset

Regards,
Rohail Rasool?

Reply via email to