AnsweredAssumed Answered

QN902x example takes >20 seconds to bond with iOS 12.3

Question asked by Hugh O'Keeffe on Jun 24, 2019
Latest reply on Aug 2, 2019 by Hugh O'Keeffe

SETUP:

  1. NXP QN902x_SDK_1.4.0 on a QN9020_MINIDK_V8 board.
  2. BLPS example program that comes with the SDK
  3. nRF Connect application running on an iPhone with iOS 12.3

 

PROBLEM:

I am seeing the following two problems when using the example program:-

  1. Bonding takes circa 25 seconds to complete
  2. Once bonding is complete, if I disconnect and reconnect, the status is still shown as bonded by both the phone app and the firmware debug printfs. However, I get authentication errors when I try to read the characteristics.

The following changes have been made to the BLPS example program:-

  1. \Projects\BLE\src\profiles\blp\blps\blps.c

Set all characteristic declarations to AUTH as opposed to ENABLE.

  1. \Projects\BLE\src\app\app_config.h

Set the SMP Security level and IO capability definitions to...

        #define QN_SEC_MODE_LEVEL       GAP_SEC1_AUTH_PAIR_ENC

        #define QN_IO_CAP_ABILITY       SMP_IO_CAP_DISPLAY_ONLY

  1. \Projects\BLE\prj_blps\src\usr_config.h

Set the chip version to B2....

#define CFG_9020_B2

  1. Keil Project File

Exclude qn9020b4_lib_peripheral_v42.lib from the build

Include qn9020b2_lib_peripheral_v42.lib in the build

 

On initial power-up / connection, the following debug printfs are shown:-

QN BLE is ready.

Advertising start.

Connection with 6526DEE2CD55 result is 0x0.

IRK request indication idx is 0.

Slave update success.

Update parameter complete, interval: 0xc6, latency: 0x0, sup to: 0x12c.

Accept Bond request indi received from 6526:DE:E2CD55.

TK request indication idx is 0.

PASSKEY: 123456

<NOTE:- Circa 25 seconds delay>

Key 1 indication idx is 0.

Key 2 indication idx is 0.

Bond request complete handle: 0000, bonded: 1, status: 0x00.

 

 

When I look at the characteristics (0x2A49 for example) on the phone app, it shows that it has read it successfully as per the following screen grab:-

 

When I disconnect via the app on the phone, the following debug printfs are shown:-

 

Disconnect with 5527BB25B41F reason is 0x13.

Advertising start.

 

When I reconnect via the app on the phone, the following debug printfs are shown:-

 

Connection with 5527BB25B41F result is 0x0.

IRK request indication idx is 0.

IRK request indication idx is 255.

Update parameter complete, interval: 0xc6, latency: 0x0, sup to: 0x12c.

LTK request indication idx is 0, auth_req is 13.

Start encryption complete, idx 0, status 0, key_size 0, sec_prop 12, bonded 1.

Slave update success.

 

 

When I now look at the characteristics (0x2A49 for example) on the phone app, it shows authentication insufficient as as per the following screen grab:-

 

 

 

Any help appreciated in advance.

 

Thanks

Hugh

Outcomes