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.

CC2564: CC2564 BLE Whitelist Connection Error

Part Number: CC2564

Hello,

We are using Bluetopia sdk v4.0.2.2 for cc2564. We have developed our code on the top of the HOGP Demo Example. We are using STM32F4 + CC2564 Solution.

We are getting issue related to the Whitelist Advertisement. Phone is not able to connect with the device, even if we provided phone address and address type in the Add whitelist api.

Our Steps are as below:
1) Device advertise with non whitelisted advertisement and do pairing/Bonding with the phone and then disconnect with the phone.
2) Now we configure paired phone address, as whitelist address, i.e. we add phone address in whitelist database in device using GAP_LE_Add_Device_To_White_List() api.


/*************Adding Whitelist*****************************/
int return;
unsigned int AddedDeviceCount,RemovedDeviceCount;
GAP_LE_White_List_Entry_t le_whitelst;
le_whitelst.Address = BondingInfo.BondPara[0].BD_ADDR;
le_whitelst.Address_Type =BondingInfo.BondPara[0].AddressType;

2.1) Clear the whitelist using "GAP_LE_Remove_Device_From_White_List" API we get the success response against this API.


return =GAP_LE_Remove_Device_From_White_List(BluetoothStackID,1,(GAP_LE_White_List_Entry_t*)&le_whitelst,&RemovedDeviceCount);
if(return!=0)
        Display(("Error in Remove whitelist = %d\r\n",return));
else
       Display(("Remove Whitelist Successfully done = %d\r\n",RemovedDeviceCount));

2.2) Add Bondend phone info in the whitelist using the "GAP_LE_Add_Device_To_White_List" API we got the success and also get the added device count as 1 in response.

return = GAP_LE_Add_Device_To_White_List(BluetoothStackID,1,(GAP_LE_White_List_Entry_t*)&le_whitelst,&AddedDeviceCount);
if(return!=0)
         Display(("Error in add whitelist = %d\r\n",return));
else
        Display(("Add Whitelist Successfully done = %d\r\n",AddedDeviceCount));

2.3) Enable the filter policy in the Advertising parameters.

/*************Advertisement Parameters Filters*************/
AdvertisingParameters.Scan_Request_Filter = fpNoFilter;
AdvertisingParameters.Connect_Request_Filter = fpWhiteList;

2.4) Start the Advertisement using the "GAP_LE_Advertising_Enable" API.

which means we started whitelisted advertisment.

3) Device is discoverable in phone scanning, and when we try to connect with device from there , we are not getting success and phone is not able to connect with device.

We verified all the information which we are passing but still we do not get clue how to resolve this issue. If we turn off the filter policy in the advertising parameters then the bonded device connect imediately.
Please review it and comment if anything is wrong with our procedure.

Regards,

khodidas

  • Hi khodidas,
    Can you pls share console and firmware logs ?

    Thanks
    Saurabh
  • Hi Saurabh,

    Here I attached the console log according to their function.

    return =GAP_LE_Remove_Device_From_White_List(BluetoothStackID,1,(GAP_LE_White_List_Entry_t*)&le_whitelst,&RemovedDeviceCount);

    if(return!=0)

           Display(("Error in Remove whitelist = %d\r\n",return));

    else

          Display(("Remove Whitelist Successfully done = %d\r\n",RemovedDeviceCount));

    Console Log :

          Error in Remove whitelist = -512<CR><LF>

    return = GAP_LE_Add_Device_To_White_List(BluetoothStackID,1,(GAP_LE_White_List_Entry_t*)&le_whitelst,&AddedDeviceCount);

    if(return!=0)

            Display(("Error in add whitelist = %d\r\n",return));

    else

           Display(("Add Whitelist Successfully done = %d\r\n",AddedDeviceCount));

    Console Log :

          Add Whitelist Successfully done = 1<CR><LF>

    /*************Advertisement Parameters Filters*************/

    AdvertisingParameters.Scan_Request_Filter = fpNoFilter;

    AdvertisingParameters.Connect_Request_Filter = fpWhiteList;

    Console Log :

         Advertising Data Configured Successfully.<CR><LF>

    "GAP_LE_Advertising_Enable".

    Console Log :

         GAP_LE_Advertising_Enable success.<CR><LF>

     

    Regards

    Khodidas

  • We, are able to reproduce the issue with code modifications. We, will check the issue and get back in couple of days..

    Thanks
  • When, you first paired with the phone, did it use "random" address for the connection? Is this the same random address you are using in the GAP_LE_Add_Device_To_White_List? Is binding enabled and are the keys stored?
    In between the pairing with no whitelist and with whitelist, is the CC256x device getting reset? If, so without the IRK restored, the controller can't resolve the address in the whitelist and so connection will fail..

    Try this way:
    a) No whitelist and advertising filter for pair/connect set to "fpNoFilter". Pair and connect with the phone.
    b) Check and note the address type and address used by the phone.
    c) Disconnect/forget the connection from phone.
    d) Add to the whitelist the address type and address from 'b'.
    e) Set Advertisement parameters for connection to 'fpWhiteList" and enable advertisements.
    f) From the phone pair and connect..

    This worked on mysetup with the controller using the address from whitelist.

    In general, if the controller is getting reset in between, you need to also provide the IRKs from the keys obtained from earlier bonding with the phone to the white list.

    Thanks
  • Hi,

    When, you first paired with the phone, did it use "random" address for the connection? 

    No It use the public address for the connection.
    Is this the same random address you are using in the GAP_LE_Add_Device_To_White_List?
    Yes I am giving the same address which received during pairing process.
    Is binding enabled and are the keys stored?
    Yes Bonding Enabled and the keys are also stored.
    In between the pairing with no whitelist and with whitelist, is the CC256x device getting reset? If, so without the IRK restored, the controller can't resolve the address in the whitelist and so connection will fail..
    No, CC256x not reset during the whitelist and non whitelist switch. And we have stored the key in the Flash Memory and providing that key to the structure.


    Try this way:
    a) No whitelist and advertising filter for pair/connect set to "fpNoFilter". Pair and connect with the phone.
    b) Check and note the address type and address used by the phone.
    c) Disconnect/forget the connection from phone.
    d) Add to the whitelist the address type and address from 'b'.
    e) Set Advertisement parameters for connection to 'fpWhiteList" and enable advertisements.
    f) From the phone pair and connect..

    We have Tried as per your steps. But not able to get success in the whitelist advertisement.

    This worked on mysetup with the controller using the address from whitelist.

    In general, if the controller is getting reset in between, you need to also provide the IRKs from the keys obtained from earlier bonding with the phone to the white list.

    If possible than can you share your created example code so we will check that what is wrong with our step.

    Regards

    Khodidas

  • Is there any update on this .. If Code example is not possible then can you give us the code snippet so we will update in the similar way.

    Regards
    Khodidas
  • Hi,

    The controller does not support "HCI_LE_Add_Device_To_Resolving_List" APIs (please check the CC2564C ICS at bluetooth.org - launchstudio.bluetooth.com/.../87924), so we can't provide IRKs for random address resolution. In my tests, the iPhone used the same "random address" at each connection so it worked.. So, it should have worked with public address in connection request.. Can, you take FW logs? I will check if i can simulate your condition with public address.. but it may take few days..

    Thanks