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

BD_ADDR changes and multiple BD_ADDR

I have a question about BD_ADDR.

SDK: 15.3.0
example: ble_app_multirole_lesc (I changed the source from the sample)
device: EYSHJNZWZ (nRF52832)

1) Is it possible to change BD_ADDR?
How can I change it if possible?
2) Is it possible to have multiple BD_ADDRs?
(For example, one at the central and one at the peripheral)
If possible, please tell me how.

Parents Reply
  • ・Am I correct in recognizing that it is impossible to change BD_ADDR without using a soft device?

    ・Is the recognition that SoftDevice is not used in the following sample correct?
    I understand that we need to add a process (sd_ble_enable()) to enable SoftDevice to this sample.
    nRF5_SDK_15.3.0_59ac345\examples\dfu\secure_bootloader\pca10040_ble
    If not using SoftDevice, I would like to change BD_ADDR without using SoftDevice if possible.

    ・I checked the "BLE Stack Enable" described in the documentation of sd_ble_enable().
    I called sd_softdevice_enable() experimentally, but I am getting (NRF_ERROR_SVC_HANDLER_MISSING), the same error as when I call sd_ble_gap_addr_set().
    Can you please tell me the cause of this?

Children
  • I am still having trouble resolving the issue.
    Can someone please answer my question?

  • Hi,

    takashina hiroki said:
    Am I correct in recognizing that it is impossible to change BD_ADDR without using a soft device?

    The BLE stack used in nRF5 SDK is the SoftDevice. Changing Bluetooth address without using a Bluetooth stack does not make sense. If you use the Secure DFU Bootloader in nRF5 SDK v15.3, with BLE for transport, then you are using the SoftDevice already in the bootloader.

    takashina hiroki said:
    Is the recognition that SoftDevice is not used in the following sample correct?

    No, the recognition is not correct. SoftDevice is used in the secure DFU Bootloader.

    takashina hiroki said:
    I called sd_softdevice_enable() experimentally, but I am getting (NRF_ERROR_SVC_HANDLER_MISSING), the same error as when I call sd_ble_gap_addr_set().
    Can you please tell me the cause of this?

    In nRF5 SDK, the SoftDevice Handler Library takes care of initializing and enabling the SoftDevice. In the BLE DFU bootloader, this is handled by the DFU library, as part of the BLE transport.

    (You should not touch this yourself, but if you are interested in looking you can have a look in nrf_dfu_ble.c, where the SoftDevice Handler is used to enable the SoftDevice inside ble_stack_init(), which is again called from ble_dfu_transport_init(), which is the function initializing the BLE transport for the DFU bootloader.)

    Also in nrf_dfu_ble.c, and this is probably the area you are interested in, sd_ble_gap_addr_set() is used to change the address in the function gap_address_change(). This is done for adding one to the address, so that the cached GATT database on the peer side does not interfere with the updated GATT database used by the DFU bootloader. (The device appears as different devices when in DFU mode and when operating normally, since in DFU mode it has a different set of BLE services and characteristics.)

    Regards,
    Terje

Related