DA14683: "Private Random Resolvable address using LE privacy v1.2" Issues

Situation:

I am able to get the basic "Private Random Resolvable address using LE privacy v1.2" system running by following this thread: https://renesasrulz.com/wireles-connectivity/f/bluetooth-low-energy/21031/example-wanted-for-private-random-resolvable-addresses

but I am still having some issues:

Problems/Issues with "Private Random Resolvable address using LE privacy v1.2":

1) The bd address is not changing at regular intervals.  It doesn't matter what number I use for renew_dur with the ble_gap_address_set() function.  When there is no connection and no paired/bonded devices, the address does change, but only very rarely (many tens of minutes).

2) The bd address does not appear to ever change once a device is paired/bonded.

3) The ble_gap_address_get() always returns all 0s (00:00:00:00:00:00).  I can sniff the actual advertising packets and see that the address is being set, but that get function always returns 0s to the software.

Questions:

1) How do I troubleshoot the issue where the address is not being updated at the expected intervals?  What sdk function is responsible for creating and updating the new random address?  Is there a callback that can be used to take an action when the address is updated?

2) Is the bd address supposed to still be changed/updated when there is an active paired/bonded device?

3) Is the ble_gap_address_get() supposed to work in this mode?  If so, how should I trouble shoot the issue where that function always returns all 0s?  If not, how am I supposed to determine what random address is presently assigned?

  • Hi Nathan, 

    Thanks for raising a separate ticket. 

    Can you please indicate which SDK example you are using? 

    I would suggest to test the following code in the BMS example of the SDK1. 

    - Define dg_configBLE_PRIVACY_1_2 in custom_config_qspi.h header file. 

    - Call the  ble_gap_address_set() function before the ble application is registered (ble_registerapp())

    ble_peripheral_start();
    /* Set BLE address to be "private resolvable" using LE Privacy v1.2 */
            own_address_t own_address1 = {
                    .addr_type = PRIVATE_CNTL,
                    .addr = {0}
            };
            ble_error_t status;
            status = ble_gap_address_set(&own_address1 , 150);
            if (status != BLE_STATUS_OK) {
                    printf("%s: failed. Status=%d\r\n", __func__, status);
            }
    /* Register task to BLE framework to receive BLE event notifications */
    ble_register_app();

    - Use the Renesas SmartBond Mobile Application to test if the BD Address is changing at the pre-defined interval and the 'bonded' phone can still connect without re-bonding.

    If that does not fix your issue., please share a sniffer log. 

    Best regards, 

    PM_Renesas

  • It appears that because of Android BLE cacheing issues, the address values don't get updated/displayed consistently in all locations on all apps.  I think the address changes are happening at regular intervals.

    I need some additional insight into how this system is working:

    Check me if I'm wrong here, but from what I understand, the ble privacy 1.2 system periodically generates a unique address based on the irk key.  But it does so to resolve back to the device static address (either public static, or private static).

    Questions:

    1)   With the above code screenshot in your message, you are assigning the address as {0}.  When I call ble_gap_address_get() it returns this address full of zeros (00:00:00:00:00:00).  I know the system is generating a real  address that is used for advertising, but I don't know how to get that generated address.  Is that possible?

    2) Is it possible to save, recall, and assign a unique static address for each device at run time instead of using the #define defaultBLE_STATIC_ADDRESS as the basis for the privacy 1.2 system?  Something like setting the PRIVATE_STATIC_ADDRESS type address first, and then switching to PRIVATE_CNTL?

  • Hi Nathan, 

    1. This is a known issue that we can see in SDK1 & SDK10. 

    2. Can you please refer to the private ticket that you have raised? PLT can be used for this one and I have shared instructions. 

    Regards. 

    PM_Renesa

  • I need to know what address the device has generated when it's running in Privacy 1.2 mode.  If ble_gap_address_get() does not work because of a bug, please provide a workaround that will return the device address that was generated and is currently being used for advertising.

  • Ping.  It's been over a month.  The private ticket was only related to storing and recalling the base identity address from OTP.  That is working but these questions here are still unanswered.  I'll ask my questions again.  These all relate to the BD Address system when Privacy 1.2 mode is active (PRIVATE_CNTL):

    Re-asked questions:

    1) What sdk function is responsible for creating and updating the new random address in privacy 1.2 mode?  Is there a callback that can be used to take an action when the address is changed/updated?

    2) If ble_gap_address_get() does not work because of a bug, please provide a workaround that will return the device address that was generated and is currently being used for advertising.

  • Ping.  It's been over a month.  The private ticket was only related to storing and recalling the base identity address from OTP.  That is working but these questions here are still unanswered.  I'll ask my questions again.  These all relate to the BD Address system when Privacy 1.2 mode is active (PRIVATE_CNTL):

    Re-asked questions:

    1) What sdk function is responsible for creating and updating the new random address in privacy 1.2 mode?  Is there a callback that can be used to take an action when the address is changed/updated?

    2) If ble_gap_address_get() does not work because of a bug, please provide a workaround that will return the device address that was generated and is currently being used for advertising.

  • Hi Nathan, 

    1. If you check the ble_gap_address_set() implementation, you will see that the BLE Stack generates the BDA. The ble_gap_address_set() called the ble_mgr_gap_address_set_cmd_handler() which sends the proper commands to the stack in order to generate the BDA. You can check the status from the set response message structure ble_mgr_gap_address_set_rsp_t(). No callback function is triggered. 

    2. I am checking this internally but this will not affect the BDA generation. I have provided code snippets in order to generate the BDA you need. 

    Regards, 

    PM_Renesas