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.

CC2642R: there are some problem connecting with win10

Part Number: CC2642R
Other Parts Discussed in Thread: CC2640, SYSCONFIG,

Hi TI,

I work with the SDK_3_10_00_53;

I have two device downloaded with the same firmware(different advname).

Then when I connected one with PC with win10, another can't pair successfully.

the pairing return code is 0x08;/// Pairing failed due to an unspecified reason
#define SMP_PAIRING_FAILED_UNSPECIFIED 0x08

I attach code, log and sniffer info here.  The result come from demo--"simple_peripheral_app".


4544.sniffer.zip

  • Hi Sage,

    Thank you for posting on the E2E forums. I have assigned an expert to your inquiry.

    Best,

    Nima Behmanesh

  • Hi,

    This error is very similar to what is described in the e2e post below. Would you mind taking a look at it and see if the workaround/setup works?

    https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/991270/cc2642r-ble-midi-peripheral-using-rpa-appears-multiple-times-in-macos-central/3662507#3662507

    Hope this helps,

    Rafael

  • Hi,

    The problem seems similar.

    there are no syscfg file in SDK V 3_10_00_53, so I added code in SimplePeripheral_init() as:

    uint8_t keyDistr = GAPBOND_KEYDIST_SENCKEY | GAPBOND_KEYDIST_MIDKEY | GAPBOND_KEYDIST_MSIGN;
    GAPBondMgr_SetParameter(GAPBOND_KEY_DIST_LIST, sizeof(uint8_t), &keyDistr);

    However, the problem is not solved.

    Pls give me some advice.

    Thanks!

  • Hi,

    In the Agama project I have here, the working version (where RPA is enabled) sets the key distribution list as:

    uint8_t KeyDistList   =    GAPBOND_KEYDIST_MENCKEY | GAPBOND_KEYDIST_MIDKEY | GAPBOND_KEYDIST_MSIGN | GAPBOND_KEYDIST_SENCKEY | GAPBOND_KEYDIST_SSIGN;

    I send attached my ti_ble_config.c file for your reference.

    Hope this helps,

    Rafael

    /*
     *  ======== ti_ble_config.c ========
     *  Configured BLE module definitions
     *
     *  DO NOT EDIT - This file is generated by the SysConfig tool.
     */
    
    #include <bcomdef.h>
    #include <gapgattserver.h>
    #include <simple_gatt_profile.h>
    #include <gap_advertiser.h>
    #include <gapbondmgr.h>
    #include "ti_ble_config.h"
    
    /*********************************************************************
     * General Role Configuration
     */
    
    // Device Name
    uint8_t attDeviceName[GAP_DEVICE_NAME_LEN]= "Simple Peripheral";
    
    //Random Address
    uint8_t pRandomAddress[6] = { 0x23, 0xad, 0xee, 0xb0, 0x6f, 0xF0 };
    
    /*********************************************************************
     * Bond Manager Configuration
     */
    
    uint8_t pairMode                =    GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
    uint8_t mitm                    =    false;
    uint8_t ioCap                   =    GAPBOND_IO_CAP_NO_INPUT_NO_OUTPUT;
    uint8_t bonding                 =    true;
    uint8_t secureConnection        =    GAPBOND_SECURE_CONNECTION_ALLOW;
    uint8_t autoSyncWL              =    false;
    uint8_t eccReGenPolicy          =    0;
    uint8_t KeySize                 =    16;
    uint8_t removeLRUBond           =    false;
    uint8_t KeyDistList             =    GAPBOND_KEYDIST_MENCKEY | GAPBOND_KEYDIST_MIDKEY | GAPBOND_KEYDIST_MSIGN | GAPBOND_KEYDIST_SENCKEY | GAPBOND_KEYDIST_SSIGN;
    uint8_t eccDebugKeys            =    false;
    uint8_t eraseBondWhileInConn    =    false;
    
    void setBondManagerParameters()
    {
        // Set Pairing Mode
        GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode);
        // Set MITM Protection
        GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm);
        // Set IO Capabilities
        GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap);
        // Set Bonding
        GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bonding);
        // Set Secure Connection Usage during Pairing
        GAPBondMgr_SetParameter(GAPBOND_SECURE_CONNECTION, sizeof(uint8_t), &secureConnection);
        // Set Auto Whitelist Sync
        GAPBondMgr_SetParameter(GAPBOND_AUTO_SYNC_WL, sizeof(uint8_t), &autoSyncWL);
        // Set ECC Key Regeneration Policy
        GAPBondMgr_SetParameter(GAPBOND_ECCKEY_REGEN_POLICY, sizeof(uint8_t), &eccReGenPolicy);
        // Set Key Size used in pairing
        GAPBondMgr_SetParameter(GAPBOND_KEYSIZE, sizeof(uint8_t), &KeySize);
        // Set LRU Bond Replacement Scheme
        GAPBondMgr_SetParameter(GAPBOND_LRU_BOND_REPLACEMENT, sizeof(uint8_t), &removeLRUBond);
        // Set Key Distribution list for pairing
        GAPBondMgr_SetParameter(GAPBOND_KEY_DIST_LIST, sizeof(uint8_t), &KeyDistList);
        // Set Secure Connection Debug Keys
        GAPBondMgr_SetParameter(GAPBOND_SC_HOST_DEBUG, sizeof(uint8_t), &eccDebugKeys);
        // Set the Erase bond While in Active Connection Flag
        GAPBondMgr_SetParameter(GAPBOND_ERASE_BOND_IN_CONN, sizeof(uint8_t), &eraseBondWhileInConn);
    }
    
    /*********************************************************************
     * Broadcaster Role Configuration
     */
    
    // Advertisement Params 1
    GapAdv_params_t advParams1 = {
      .eventProps =   GAP_ADV_PROP_CONNECTABLE | GAP_ADV_PROP_LEGACY | GAP_ADV_PROP_SCANNABLE,
      .primIntMin =   160,
      .primIntMax =   160,
      .primChanMap =  GAP_ADV_CHAN_ALL,
      .peerAddrType = PEER_ADDRTYPE_PUBLIC_OR_PUBLIC_ID,
      .peerAddr =     { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa },
      .filterPolicy = GAP_ADV_WL_POLICY_ANY_REQ,
      .txPower =      GAP_ADV_TX_POWER_NO_PREFERENCE,
      .primPhy =      GAP_ADV_PRIM_PHY_1_MBPS,
      .secPhy =       GAP_ADV_SEC_PHY_1_MBPS,
      .sid =          0
    };
    
    // Advertisement data
    uint8_t advData1[] =
    {
      0x03,
      GAP_ADTYPE_LOCAL_NAME_SHORT,
      'S',
      'P',
    
      0x02,
      GAP_ADTYPE_FLAGS,
      GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED | GAP_ADTYPE_FLAGS_GENERAL,
    
      0x03,
      GAP_ADTYPE_16BIT_MORE,
      // More 16-bit - UUID 0
      LO_UINT16(0xfff0),
      HI_UINT16(0xfff0),
    
    };
    
    // Scan Response Data
    uint8_t scanResData1[] =
    {
      0x12,
      GAP_ADTYPE_LOCAL_NAME_COMPLETE,
      'S',
      'i',
      'm',
      'p',
      'l',
      'e',
      ' ',
      'P',
      'e',
      'r',
      'i',
      'p',
      'h',
      'e',
      'r',
      'a',
      'l',
    
      0x02,
      GAP_ADTYPE_POWER_LEVEL,
      0,
    
      0x05,
      GAP_ADTYPE_SLAVE_CONN_INTERVAL_RANGE,
      LO_UINT16(80),
      HI_UINT16(80),
      LO_UINT16(104),
      HI_UINT16(104),
    
    };
    
    
    // Advertisement Params 2
    GapAdv_params_t advParams2 = {
      .eventProps =   GAP_ADV_PROP_CONNECTABLE,
      .primIntMin =   160,
      .primIntMax =   160,
      .primChanMap =  GAP_ADV_CHAN_ALL,
      .peerAddrType = PEER_ADDRTYPE_PUBLIC_OR_PUBLIC_ID,
      .peerAddr =     { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa },
      .filterPolicy = GAP_ADV_WL_POLICY_ANY_REQ,
      .txPower =      GAP_ADV_TX_POWER_NO_PREFERENCE,
      .primPhy =      GAP_ADV_PRIM_PHY_CODED_S2,
      .secPhy =       GAP_ADV_SEC_PHY_CODED_S2,
      .sid =          0
    };
    
    // Advertisement data
    uint8_t advData2[] =
    {
      0x03,
      GAP_ADTYPE_LOCAL_NAME_SHORT,
      'S',
      'P',
    
      0x02,
      GAP_ADTYPE_FLAGS,
      GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED | GAP_ADTYPE_FLAGS_GENERAL,
    
      0x03,
      GAP_ADTYPE_16BIT_MORE,
      // More 16-bit - UUID 0
      LO_UINT16(0xfff0),
      HI_UINT16(0xfff0),
    
    };
    
    // Scan Response Data
    uint8_t scanResData2[] =
    {
      0x12,
      GAP_ADTYPE_LOCAL_NAME_COMPLETE,
      'S',
      'i',
      'm',
      'p',
      'l',
      'e',
      ' ',
      'P',
      'e',
      'r',
      'i',
      'p',
      'h',
      'e',
      'r',
      'a',
      'l',
    
      0x02,
      GAP_ADTYPE_POWER_LEVEL,
      0,
    
      0x05,
      GAP_ADTYPE_SLAVE_CONN_INTERVAL_RANGE,
      LO_UINT16(80),
      HI_UINT16(80),
      LO_UINT16(104),
      HI_UINT16(104),
    
    };
    
    

  • Hi,

    I changed the value of KeyDistList and the problem is really resolved.

    However I find another phenomena: after I removing the two device connected, then I can't connect any of them again for a long time(few minutes). It hints-- "try connecting again"  and I couldn't catch the process from ble sniffer. 

  • Hi,

    Please apologize for the delay; I was out last week.

    Where do you see the message and the delay in reconnecting? Is it in Windows 10? If so, do you see any message in the Windows Event Viewer? This may give some additional hints as to what may be going on at the PC side.

    Hope this helps,

    Rafael

  • Hi,

    The phenomenon does not reproduce always and the how can I see the message in the Windows?

    I also use CC2640R2 and find it haven't the problem pairing with win10. I also confuse the difference between CC2640 and CC2642 about the IRK.

    Have you any device about how to get the LTK of CC2640R2 ? So I can capture the entire connecting process about CC2640.

  • Hi,

    how can I see the message in the Windows?

    This reference can be useful:

    https://www.howtogeek.com/school/using-windows-admin-tools-like-a-pro/lesson3/

    I also use CC2640R2 and find it haven't the problem pairing with win10. I also confuse the difference between CC2640 and CC2642 about the IRK.

    Have you any device about how to get the LTK of CC2640R2 ? So I can capture the entire connecting process about CC2640.

    Ok, so I am a bit confused as well. We have three device families:

    CC2640/2650: oldest family with BLEStack SDK - I suspect you are not talking about this family.
    CC2640R2: newer family with Simplelink SDK but no Sysconfig.
    CC2642R/2652R: newest family with Simplelink SDK and Sysconfig past SDK3.30.

    In order to enable the encryption keys for debugging using a sniffer, check the following thread for CC2640R2:
    https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1004148/cc2640r2f-encryption-for-ota-data-when-using-just-works-pairing-mode/3714047#3714047

    For CC2642R/2652R, in Sysconfig you can enable the option ECC Debug Keys (check the screenshot in the e2e thread I linked before).

    Hope this helps,

    Rafael

  • Hi,

    thanks for your help!