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.

CC2640R2F: Unexpected pairing failure because of timeout

Part Number: CC2640R2F

Hello,

Sometimes, pairing failed because of timeout.

Below is my peripheral's log. GAPROLE_WAITING_AFTER_TIMEOUT showed up just in 325ms after GAPBOND_PAIRING_STATE_STARTED.

Is this related with supervision timeout? The supervision timeout set as 5 secs after connected. So I think it's not supervision timeout.

[ 10.423 ] GAPROLE_CONNECTED

[ 10.426 ] Connected Peer BD_ADDR[0x507705941D09],type[2],handle[0]
[ 11.016 ] ParamUpdate: interval[6] latency[0] timeout[500]
[ 11.501 ] ParamUpdate: interval[39] latency[0] timeout[500]
[ 12.075 ] GAPBOND_PAIRING_STATE_STARTED
[ 12.380 ] ParamUpdate: intervRsp result : 0x00
[ 12.400 ] GAPROLE_WAITING_AFTER_TIMEOUT
[ 12.405 ] terminate reason [8]

Could you check the attached logs?

pair-timeout.zip

btsnoop_hci_201909090955.cfa : This is the bt snoop log of the phone side. (from line 23162)

pairing-timeout_in-325ms.cfa : Air log (from frame# 4727 of SMP)

I think it's not about heap memory also. below is the mem status when the timeout occurred.

The timeout occurred with even more heap memory like 6700bytes.

 

I'm using SDK 2.40 (simplelink_cc2640r2_sdk_2_40_00_32)

Thanks,

Calvin

  • Hi,

    Assigning an expert to comment.

  • Is this BLE3?

    Simple peripheral?

    Yes, it appears to be supervision timeout.

    terminate reason [8] means LL_STATUS_ERROR_CONNECTION_TIMEOUT (defined in ll.h). By looking at the attached log the peripheral seems to be non-responsive after frame 4743. Have you setPDU size >= 69 as described in "Using  LE Secure Connections, GAPBondMgr" section in the Users Guide:

    dev.ti.com/.../gapbondmngr.html

  • Hello,

    Thank you for your answer.

    It's BLE 4.2 and peripheral device.

    I checked the MAX_PDU_SIZE and it is set as 69.

    Could you check more please?

    I'm wondering why the supervision timeout occurred in just about 2 seconds from connected callback.

    Thanks,

    Calvin

  • Is this line reached in your peripheral code:

      else if (pMsg->method == ATT_MTU_UPDATED_EVENT)

    And what MTU Size is reported then?

  • I added below code in 'application init' part recently. Is this affect this issue?

    I'm not sure but I've seen this issue before adding below code also.

    HCI_EXT_SetMaxDataLenCmd(APP_TX_PDU_SIZE, APP_TX_TIME, APP_RX_PDU_SIZE, APP_RX_TIME);

    #define APP_TX_PDU_SIZE 27
    #define APP_RX_PDU_SIZE 27
    #define APP_TX_TIME 328
    #define APP_RX_TIME 328

    Anyway, I removed the code for checking this issue precisely.

    I will test this out enough and let you know next week.

    About ATT_MTU_UPDATED_EVENT, related codes are placed as same as simple_peripheral example but never reached the code.

    I can see HCI_GAP_EVENT_EVENT from stack, but I never seen the GATT_MSG_EVENT from stack regardless of existence of above code.

    The master does not send "Exchange MTU Request" during pair process. So I think it's normal that there is no ATT_MTU_UPDATED_EVENT. 

    If not, please let me know.

    Thanks,

    Calvin

  • Hello,

    Ok, let me know how it works.

    1) Are you using a Launchpad?

    2) Can you test the basic simplePeripheral example to verify if you receive the ATT_MTU_UPDATED_EVENT?

    3) Are you able to test with the latest SDK as well?

    4) Are you using custom HW? I saw that the connection settings are quite aggressive with connection interval at 7.5ms and it is changed by the phone around the pairing process. Have you verified the sleep crystal accuracy on you Board? One way to test if this might be the issue is to disable power saving and see if it fails or not.

    Data length extension should not cause problems as long as MAX_PDU_SIZE is at least 69 and MTU exchange has been issued before the pairing process.

  • Hello,

    Thank you for your guide.

    1) I'm using custom H/W for our product.

    2) About ATT_MTU_UPDATED_EVENT, I checked that Android phone(Galaxy S9) does not send "Exchange MTU Request" but iPhone sends it.

    I got below log during pairing with iPhone and the MTU size was 65.

    [ 84.366 ] GAPROLE_CONNECTED
    [ 84.369 ] Connected Peer BD_ADDR[0x6D8F76193578],type[1],handle[0]
    [ 84.439 ] processStackMsg: event[0x91], status[0x3e]
    [ 84.619 ] processStackMsg: event[0xb0], status[0x00]
    [ 84.625 ] processGattMsg: status[0x00], method[0x7f]
    [ 84.630 ] MTU Size: 65

    3) Currently, it's difficult to update to latest SDK.

    4) Crystal accuracy was verified by matching CL. But, I'll disable power saving and test.

    Thanks,

    Calvin

  • Hello,

    I added "MTU Request" function to our android app and added below code to the peripheral to prevent fragmentation sending/receiving pairing public key, because I thought it has effect on this issue.

    HCI_LE_WriteSuggestedDefaultDataLenCmd(69, 2120);

    But the timeout occurs sometimes still.

    I did not disable the power saving feature because it's not an option for our product.

    I attached the sniff log but I think it's not very helpful.

    pairing-failed-supervisiontimeout.zip

    I guess this issue is from stack side.

    1. Is there any known bugs related to this issue?

    2. Any possible effect from "connection parameter update request" procedure?

      - The peripheral does not request update and I disabled LL connection parameter update request feature.

      - But, the android sends LL_CONNECTION_UPDATE_IND pdu 3 times always at first connection.

    Thanks,

    Calvin