I have asked the developers if they could respond and verify this functionality is supported within the SDK.
I think what you are referring to is called a resolvable private address (RPA) and it is currently unsupported.
RPA is a feature that allows your device to change it's BD_ADDR such that a paired device can still understand it's the same device. I believe that an iOS device supports RPA and changes the BD_ADDR every 15 minutes. It can do this because during the pairing process a special key is distributed to the peer. Therefore, when a peer sees the advertisement from the iPhone, it can decode the BD_ADDR and understand that it is the same device that it was paired with initially.
The BCM20736/7 supports connections from devices that change BD_ADDRs in this manner, however, these devices do not have logic built in to change their own BD_ADDR.
Note that I confirmed with the developers that what you are trying to accomplish through the API changing the BD_ADDR is unsupported.
Thank you for your answer.
Just to be clear, I don't want to change it dynamically and keep the device running with the new address. I would just like to be able to change it and have it up and and running after reboot. This works when I first set the address to FFFFFFFFFFFF then upload the firmware to the board and call blecm_set_static_random_bd_addr, I get a new random address but I can't call this a second time as I would need to set the address again to FFFFFFFFFFFF.
You shall not change device bdaddr on every reboot. And you should not change address by writing into a hardcoded memory address. You can use blecm_set_static_random_bd_addr function. As you correctly noticed this generates a random address and saves it in the NVRAM. But in addition to that, device type is changed from public to private. The address should not be changed for the lifetime of the device. Otherwise you will be violating Bluetooth SIG policy.
1 of 1 people found this helpful
I guess one can use blecm_startAdv() to specify if the own address is random by setting the advAdrType parameter to 1.
See the documentation of blecm_startAdv() in Connectable vs. nonconnectable Advertisements.
Regarding to your description here
You shall not change device bdaddr on every reboot.
I don't see the same expression from the BT spec as below, which is cited from section 10.8.1 of Part C. of Volume 3.
A device may choose to initialize its static address to a new value after each
power cycle. A device shall not change its static address value once initialized
until the device is power cycled.
Note: If the static address of a device is changed then the address stored in
peer devices will not be valid and the ability to reconnect using the old address
will be lost.
So, if we need to change the BD address in every reboot, then what would be the limit of write cycle to EEPROM that storing the BD_ADDRESS, in case that we need to write it to '0xFFFFFFFFFFFF' before calling 'blecm_set_static_random_bd_addr'?
The API: blecm_set_static_random_bd_addr() is undefined with SDK: WICED-Smart-SDK 2.2.3.
Which version of SDK contain this API? Could you please share a demo code if convenient?
I am using the EEPROM with normal OTA settings as recommended (SS1,SS2,DS1,DS2).
I know that the BLE address is stored in the EEPROM in the DS1 at offset 0xFF000015 to 0xFF00001b and I can change it directly via bleappfwu_writeMem and when I reboot I indeed get the desired address.
HOWEVER if we are running in DS2 what address is the BLE address retrieved from? 0xFF000015 appears to be in SS1, is this correct? I attempted to use 0xFF000115 without success (SS2 offset applied).
I am not able to set a new BLE address when the device is running in DS2. I get a previously set address. Here is the code that writes the address
// Erase sector if SF before writing.
temp = bleappfwu_eraseMem(BD_ADDR_MEM_START, BD_ADDR_LEN);
// Write this to the active SS.
temp = bleappfwu_writeMem(p_bd_addr, BD_ADDR_MEM_START, BD_ADDR_LEN);
ble_trace1("Write Status: %d",temp);