This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-CC2640R2: Whitelist scanning of device with RPA not found while enabling non connectable advertisements

Part Number: LAUNCHXL-CC2640R2

Hello,

I am using the following  to reproduce the issue:

SDK

simplelink_cc2640r2_sdk_5_30_00_03

IDE

IAR8.32.2

Reference Project

multiRole

1. Just works pairing is enabled in the project.
2. By default the pairing mode is set to GAPBOND_PAIRING_MODE_WAIT_FOR_REQ. When the device is a client i.e, when it initiates the connection, pairing mode is switched to GAPBOND_PAIRING_MODE_INITIATE.
3. The MAX_NUM_BLE_CONNS is set to 1 i.e, only one connection is allowed.

Here is the flow of the functionalities for the device under test (A).

STEP 1:

STEP 2:

As described above, the issue comes when after A connects with C and non connectable advertisements start, the callbacks for the whitelisted device B stops.

1. Scanning has to be stopped and restarted to get the advertisements of B after STEP 2.
2. We verified that B is still advertising.

I have also tested other scenarios:
1. If whitelist scanning is not enabled in STEP 1 above, the scan callbacks of B are received even after STEP 2.
2. If B is not advertising with RPA, then whitelist scan callbacks of B will be received even after STEP 2.

Please help us through this issue.

Regards,
Mohini

  • Hi Mohini,

    Scanning has to be stopped and restarted to get the advertisements of B after STEP 2.
    1. If whitelist scanning is not enabled in STEP 1 above, the scan callbacks of B are received even after STEP 2.
    2. If B is not advertising with RPA, then whitelist scan callbacks of B will be received even after STEP 2.

    The behavior described is expected.

    Actually, when RPA and whitlisting are used, it means the radio and stack have to decrypt the RPA (to get the actual static address). To do so, they have to get access to the newly created bonds. As the newly created bonds are not taken in consideration by the radio during the execution of a Bluetooth operation, you have to turn of than turn back on the operation to have the newly created bonds taken into account. 

    I hope this will help,

    Best regards,

  • Hello Clement,

    Thanks for your reply.

    Above, as you can see, well after the bond is saved - A starts the whitelisted scanning and it gets the whitelisted scan callbacks which means that the stack is able to decrypt the random address. While it is doing the whitelisted scanning, if I connect another device to A, that is when the stack stops being able to decrypt the random address.

    We are giving enough gap for the scanning to start post the bonding process. What are we missing here?

    Regards,
    Mohini

  • Hello Clement,

    I wanted to report some observations which I have gathered from my testing, hopefully they might be helpful.

    With the maximum BLE connections = 3 on 'A',

    1. 'A' is flashed with software and started up:
      1.  'A' bonds with 'B' successfully.
      2. 'A' disconnects from 'B' - 'A' starts connectable advertisements.
      3. 'A' does whitelist scanning for identity address of 'B' - 'A' receives GAP_DEVICE_INFO_EVENT callbacks
      4.  'C' connects to 'A' - 'A' starts connectable advertisements.
      5. 'A' receives GAP_DEVICE_INFO_EVENT callbacks
      6. Connect 2 more devices to 'A'
      7. 'A' starts non-connectable advertisements and stops receiving GAP_DEVICE_INFO_EVENT callbacks
    2. Power reset 'A'
      1. Start whitelisted scan for 'B' - 'A' receives GAP_DEVICE_INFO_EVENT callbacks
      2. Connect 2 devices to 'A' - 'A' receives GAP_DEVICE_INFO_EVENT callbacks
      3. Connect 3rd device to 'A'
      4. 'A' starts non-connectable advertisements and stops receiving GAP_DEVICE_INFO_EVENT callbacks

    NOTE: In the above example with maximum BLE connections = 1, after the step 1d. was conducted - 'A' starts non-connectable advertisements and stops receiving whitelist scan GAP_DEVICE_INFO_EVENT callbacks.

    This topic is critical for our product release. Hope to receive some solution soon.

    Regards,
    Mohini

  • Hi Mohini,

    May I kindly ask if you have checked whether the device may run out of RAM? Please refer to the debugging guide (here) to check the memory peak of each task.

    Can you also check whether some error codes are raised by the stack?

    It would also be interesting to see if the events are passed to the application's callback function (the one responsible to enqueue messages for the main task).

    Please keep us updated,

    Best regards,

  • Hello Clement,

    I am not receiving any error codes from the stack. And the non connectable advertisements parameters get set with no failure.

    Regards,
    Mohini

  • Hi Mohini,

    To clarify, were you able to check the memory peak of the device before and after the behavior occurs? This may provide some insight into what is going on. Can you share your scanning and advertising parameters?

    Best Regards,

    Jan

  • Hello Jan,

    I have observed that this issue is not reproduce-able on the base multi role project with MAX NUM BLE CONNECTIONS set to 1. Below is my memory status:

    1. When application starts

    2. When connection established with B and A starts whitelist scanning of B

    3. After mobile connection and when whitelist scan stops

    Also the detailed task stack status:

    Does not look like there's any heap failure.

    We need to look into our application flow and see where it's causing a problem.

    Regards,
    Mohini

  • Hello Team,

    We noticed the multi role does not receive the whitelisted scan callbacks of randomized address device after bonding when MAX_NUM_BLE_CONNS >=2. When we reduced it to 1, we received the callbacks.

    I suspect the memory usage causing the issue in our application, which needs to be optimized further.

    Can you suggest how we could optimize the gapbondmgr for "just pair works"? Or any other optimizations with respect to pairing and bonding?

    Regards,
    Mohini

  • Hi Mohini,

    Thank you for the additional details! Looking into this, any memory optimizations will highly depend on your specific use-case. To enable just works pairing in multirole, then I would suggest referencing the BLE Security Fundamentals lab available in the SimpleLink Academy. This section contains all of the modifications required.

    Best Regards,

    Jan