CYW43012 BLE passkey with LE security

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
CharlesOram
Level 3
Level 3
First like received Welcome!

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

0 Likes
1 Solution

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

View solution in original post

5 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

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

0 Likes

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

0 Likes
SheetalJ
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 500 likes received

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

0 Likes

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

0 Likes

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