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

Get the nRF52840 factory-set Bluetooth Address

This is a very simple question:

According to the documentation, each dongle is assigned a Bluetooth Address at the factory using some random number generation algorithm that remains with the IC permanently. However, I can set the Bluetooth Address to something else (which I need to do and I change it often as I am writing a test suite). But I need some unique identifier of the nRF52840 dongle. The factory assigned Bluetooth address would be an ideal candidate, but I do not know how to get that address once I have set the address to something else.

Is there a way to get the factory generated Bluetooth Address OR is there another way I can (programmatically) get a unique identifier of a given dongle?

Note that I am using the pc-ble-driver and thus need to use the sd_* methods.

Parents Reply Children
  • Unfortunately I have called the sd_ble_gap_addr_set(). function. I assumed the sd_ble_gap_addr_get(). would get that address I set even after a power cycle. I have not checked if that assumption is true.

    If it IS the case that every time I call the sd_rpc_physical_layer_create_uart() method that the sd_ble_gap_addr_get(). function returns the factory set Bluetooth address, then I can do that.

    What I am doing is using the dongle to emulate several difference health device peripherals one after another. I set the Bluetooth Address differently for each simulation so the central thinks of it as a completely different peripheral (even if it supports the same services). At the end of each 'peripheral' I call sd_rpc_close() and at the start I call sd_rpc_physical_layer_create_uart(). 

    Since I have done this countless times, can I still get the factory set Bt Address?

  • Hi Brian, 

    the NRF_FICR->DEVICEADDR registers will never be overwritten so if you call sd_ble_gap_addr_set() then you will set the address used by the SD, but as soon as the device is reset, the SD will again fetch the DEVICEADDR and use that as the device address until sd_ble_gap_addr_set() is called. 

    Best regards

    Bjørn

Related