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.

WL1831MOD: BLE connection terminated by master when bonded.

Part Number: WL1831MOD
Other Parts Discussed in Thread: CC2540

Linux, WL1831MODGBMOCR, Using PM.

The 3rd connection is closed by the master when bonded when connecting to an iPhone 5 (10.3.3) or iPhone 5S (11.2.1).  Subsequent connections after pairing also fail when using a Samsung S5 and S6 (operating system versions unknown).

I am using a fixed passkey with these settings:

pAuthRspInfo->AuthenticationAction |= DEVM_AUTHENTICATION_ACTION_LOW_ENERGY_OPERATION_MASK;
pAuthRspInfo->AuthenticationDataLength = sizeof(AuthenticationResponseInformation.AuthenticationData.LEIOCapabilities);
pAuthRspInfo->AuthenticationData.LEIOCapabilities.IO_Capability = licDisplayOnly;
pAuthRspInfo->AuthenticationData.LEIOCapabilities.Bonding_Type = lbtBonding;
pAuthRspInfo->AuthenticationData.LEIOCapabilities.MITM = FALSE;
pAuthRspInfo->AuthenticationData.LEIOCapabilities.SC = FALSE;
pAuthRspInfo->AuthenticationData.LEIOCapabilities.P256DebugMode = FALSE;
pAuthRspInfo->AuthenticationData.LEIOCapabilities.OOB_Present = FALSE;
pAuthRspInfo->AuthenticationData.LEIOCapabilities.Keypress = FALSE;

The characteristics in the service require GATM_SECURITY_PROPERTIES_UNAUTHENTICATED_ENCRYPTION_WRITE and READ.

The logs seem to indicate that the connection is being terminated because of a MIC failure that occurs during KEY exchange.  Why is this happening?  Have I configured something improperly?

  • wilink8_connectionfailure_when_bonded.zip

    pm.log
    
    BusyBox v1.23.2 (2017-09-29 17:30:21 EDT) built-in shell (ash)
    Enter 'help' for a list of built-in commands.
    
    # echo 55 > /sys/class/gpio/export
    echo out > /sys/class/gpio/gpio55/direction
    echo 0 > /sys/class/gpio/gpio55/value
    echo 1 > /sys/class/gpio/gpio55/value
    echo 0 > /sys/class/gpio/gpio55/value
    echo 1 > /sys/class/gpio/gpio55/value
    BT COMM PORT (/dev/ttyO1): 1
    Changing HCI baud rate to 3000000
    Status: Executing BTS Script /lib/firmware/TIInit_11.8.32.bts.
    Status: BTS Script successfully executed.
    Power state ON
    DEVM_EnableBluetoothDebug returned 0 Success
    Bluetooth snooping to file BTSnoop.log
    GAP_LE_Set_Fixed_Passkey returned 0 Success
    
    Hello Bluetopia
    Power state ON
    BTPM_Initialize() Success: 0.
    GATM_RegisterEventCallback() Success: 1.
     Registering Service, UUID: F359F4A190E1FCAEF44909F87F865345
     Registered Service, Service ID: 1.
     Registered Characteristic, UUID: 82B960AF32CF819B174597A011E3A422
     Registered CCCD UUID: 2902
     Service Registered.
    ******************************************************************
       Service Start Handle: 0x4000
       Service End Handle:   0x4003
    
     Characteristic: : 82B960AF32CF819B174597A011E3A422
    Characteristic Declaration @ Handle: 0x4001
    Characteristic Value       @ Handle: 0x4002
     CCC Descriptor: : 2902
    Characteristic Descriptor @ Handle: 0x4003
    ******************************************************************
    DEVM_QueryLocalDeviceProperties returned 0 Success
    DEVM_RegisterAuthentication returned 5 Success
    Attempting to set Device Name to: "HX5CAD".
    DEVM_UpdateLocalDeviceProperties returned 0 Success
    DEVM_Set_Advertising_Intervals 0 Success
    Adv Length: 33 0x21
    1F 22 02 01 1A 12 16 FA DE 01 00 12 34 56 78 A2 A4 A6 A8 B1 B2 C1 61 68 08 09 48 58 35 43 41 44 00
    
    Local Device Properties Changed.
    
    LE Advertising Started.
    DEVM_StartAdvertising returned 0 Success
    DEVM_QueryLocalDeviceProperties returned 0 Success
    BD_ADDR:      987BF31C5CAD
    HCI Ver:      0x0008
    HCI Rev:      0x0000
    LMP Ver:      0x0008
    LMP Sub Ver:  0xAC0D
    Device Man:   0x000D (Texas Instruments Inc.)
    Device Flags: 0x80020000
    BLE Address Type: Resolvable Random
    BLE BD_ADDR:      771C2A55567B
    COD:          0x1C0424
    Device Name:  HX5CAD
    Disc. Mode:   TRUE , 0x00000000
    Conn. Mode:   TRUE , 0x00000000
    Pair. Mode:   TRUE , 0x00000000
    LE Scan Mode:    FALSE, 0x00000000
    LE Adv Mode:     TRUE, 0xFFFFFFFF
    
    Local Device Properties Changed.
    
    LE Advertising Stopped.
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x4002F001
    Resolv. BD_ADDR:     7CC69ABECAA1
    
    LE Connect State:    TRUE
    
    GATT Connection Event
        Connection Type: LE
        Remote Address:  008865561458
        MTU:             23
    
    
    
    GATT Connection MTU Update Event
        Connection Type: LE
        Remote Address:  008865561458
        New MTU:         185
    
    
    
    Authentication Request received for 008865561458.
    I/O Capability Request: LE.
    DEVM_AuthenticationResponse returned 0 Success
    I/O Capability Response.
    Remote I/O Capabilities: Display Only, MITM Protection: FALSE.
    
    Authentication Request received for 008865561458.
    PassKey Indication LE.
    PassKey: 123456
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x4001B001
    LE Encrypt State:    TRUE
    
    LE Remote Device Pairing Status: 008865561458, SUCCESS (0x80000000)
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    GATT Services Known: FALSE
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x4003E001
    LE Paired State :    TRUE
    
    GATT Read Request Event
        Connection Type:        LE
        Remote Address:         008865561458
        Service ID:             1
        Request ID:             1
        Attribute Offset:       3
        Attribute Value Offset: 0
    GATM_ReadResponse returned 0 Success
    
    
    
    Remote Device 008865561458 Services Status: LE, SUCCESS.
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x4003F001
    GATT Services Known: TRUE
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x4003F001
    Device Appearance:   64
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    Device Name:         Andrew's iPhone
    LE Type:             Single Mode
    Device Flags:        0x4003F001
    
    GATT Write Request Event
        Connection Type:  LE
        Remote Address:   008865561458
        Service ID:       1
        Request ID:       2
        Attribute Offset: 3
        Data Length:      2
        Value:
    01 00
    
    cccd 0001
    GATM_WriteResponse returned 0 Success
    
    
    
    GATT Write Request Event
        Connection Type:  LE
        Remote Address:   008865561458
        Service ID:       1
        Request ID:       3
        Attribute Offset: 1
        Data Length:      3
        Value:
    63 98 56
    
    GATM_WriteResponse returned 0 Success
    Sending notification of 3 bytes
    63 98 56
    GATM_SendHandleValueNotification returned 0 Success
    
    
    
    GATT Disconnect Event
        Connection Type: LE
        Remote Address:  008865561458
    Adv Length: 33 0x21
    1F 22 02 01 1A 12 16 FA DE 01 00 12 34 56 78 A2 A4 A6 A8 B1 B2 C1 61 68 08 09 48 58 35 43 41 44 00
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x40027001
    LE Connect State:    FALSE
    
    Local Device Properties Changed.
    
    LE Advertising Started.
    DEVM_StartAdvertising returned 0 Success
    
    
    
    Local Device Properties Changed.
    
    LE Advertising Stopped.
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x4002F001
    LE Connect State:    TRUE
    
    GATT Connection Event
        Connection Type: LE
        Remote Address:  008865561458
        MTU:             23
    
    
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x4003F001
    LE Encrypt State:    TRUE
    
    GATT Connection MTU Update Event
        Connection Type: LE
        Remote Address:  008865561458
        New MTU:         185
    
    
    
    GATT Read Request Event
        Connection Type:        LE
        Remote Address:         008865561458
        Service ID:             1
        Request ID:             4
        Attribute Offset:       3
        Attribute Value Offset: 0
    GATM_ReadResponse returned 0 Success
    
    
    
    GATT Write Request Event
        Connection Type:  LE
        Remote Address:   008865561458
        Service ID:       1
        Request ID:       5
        Attribute Offset: 3
        Data Length:      2
        Value:
    01 00
    
    cccd 0001
    GATM_WriteResponse returned 0 Success
    
    
    
    GATT Write Request Event
        Connection Type:  LE
        Remote Address:   008865561458
        Service ID:       1
        Request ID:       6
        Attribute Offset: 1
        Data Length:      4
        Value:
    12 34 56 78
    
    GATM_WriteResponse returned 0 Success
    Sending notification of 4 bytes
    12 34 56 78
    GATM_SendHandleValueNotification returned 0 Success
    
    
    
    GATT Disconnect Event
        Connection Type: LE
        Remote Address:  008865561458
    Adv Length: 33 0x21
    1F 22 02 01 1A 12 16 FA DE 01 00 12 34 56 78 A2 A4 A6 A8 B1 B2 C1 61 68 08 09 48 58 35 43 41 44 00
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x40027001
    LE Connect State:    FALSE
    
    Local Device Properties Changed.
    
    LE Advertising Started.
    DEVM_StartAdvertising returned 0 Success
    
    
    
    Local Device Properties Changed.
    
    LE Advertising Stopped.
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x4002F001
    LE Connect State:    TRUE
    
    GATT Connection Event
        Connection Type: LE
        Remote Address:  008865561458
        MTU:             23
    
    
    
    GATT Disconnect Event
        Connection Type: LE
        Remote Address:  008865561458
    Adv Length: 33 0x21
    1F 22 02 01 1A 12 16 FA DE 01 00 12 34 56 78 A2 A4 A6 A8 B1 B2 C1 61 68 08 09 48 58 35 43 41 44 00
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x40027001
    LE Connect State:    FALSE
    
    Local Device Properties Changed.
    
    LE Advertising Started.
    DEVM_StartAdvertising returned 0 Success
    
    
    
    Local Device Properties Changed.
    
    LE Advertising Stopped.
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x4002F001
    LE Connect State:    TRUE
    
    GATT Connection Event
        Connection Type: LE
        Remote Address:  008865561458
        MTU:             23
    
    
    
    GATT Disconnect Event
        Connection Type: LE
        Remote Address:  008865561458
    Adv Length: 33 0x21
    1F 22 02 01 1A 12 16 FA DE 01 00 12 34 56 78 A2 A4 A6 A8 B1 B2 C1 61 68 08 09 48 58 35 43 41 44 00
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x40027001
    LE Connect State:    FALSE
    
    Local Device Properties Changed.
    
    LE Advertising Started.
    DEVM_StartAdvertising returned 0 Success
    
    
    
    Local Device Properties Changed.
    
    LE Advertising Stopped.
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x4002F001
    LE Connect State:    TRUE
    
    GATT Connection Event
        Connection Type: LE
        Remote Address:  008865561458
        MTU:             23
    
    
    
    GATT Disconnect Event
        Connection Type: LE
        Remote Address:  008865561458
    Adv Length: 33 0x21
    1F 22 02 01 1A 12 16 FA DE 01 00 12 34 56 78 A2 A4 A6 A8 B1 B2 C1 61 68 08 09 48 58 35 43 41 44 00
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x40027001
    LE Connect State:    FALSE
    
    Local Device Properties Changed.
    
    LE Advertising Started.
    DEVM_StartAdvertising returned 0 Success
    
    
    
    Local Device Properties Changed.
    
    LE Advertising Stopped.
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x4002F001
    LE Connect State:    TRUE
    
    GATT Connection Event
        Connection Type: LE
        Remote Address:  008865561458
        MTU:             23
    
    
    
    GATT Disconnect Event
        Connection Type: LE
        Remote Address:  008865561458
    Adv Length: 33 0x21
    1F 22 02 01 1A 12 16 FA DE 01 00 12 34 56 78 A2 A4 A6 A8 B1 B2 C1 61 68 08 09 48 58 35 43 41 44 00
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x40027001
    LE Connect State:    FALSE
    
    Local Device Properties Changed.
    
    LE Advertising Started.
    DEVM_StartAdvertising returned 0 Success
    
    
    
    Local Device Properties Changed.
    
    LE Advertising Stopped.
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x4002F001
    LE Connect State:    TRUE
    
    GATT Connection Event
        Connection Type: LE
        Remote Address:  008865561458
        MTU:             23
    
    
    
    GATT Disconnect Event
        Connection Type: LE
        Remote Address:  008865561458
    Adv Length: 33 0x21
    1F 22 02 01 1A 12 16 FA DE 01 00 12 34 56 78 A2 A4 A6 A8 B1 B2 C1 61 68 08 09 48 58 35 43 41 44 00
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x40027001
    LE Connect State:    FALSE
    
    Local Device Properties Changed.
    
    LE Advertising Started.
    DEVM_StartAdvertising returned 0 Success
    
    
    
    Local Device Properties Changed.
    
    LE Advertising Stopped.
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x4002F001
    LE Connect State:    TRUE
    
    GATT Connection Event
        Connection Type: LE
        Remote Address:  008865561458
        MTU:             23
    
    
    
    GATT Disconnect Event
        Connection Type: LE
        Remote Address:  008865561458
    Adv Length: 33 0x21
    1F 22 02 01 1A 12 16 FA DE 01 00 12 34 56 78 A2 A4 A6 A8 B1 B2 C1 61 68 08 09 48 58 35 43 41 44 00
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x40027001
    LE Connect State:    FALSE
    
    Local Device Properties Changed.
    
    LE Advertising Started.
    DEVM_StartAdvertising returned 0 Success
    
    
    
    Local Device Properties Changed.
    
    LE Advertising Stopped.
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x4002F001
    LE Connect State:    TRUE
    
    GATT Connection Event
        Connection Type: LE
        Remote Address:  008865561458
        MTU:             23
    
    
    
    GATT Disconnect Event
        Connection Type: LE
        Remote Address:  008865561458
    Adv Length: 33 0x21
    1F 22 02 01 1A 12 16 FA DE 01 00 12 34 56 78 A2 A4 A6 A8 B1 B2 C1 61 68 08 09 48 58 35 43 41 44 00
    
    Remote Device Properties Changed.
    BD_ADDR:             008865561458
    Address Type:        Public
    LE Type:             Single Mode
    Device Flags:        0x40027001
    LE Connect State:    FALSE
    
    Local Device Properties Changed.
    
    LE Advertising Started.
    DEVM_StartAdvertising returned 0 Success
    
    

    1121.BTSnoop_3rdConnectionIssue.log
    btsnoop��:�MpZ�#
    
    �:�Mp\�#$�:�Mp]�$$�:�Mp_$�:�Mpm��:�MpoV��-���{��:�Mpqt�:�Mpr���-���{��:�Mps�#
    
    �:�MpuE#$�:�Mpu�$$�:�Mpw5$$$�:�M��  ��4Vx�������ah	HX5CAD�:�M�% $$�:�M�&9	  �:�M�(�	 �:�M�*a 
    �
    �:�M�3| �:�M�B2
     �:�M�D�
     �:�P�>�ʾ��|H$$�:�P��  �%�����KI@T�o�b��|�:�P�t �aK�н-<�%Mf~.��$$�:�P��  Y�O����f�tO�ٚ�|�:�P�## p��26�������$$�:�P�$4  �
    ����i�~7��G����|�:�P�*~ �ʾ�iM`�lVqKj�:�P���$:	�:�P��+$��:�P�Ձ��:�P��F$(�:�P���	
    �:�P��7�:�P���$
    �:�P���
    �:�P��j$
    @�:�P���	
    @�:�P�}��:�P�	$
    �:�P���:�P��� �:�P��� �z��^�:��:�P��p �:�P��* �$~�t6�
    $$�:�P���  @��z��^�*É&~�u&�	�:�P��! ��PEU����-4���$$�:�P���  @�#�L�.Y=2~��H����:�P��� yǡWv�7��%-%߃�:�P���:�P�6:$�0�Z����v�1���:�P�7�yǡWv�7��%-%߃�:�P�t$��@a��O_v�Hn���b$$�:�P� �  @���Ae��_\u�Hn���a�:�P�'� 9�)���{��
    �b[i�a$$�:�P�(M  @���5z��Z�[i�a�:�P�.� �0�Z����v�1���:�P�/��z��^�:��$~�t6�
    $$�:�P�0E  @���@a��O_�z��^�:��:�P�6c ����	���<8��$H�:�P�	��:�P���>
    �:�P��� ����	���<8��$H		�:�P��� �:�P��8�:�P��L �:�P��� f6�2��}��:�P��� �:�P�ڑ l7�I��0�:�P��a �:�P��� Q�L� HP��:�P�ݢ �:�P�� �CS=?o�A�:�P���f6�2��}�l7�I��0�:�P��	Q�CS=?o�A�:�P��J�c�XZub�eńښq���:�P��b	�\�{��:�P�,��:�P�>�:�P�1$�@���)�u1I�V��:�P��$�3*P+ؙh3��:�P⢞$�
    ����i�~7��G���:�P⤧$	XVe��:�P����(�:�P�S$
    @�:�P���:�P���:�P��$	�:�P㋓$@D*�:�P㌫
    ��(�:�P�.
    	BHX5CAD�:�P�s*  �:�P�t�$*
    fC�yH���E��xa��:�P�u��]�CӐ�BEgI����:�P�w��(�:�P�]3$"
    �:�P�^}#��(�:�P�G�  �:�P�Ii$*#,�-K��Nε1�y-�:�P�Jk8��U���:C6+PӉ�:�P�Kh9��(�:�P�1�$	9
    �:�P�3(�:�P���:�P��$	
    �:�P�:(�:�P�{�$	**�:�P�|�	(�:�P�e��:�P�f�$		
    �:�P�g�	(�:�P�O�$
    		 *�:�P�P�		(�:�P쯪�:�P��$		
    �:�P��			�:�P��$
    	)�:�P��
    (�:�P����:�P��E$	
    �:�P��e
    (  �:�P��$	�I�'�T턑L7�lUg��:�P���
    (�:�P��O�:�P�σ$	
    �:�P�І	
    �:�P�$
    
    ))�:�P�(�:�P��:�P�;$	
    �:�P�E(  �:�P��$	���I�{�z��C�[����:�P�4(�:�P�w��:�P�x�$	
    �:�P�z	�:�P�b'$
    ))�:�P�c�(�:�P�L��:�P�M�$	
    �:�P�OM(�:�P�6�$
    		*�:�P�8z(�:�P�!D�:�P�"�$	
    �:�P�#�	�:�P��$
    )�:�P��(�:�P���:�P��F$	
    �:�P��b(�:�P��$	+**�:�P��	�:�P����:�P��,$
    )�:�P��a"(�:�P��q$	"
    �:�P��&"(�:�P�K�:�P��$	 )*!"$*�:�P�@#,(�:�P��$	,
    �:�P�|#,(�:�P��f  �:�P��"$A	$�%�٪���!��I�E���i  �:�P��'(����%X��Bc
    ��*+��:�P���{|�j�D��K�$���"�:�P���,,(�:�Q�%$	,
    �:�QՂ	&&�:�Q�N�:�Q��$
    &)�:�Q��	))�:�Q��$
    ))�:�Q��	,,�:�Q��:�Q�s$
    ,)�:�Q��-8(�:�Q+$@D*�:�Q	�
    	BHX5CAD�:�Q}=$	8
    �:�Q~�-8(�:�Q�N  �:�Qh�$A	.�/�Q��V߸�J�W؁<�  �:�Qj�2�3������A��Ϋ|/6�7��:�Qocջp�����F�#����:�Qp�88(�:�QR%�:�QSp$	8
    �:�QT�	01�:�Q<�$
    0)1)�:�Q>?	45�:�Q'�:�Q(W$
    4)5)�:�Q)f	88�:�Q	i$
    8)�:�Q	2�
    �:�Q	��:�Q	��$@�:�Q	�8
    �:�Q
    ��$Andrew's iPhone�:�Qm��:�Qna$	@
    
    �:�Qu��:�Q���:�Qqq�$
    @c�V
    
    �:�Qqy��:�Qq�
    @c�V�:�QsF�:�QsG�$
    @�:�QsH�	
    @�:�Qu���:�R���$$�:�R���  ��4Vx�������ah	HX5CAD�:�R��M $$�:�R�،	  �:�R�ڕ	 �:�R��m 
    �
    �:�R�� �:�R���
     �:�R�߭
     �:�S^_�>�ʾ��|H$$�:�S^b�  �%�����KI@T�o�b��|�:�S^ip �aK�н-<�%Mf~.��$$�:�S^k
      Y�O����f�tO�ٚ�|�:�S^q^ p��26�������$$�:�S^r+  �
    ����i�~7��G����|�:�S^xe �ʾ�iM`�lVqKj�:�S`��>
    �CS=?o�AQ��:�S`�Z f6�2��}�l7�I��0		�:�S`�9 �:�Sb���:�Sc��$:	�:�SdT?$��:�SdUC��:�Se?8$(�:�Se@�	
    �:�Sf)9�:�Sf*z$
    �:�Sf+�
    �:�Sg�$
    @�:�Sg�:�Sg���:�S��$@D*�:�S��n
    	BHX5CAD�:�S�D��:�S��G$	@
    
    �:�S����:�S���:�T�$@4Vx
    
    �:�T��:�T%�@4Vx�:�T��:�T�$
    @�:�T�	
    @�:�Tr��:�TZ�$$�:�TZ�j  ��4Vx�������ah	HX5CAD�:�TZ�� $$�:�TZ��	  �:�TZ�	 �:�TZ�� 
    �
    �:�TZ�} �:�TZ�=
     �:�TZ�
    
     �:�U�K>�ʾ��|H$$�:�U�#  �%�����KI@T�o�b��|�:�U�� �aK�н-<�%Mf~.��$$�:�U�'  Y�O����f�tO�ٚ�|�:�U�} p��26�������$$�:�U݇  �
    ����i�~7��G����|�:�U� �ʾ�iM`�lVqKj�:�U ؅>
    �CS=?o�AQ��:�U �6 �/�C�h7�		�:�U � �:�U"�=$$�:�U"��  ��4Vx�������ah	HX5CAD�:�U"�� $$�:�U"�	  �:�U"�5	 �:�U"�i 
    �
    �:�U"� �:�U"��
     �:�U"��
     �:�US�Q>�ʾ��|H$$�:�US�o  �%�����KI@T�o�b��|�:�US� �aK�н-<�%Mf~.��$$�:�US�:  Y�O����f�tO�ٚ�|�:�US� p��26�������$$�:�US�  �
    ����i�~7��G����|�:�US�� �ʾ�iM`�lVqKj�:�UV
    �>
    �CS=?o�AQ��:�UVe �/�C�h7�		�:�UV\ �:�UW�L=$$�:�UW��  ��4Vx�������ah	HX5CAD�:�UW� $$�:�UW�>	  �:�UW�	 �:�UW� 
    �
    �:�UW�] �:�UW�
     �:�UW�
     �:�Upy�>�ʾ��|H$$�:�Up|e  �%�����KI@T�o�b��|�:�Up� �aK�н-<�%Mf~.��$$�:�Up��  Y�O����f�tO�ٚ�|�:�Up� p��26�������$$�:�Up��  �
    ����i�~7��G����|�:�Up� �ʾ�iM`�lVqKj�:�Ur�
    >
    �CS=?o�AQ��:�Urϒ �/�C�h7�		�:�Ur�v �:�Ut��=$$�:�Ut�_  ��4Vx�������ah	HX5CAD�:�Ut�� $$�:�Ut��	  �:�Ut��	 �:�Ut�� 
    �
    �:�Ut�o �:�Ut�
     �:�Ut�
     �:�U�R�>�ʾ��|H$$�:�U�U�  �%�����KI@T�o�b��|�:�U�\� �aK�н-<�%Mf~.��$$�:�U�^�  Y�O����f�tO�ٚ�|�:�U�e p��26�������$$�:�U�e�  �
    ����i�~7��G����|�:�U�l� �ʾ�iM`�lVqKj�:�U�Q�>
    �CS=?o�AQ��:�U�S� �/�C�h7�		�:�U�U� �:�U�"�=$$�:�U�)5  ��4Vx�������ah	HX5CAD�:�U�,� $$�:�U�-�	  �:�U�/�	 �:�U�0� 
    �
    �:�U�2� �:�U�3>
     �:�U�5
     �:�U��N>�ʾ��|H$$�:�U��t  �%�����KI@T�o�b��|�:�U�� �aK�н-<�%Mf~.��$$�:�U��G  Y�O����f�tO�ٚ�|�:�U�ܐ p��26�������$$�:�U��j  �
    ����i�~7��G����|�:�U�� �ʾ�iM`�lVqKj�:�U�t>
    �CS=?o�AQ��:�U�s �/�C�h7�		�:�U�e �:�U���=$$�:�U��  ��4Vx�������ah	HX5CAD�:�U�� $$�:�U���	  �:�U��)	 �:�U��H 
    �
    �:�U��� �:�U���
     �:�U���
     �:�U��>�ʾ��|H$$�:�U��  �%�����KI@T�o�b��|�:�U�� �aK�н-<�%Mf~.��$$�:�U� H  Y�O����f�tO�ٚ�|�:�U�&� p��26�������$$�:�U�'^  �
    ����i�~7��G����|�:�U�-� �ʾ�iM`�lVqKj�:�U�d�>
    �CS=?o�AQ��:�U�fb �/�C�h7�		�:�U�h> �:�U�5�=$$�:�U�<:  ��4Vx�������ah	HX5CAD�:�U�@n $$�:�U�A�	  �:�U�C~	 �:�U�D� 
    �
    �:�U�FS �:�U�G
     �:�U�I
     �:�U�ٚ>�ʾ��|H$$�:�U��S  �%�����KI@T�o�b��|�:�U��m �aK�н-<�%Mf~.��$$�:�U��  Y�O����f�tO�ٚ�|�:�U�� p��26�������$$�:�U��]  �
    ����i�~7��G����|�:�U�� �ʾ�iM`�lVqKj�:�U��M>
    �CS=?o�AQ��:�U��E �/�C�h7�		�:�U��A �:�V�&=$$�:�V��  ��4Vx�������ah	HX5CAD�:�V�� $$�:�V�	  �:�V�	 �:�V�V 
    �
    �:�V� �:�V��
     �:�V��
     �:�W:�?
     �:�W:��
     

  • Andrew,

    Exactly which trace in the logs indicates the MIC failure?
  • Andrew,

    The "Connection Terminated due to MIC Failure (0x3D)" reason for disconnection will happen under one of the following conditions.

    - If the remote device sends LL_TERMINATE_IND with MIC failure as a reason code.

    - If there is a link layer (LL) transaction collision while an encryption transaction is pending.

    From the description and the btsnoop logs, it appears that this error is mainly due to the collision mentioned above. To confirm and debug this issue further, we will need the WL183x FW logs from the BT_UART_DBG pin using the BT Logger tool (User's Guide).

    Best regards,

    Vihang

  • Hi Andrew,

    I do not see a disconnection event in the 0763.logs.zip file that show the "Connection Terminated Due to MIC Failure"(0x3D) as the error code. Did you observe the original issue while capturing these logs?

    Additionally, the FW logs (*.lgr) only contained information from the "BT Logger 1" port and not the "HCI/LMP Viewer 1" port. So I could not confirm which one of the conditions mentioned above are causing this error because it does not cover the complete picture. Though from the limited information in these traces, I do not see an indication that the remote device is sending the LL_TERMINATE_IND. So we can rule out the first condition for now. (If you capture full logs for the next instance, we can get a confirmation).

    Regarding the second condition, please refer to the following from the BT spec.

    "If at any time during the encryption start procedure, the Link Layer of the master or the slave receives an unexpected Data Channel PDU from the peer Link Layer, it shall immediately exit the Connection State, and shall transition to the Standby State. The Host shall be notified that the link has been disconnected with error code "Connection Terminated Due to MIC Failure"(0x3D)."

    So the MIC failure error would be expected in this scenario. A solution would be to make sure that the remote device does not send any data before the connection is encrypted.

    Best regards,

    Vihang

  • Hello Vihang,

    I have been working with Andrew on this issue and generated the previous log file he submitted.

    At the moment, I am unable to get the Logger to capture log from the "HCI/LMP Viewer 1" port.  Attached is the BT Logger and HCI/LMP viewer setup. I have also clicked on View -> Show All Items but still do not see the HCI/LMP messages o the Logger. I am using Logger 5.0 from the WirelessTools installer version 4.0.0.2. Is there something else that should be done in order for the Logger to log HCI/LMP?

  • Hi Hieu,

    Your logger version is the latest, but the TIInit_11.8.32.ili and TIInit_11.8.32.xml files seem to be corrupted. You can download these files from the WL18XX-BT-SP page.

    For your reference, a complete log will look like the following.

    Best regards,

    Vihang

  • Hello Vihang,

    Thanks for the link to the *.ili and *.xml. The Logger is working as expected now.bonding_debug_20180213.zip 

    Please see attached for the log files with the HCI/LMP messages. I am providing to you two log files: one captured while using the LightBlue iOS app and the other using the BTool. Also included in the zip is the BTool log. 

    BTool fails to bond on the third (similar to iOS). Note that BTool is not sending any data before the link is encrypted.

  • Hi Hieu,

    I do not see the "MIC Failure (0x3D)" error code for any disconnection event in these logs. All the disconnections in these logs are result of the remote side terminating the connection. Can you make sure that we are still addressing the same problem as the one mentioned in the original post?

    Best regards,
    Vihang
  • Hello Vihang,

    The original intent of this post is to resolve the problem where the 3rd GAP_Bond attempt fails causing the connection to be closed by the remote device. See the Btool log I had submitted.

    We originally though the "MIC Failure (0x3D)" error code had something to do with this issue. However, it seems the MIC failure error code is not observed across different remote devices (ie different iOS devices, BTool with CC2540 usb dongle, etc) so this might have been a red herring.

    Regards,
    Hieu
  • Hi Hieu,

    Thanks for the clarification. Both of the last logs indicate that the failure in connection is caused by the remote side terminating the Link Layer connection, and the . So I do not think there is a Link Layer/firmware issue causing that. There could be a profile / application level problem that might be causing the remote side to terminate the connection. For example, the last event in the Bonding_Debug_ios_20180213.lgr before the remote host terminates the connection is the LE_Long_Term_Key_Requested_Event. The host would reply to this event with HCI_LE_Long_Term_Key_Requested_Reply command. In the 3rd and 4th attempt, the host does not respond with this command. This could halt the encryption and cause the remote device to terminate the connection.

    The original post mentioned that you are using fixed passkey. How are you implementing fixed passkey with BluetopiaPM? Moreover, have you tried the same use-case with an unmodified BluetopiaPM sample application like the LinuxGATM_CLT?

    Best regards,
    Vihang
  • Hello Vihang,

    We are setting the fixed passkey using the GAP_LE_Set_Fixed_Passkey function call inside BTPMSRVR via the InitializationDoneCallBack.

    Per your recommendation I repeated the bonding test on the LinuxGATM_SRV (unmodified) application. The request for encryption still fail on the 3rd attempt. See attached for logs. The LinuxGATM_SRV run on the development hardware and I am using BTool with the CC2540 USB BLE dongle as the client.

    Here are the steps I performed:

    GATM: 1 1

    GATM: 10 1

    GATM: RegisterAuthentication

    GATM: RegisterGATTCallback

    GATM: StartAdvertising 0x5 100

    BTool: Scan and Establish connection

    BTool: Send Pairing Request (with Bonding Enable and MITM checked)

    BTool: Send Passkey

    BTool: Save LTK to file

    BTool: Load LTK from file

    BTool: Encrypt Link

    BTool: Terminate connection

    GATM:  StartAdvertising 0x5 100

    BTool: Scan and Establish connection

    BTool: Encrypt Link

    BTool: Terminate connection

    GATM:  StartAdvertising 0x5 100

    BTool: Scan and Establish connection

    BTool: Encrypt Link (GAP_Bond fail with status "Invalid Event Id") Note that connection is still active even after the bond failure.

    bonding_debug_20180214.zip

  • Hi Hieu,

    Thanks for sharing the details. I have notified our stack experts about this issue. They are currently looking into this issue.
    In the meantime, it would be really helpful if we can recreate this issue using LinuxGATM_SRV application with iOS device on the remote side. Do you have similar instructions for us to recreate this issue with iOS?

    Best regards,
    Vihang
  • Hello Vihang,

    When using LightBlue on an iOS device, the iOS device successfully connect but never asks for the passkey input (ie no authentication request was sent by the iOS device). 

    Regards,

    Hieu

  • Hieu,

    Apologies for the delayed response. Using a CC256x device running an LE profile as the client and an unmodified LinuxGATM_SRV on the WiLink side, I don't run into any issues with disconnecting and reconnecting multiple times. Have you seen this issue with any other client devices besides the BTool?
  • Hello Dale,

    When I use an iOS or Android device I observe different behavior. See my last response to Vihang regarding what happens when I use the LightBlue app on iOS. Bonding fails on first attempt when I use nRF Connect on Android. Unfortunately, I currently do not have a CC256x device to attempt to repeat your experiment.

    What is the best way (outside this forum) to provide you with our BTPM Application source files so that you can attempt to reproduce the issue we are seeing on your WiLink setup?

    Regards,

    Hieu

  • Hieu,

    I've sent a friendship request to connect via E2E. Once you accept, we can exchange whatever files you wish via private message.