Qn908x HID Device Pairing

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Qn908x HID Device Pairing

Jump to solution
1,956 Views
ankur_rathi
Contributor IV

I am using QN908x dev board and SDK2.2.0_QN908XCDK and MCUExpresso IDE for development purpose.

I loaded HID device (bare metal) example code and when I connect to my Android App (nRF Connect), its getting connected and when I try to connect it with System Bluetooth, it through an error "pairing Rejected", which is correct as Pairing and Bonding was disabled.

Now, I have enabled Pairing and Bonding in "app_preinclude" header file:
/*! Enable/disable use of bonding capability */
#define gAppUseBonding_d   1

/*! Enable/disable use of pairing procedure */
#define gAppUsePairing_d   1

But, when I tried to connect it with system Bluetooth as well as Mobile Application, it through an error "Could not pair with NXP_HID because of incorrect pin or passkey.".

It doesn't ask to Enter pairing pin.
I am using nRF Connect mobile application to check the BLE behavior.

I want Pairing and Bonding to be enabled. So, do you have any example code for Pairing and Bonding and also do OOB pairing is supported in QN908x.

While going through forum, I just saw that Enabling in "app_preinclude" header file has solved pairing problem but I was not able to pair. Is there any extra setting/modification need to be done to make pairing possible?

Labels (1)
  • QN

0 Kudos
1 Solution
1,603 Views
ankur_rathi
Contributor IV

With new SDK (SDK_SDK_2.2.1_QN908XCDK), Bare Metal example code is working fine.

The new SDK can be downloaded from the link:

https://mcuxpresso.nxp.com/en/license?hash=21a9800cfb7c901e52a996ac70522d3d&hash_download=1

View solution in original post

0 Kudos
12 Replies
1,604 Views
ankur_rathi
Contributor IV

With new SDK (SDK_SDK_2.2.1_QN908XCDK), Bare Metal example code is working fine.

The new SDK can be downloaded from the link:

https://mcuxpresso.nxp.com/en/license?hash=21a9800cfb7c901e52a996ac70522d3d&hash_download=1

0 Kudos
1,603 Views
ankur_rathi
Contributor IV

Has anyone faced this kind of issue?

Need urgent help on this.

Can anyone from NXP help/respond on this ?

0 Kudos
1,603 Views
ankur_rathi
Contributor IV

Strange, I was trying with Bare Metal example code and its not working at all whatever I try to do.

So, I tried with FreeRTOS example code and made the same modifications i.e. only two Macros changed and it works flawlessly every time.

Is there any different setup/steps wrt Bare Metal or any bug which is causing this?

Can anyone provide any info on which is better to use BareMetal or FreeRTOS?
I don't have much knowledge on RTOS kind of stuff.

0 Kudos
1,603 Views
ankur_rathi
Contributor IV

I am using MCUXpresso v11.0.0 to build QN908x (HID device example code).
QN908x SDK v2.2.0.

I am using HID device Bare Metal example code.
I want to enable "Pairing" in this example code, so in "app_preinclude" header file, I am modified following macro to:

#define gAppUseBonding_d   1                          /*! Enable/disable use of bonding capability */
#define gAppUsePairing_d   1                           /*! Enable/disable use of pairing procedure */

I build the project successfully without any error and then loaded onto QN9080DK-V1.3.
I am able to see the "NXP_HID" device onto mobile app but when I try to connect, it through an error "Could not pair with NXP_HID device because of incorrect Pin", but strange it has not asked for Pairing Pin.

While debugging, I am able to see setting of Pairing Pin API gets called as well as Pairing Complete event get triggered but I am not able to successfully Pair the device with Mobile.

Pairing setting (app_config.c):
/* SMP Data */
gapPairingParameters_t gPairingParameters = {
    .withBonding = TRUE,    //gAppUseBonding_d,
    .securityModeAndLevel = gSecurityMode_1_Level_4_c,
    .maxEncryptionKeySize = mcEncryptionKeySize_c,
    .localIoCapabilities = gIoDisplayOnly_c,
    .oobAvailable = FALSE,
    .centralKeys = (gapSmpKeyFlags_t) (gLtk_c | gIrk_c),
    .peripheralKeys = (gapSmpKeyFlags_t) (gLtk_c | gIrk_c),
    .leSecureConnectionSupported = TRUE,
    .useKeypressNotifications = FALSE,
};

Attached the screenshot while debugging, it goes to HardFault Handler after BLE_Init() function call after trying to connect multiple timesPairingLog.png

Do please let me know if something I am doing wrong or following some wrong procedure to enable pairing.

Is there any document explaining steps to Enable and setting Pairing.

I have already gone through BLE developer document.

0 Kudos
1,603 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello,

Are you pressing the button 1 to start advertising and getting everything working ? I was able to make it work just changing those two defines.

Also, which IDE are you using and SDK versions ? I would recommend you to use the latest version of both, also when importing the project please be sure to use the UART instead of the semi hosting.

Please check as well the Bluetooth® Low Energy Demo Applications User’s Guide, I believe this might be useful for you if you are just getting started working with this device.

Regards,

Estephania

0 Kudos
1,603 Views
zhi_wang
Contributor III

Hi Estephania,

i  have a problem about Pairing and bonding,

 

while the pairing and bonding and encryption are working fine, but cannot access to the encryption  required Characteristic value and description.

you can have a check of my issue,

https://community.nxp.com/message/1195965?commentID=1195965#comment-1195965  

i have reported this issue, but seems no one is looking at this one...

Regards,

Ziv

0 Kudos
1,603 Views
ankur_rathi
Contributor IV

Sorry Estephania for late response.
I have modified those two Macros before only but my Mobile device doesn't ask for Pairing pin. It directly through an error. I am using Redmi Note 7 Pro.

But strange, it works on One Plus 6T consistently.
I tried Restarting my phone and Turning ON/OFF Bluetooth also, then also popup for pairing pin is not getting populated.


0 Kudos
1,603 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello,

Do you have the location enables as well in your device ?


Regards,

Estephania

0 Kudos
1,603 Views
ankur_rathi
Contributor IV

Yes, location is enabled on the device.
Does OOB is also supported on QN908x?

0 Kudos
1,603 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello,

There is an example for the KW41Z that you can use as a base and there is one example for the QN9080-001-ML17, those uses an NTAG I2C

Regards,

Estephania

0 Kudos
1,603 Views
ankur_rathi
Contributor IV

Thanks for your reply.

I will go through those example code.

On Thu, 13 Jun, 2019, 7:35 PM estephania_martinez, <admin@community.nxp.com>

0 Kudos
1,603 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hope that helps

0 Kudos