5 Replies Latest reply on Feb 11, 2020 1:35 AM by AnjanaM_61

    CYW43012 BLE passkey with LE security

    ChOr_1920696

      Hi,

      I'm trying to get BLE pairing to work with a CYW43012 (Murata Type1LV module) using LE security and a passkey known at each end, but the pairing stalls after public key exchange.

      The CYW43012 is operating as the central and connecting to an NRF52832 dev board that is running as the peripheral.

      After the CYW43012 connects I call wiced_bt_dev_sec_bond(peer_addr, connection_addr_type, BT_TRANSPORT_LE, 0, NULL); to start the pairing.

      I can see using the sniffer that the CYW43012 sends a pairing request and the peripheral sends a pairing response and then the CYW43012 sends a pairing public key and the peripheral sends a pairing public key, but then the pairing stops and after a while times out and disconnects.

       

      Is there some event that I should be handling to keep the pairing process moving along? I don't see any events that aren't being handled other than (occasionally) a connection update request (which sometimes is sent by the CYW43012 before the pairing request).

       

      The CYW43012  should (as far as I can see from looking at the sniffer log when passkey pairing with LE security works between two NRF52832 dev boards) be sending a Pairing Confirm, but sends nothing.

       

      regards,

      Charles

        • 1. Re: CYW43012 BLE passkey with LE security
          AnjanaM_61

          Hi Charles,

           

          Can you please confirm if you have set the pairing io capabilities correctly?

          Also make sure you are calling wiced_bt_ble_security_grant API in BTM_SECURITY_REQUEST_EVT event.  (Refer to ble_wifi_introducer demo available in WICED app)

          Can you please confirm if you are getting any disconnection reason in the logs - is it authentication error or supervision timeout or anything else?

          Please share the project and steps to reproduce the issue.

           

          Regards,
          Anjana

          • 2. Re: CYW43012 BLE passkey with LE security
            ChOr_1920696

            Hi Anjana,

            Thanks for your reply.

             

            I'm setting the IO capabilities as follows:

             

                case BTM_PAIRING_IO_CAPABILITIES_BLE_REQUEST_EVT:

                    WPRINT_APP_INFO(( "IO capabilities req\n"));

                    p_event_data->pairing_io_capabilities_ble_request.local_io_cap = BTM_IO_CAPABILITIES_KEYBOARD_ONLY;

                    p_event_data->pairing_io_capabilities_ble_request.oob_data     = BTM_OOB_NONE;

                    p_event_data->pairing_io_capabilities_ble_request.auth_req     = BTM_LE_AUTH_REQ_SC_MITM;

                    p_event_data->pairing_io_capabilities_ble_request.max_key_size = 0x10;

                    p_event_data->pairing_io_capabilities_ble_request.init_keys    = BTM_LE_KEY_PENC | BTM_LE_KEY_PID ;

                    p_event_data->pairing_io_capabilities_ble_request.resp_keys    = BTM_LE_KEY_PENC | BTM_LE_KEY_PID ;

                    break;

             

            These IO capabilities settings match the settings at the peripheral and seem to be the only settings that will result in each end asking for the passkey and neither end displaying the passkey.

             

            I am calling wiced_bt_ble_security_grant API in the BTM_SECURITY_REQUEST_EVT event, but I have never seen that event occur, not even when the pairing works (I previously had the pairing working with Just Works pairing). Is BTM_SECURITY_REQUEST_EVT an event that you will only get at the peripheral?

            Where are these events described?

             

            The BLE connection does not disconnect for a few seconds until the peripheral reports a GAP security timeout (which makes sense, since it is waiting for the central to send the next message for pairing to continue).

             

            I can't share my project because it contains source code for my customer's application, but may be able to build an example with that stripped out.

             

            Here are 2 screen dumps of the Wireshark capture. The first one shows the start of the connection and pairing and the second one shows the disconnection. The connection stays up with "Empty PDU"  being sent and received for about 14s and then the peripheral closes the connection.

             

            Screenshot 2019-11-12 21.14.48.png

             

            Screenshot 2019-11-12 21.18.47.png

             

            Thanks.

             

            - Charles

            • 3. Re: CYW43012 BLE passkey with LE security
              SheetalJ_96

              Hi Charles,

               

              Can you try setting the IO capabilities as-

              case BTM_PAIRING_IO_CAPABILITIES_BLE_REQUEST_EVT:

                          p_event_data->pairing_io_capabilities_ble_request.local_io_cap      = BTM_IO_CAPABILITIES_NONE;

                          p_event_data->pairing_io_capabilities_ble_request.oob_data          = BTM_OOB_NONE;

                          p_event_data->pairing_io_capabilities_ble_request.auth_req          = BTM_LE_AUTH_REQ_NO_BOND;

                          p_event_data->pairing_io_capabilities_ble_request.max_key_size      = 0x10;

                          p_event_data->pairing_io_capabilities_ble_request.init_keys         = BTM_LE_KEY_PENC | BTM_LE_KEY_PID ;

                          p_event_data->pairing_io_capabilities_ble_request.resp_keys         = BTM_LE_KEY_PENC | BTM_LE_KEY_PID ;

                          break;

               

              Let me know if this works for you.

               

              Regards,

              Sheetal

              • 4. Re: CYW43012 BLE passkey with LE security
                ChOr_1920696

                Hi Sheetal,

                 

                Yes, it works with those IO capabilities.

                 

                The second Wireshark trace in my earlier post was with these IO capabilities (which I think is effectively the same):

                 

                            p_event_data->pairing_io_capabilities_ble_request.local_io_cap      = BTM_IO_CAPABILITIES_KEYBOARD_ONLY;

                            p_event_data->pairing_io_capabilities_ble_request.oob_data          = BTM_OOB_NONE;

                            p_event_data->pairing_io_capabilities_ble_request.auth_req          = BTM_LE_AUTH_REQ_NO_BOND;

                            p_event_data->pairing_io_capabilities_ble_request.max_key_size      = 0x10;

                            p_event_data->pairing_io_capabilities_ble_request.init_keys         = BTM_LE_KEY_PENC | BTM_LE_KEY_PID ;

                            p_event_data->pairing_io_capabilities_ble_request.resp_keys         = BTM_LE_KEY_PENC | BTM_LE_KEY_PID ;

                 

                regards,

                Charles

                • 5. Re: CYW43012 BLE passkey with LE security
                  AnjanaM_61

                  Hi ,

                   

                  Unfortunately there is an issue on WICED 6.4 & WICED 6.1 version on BLE central with IO capability keyboard.

                  The issue is not there on WICED SDK 6.2.

                  Our software team is working to fix this . Meanwhile please use WICED SDK 6.2 version for your evaluation.

                  Sorry for the inconvenience.

                   

                  Regards,
                  Anjana

                  1 of 1 people found this helpful