NRF5340: Read FICR.DEVICEADDR and set BLE MAC random address

Hi all,

NRF5340
NRF Connect 2.6.0

We would like to perform the following operations on the NRF5340:
* Read FICR.DEVICEADDR (BLE random MAC is also fine).
* Set the BLE address with type random.

Seems the FICR.DEVICEADDR is only accessible by the network core, which AFAIK is not documented anywhere in the PS. So need to call bt_enable first to get the random MAC address either via bt_id_get or bt_read_static_addr.

However, using bt_id_create after BLE has been started does not apply the new MAC address for BLE comms. There seems to be a workaround for setting the public address at runtime, but this doesn't work for random. The HCI command returns SUCCESS though.
devzone.nordicsemi.com/.../setting-nrf5340-public-ble-address

Is there a solution for this specific use case?

Parents Reply Children
  • End goal is to use the chip random address as MAC for both BLE and Ethernet. Both have certain requirements for the MAC address format:

    *BLE: 2 most significant bits of the 48 bit MAC address must be set to 1 to identify the address as a Random Static Address.

    *Ethernet: Similar story for uni/multicast / local/global addresses: 

        en.wikipedia.org/.../MAC_address

    We are aware about the inprobable address conflict.

  • Seems the FICR.DEVICEADDR is only accessible by the network core, which AFAIK is not documented anywhere in the PS.

    It is documented as such:

    The docs have the two sections Appcore FICR and Netcore FICR. DEVICEADDR is only listed in the latter.

    Seems the FICR.DEVICEADDR is only accessible by the network core, which AFAIK is not documented anywhere in the PS. So need to call bt_enable first to get the random MAC address either via bt_id_get or bt_read_static_addr.

    However, using bt_id_create after BLE has been started does not apply the new MAC address for BLE comms. There seems to be a workaround for setting the public address at runtime, but this doesn't work for random. The HCI command returns SUCCESS though.

    I am a bit confused as to what you are trying to do specifically here

    Which of these do you want?

    • Set MAC in netcore from appcore
    • Read MAC from netcore to appcore
    • Any of the above

    To read the MAC, I think you could use bt_read_static_addr() to read the addr from netcore over HCI.

  • Thanks, seems I missed the fact that there are two different instances of the FICR in the datasheet.

    I would like to achieve these operations in the specified sequence:

    • Read MAC from netcore to appcore
    • Modify MAC value.
    • Set MAC in netcore from appcore
  • I have not checked every corner yet, but I suspect you would have to implement a custom HCI command to set the MAC from appcore.

    To air an idea: Would it be possible to modify the MAC from the netcore, or do you need some knowledge only the appcore has?
    If so, it should be relatively straight forward to change the init of the netcore to change the MAC.

    What do you think about that?

  • Thanks,

    I was hoping for an existing solution. Do you have any good examples how to modify the MAC from the netcore? We are using hci_ipc child image without code modifications.

Related