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

Retrieve Access Address from the SoftDevice

Is there any way to get the currently used access address from the softdevice? I have an application that needs to know what access address is being used. I can sort of get it every once in a while by retrieving the NRF_RADIO->BASE0 and prefix registers, but they rarely contain data. Is this accessible via some API call or other method?

 Thanks

  • Hi Daniel,

     

    You can get the peer address in the BLE_GAP_EVT_CONNECTED, by reading the type ble_gap_evt_connected_t for either your own addr or the peer addr:

    If you want to know the default address of your device, you can derive this from the NRF_FICR structure, as explained in this thread:

    https://devzone.nordicsemi.com/f/nordic-q-a/2112/how-to-get-6-byte-mac-address-at-nrf51822

    Cheers,

    Håkon

  • The address I am trying to get is not the mac address. It is the on-air access address (part of the ble preamble). To set it in raw radio mode, I use the NRF_RADIO->BASE0 and PREFIX0 registers. I can retrieve it exactly once during the first RSSI update after a new connection starts, but never after that point (they read 0x00).

  • Sorry for misunderstanding. The access address is sent in the CONNECT_REQ packet from the master to the slave (ie: unique for each connection), and there is no API to fetch this address on the slave side. Why do you need the access address?

  • Yes, I know what it is and how it's used. I want to retrieve it on the master side (nrf52 dk running as a central on S132). The registers for BAS0 and PREFIX0 that I am reading are unfortunately zeroed by the SD after each RX or TX. I was hoping there was some api to get the address being utilized for the current connection set. As I said, I can get it once during the first rssi update from the BASE0 and PREFIX0 registers, but all subsequent reads in following rssi updates or other events give values of 0x00 for both registers. 

  • The Softdevice will reset the radio peripheral for each connection event, to ensure that it starts from a known state, so you will not be able to read out the radio content at all times.

1 2