KW41Z Pairing Bonding Process

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

KW41Z Pairing Bonding Process

1,398 Views
florian_lebrun5
Contributor III

Hi all,

My prototype uses Rigado R41Z.

I'm able to connect, list all my services, sleep, wake up, connect etc without issue.

I started from HRS into, i integrate Otap functionnality ( may be it has an impact on my issue ? adresse conflict when save information on paring  or something like that ?)

Now i'm enabling the pairing /bonding #include.

I was able only one time with iot toolbox to bounded and have hrs value updating in the app.

Then i tried with nRf , it was boded and connected, but impossible to get all my services etc. Then i came back to iOt Toolbox, the same, unable to have again the hrs working.

I force to unpair via android my R41Z eval board.

Now impossible to get the paring process properly, when i click to connect both even in android, no pop up comes to enter the 6 digit passkey. It just doesn ' t connect and nothing happens.

Also i see in the video that you have to disable Power down mode. I'm using low power and wake up perdiodically to check if i somebody wants to connect. Can you confirm we can use pairing process even with sleeping mode please ?

Is there dedicated step i forgot or a memory i corrupt ? Is the external memory used to save the pairing device please ?

Thanks a lot bcause i'm a bit lost :smileysad:

Labels (2)
5 Replies

1,202 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Florian, I hope you're doing well!

 

Could you please let me know which definitions did you enable/disable on your app_preinclude.h header file?

Specifically:

  • Is the privacy flag (gAppUsePrivacy_d) enabled?
  • Is the NVM flag (gAppUseNvm_d) enabled?

 

When pairing and bonding a device using these examples, information about the bond is saved to NVM (if enabled) or RAM, and, if for some reason, a proper disconnection is not performed, information about the bond may not be cleared accordingly, and may prevent the application from working as intended.

 

Best regards,

Sebastian

1,202 Views
florian_lebrun5
Contributor III

Hi Sebastian,

Thanks a lot for your answer and you help.

Is the privacy flag (gAppUsePrivacy_d) enabled?

-> no, i try with, same result no pop up for pairing

Is the NVM flag (gAppUseNvm_d) enabled?

-> Yes, as OTAP feature as been merged into my HRS project. I have to first flash otap firmware, then flash my application based on hrs into the memory. 

Is it possible to have a conflict of access to tha nvram because of the otap function?

When i run latest hrs project it works fine. So I used Winmerge to compare the two project.

in app_preinclude.h, i see some difference that i tried to change without success yet:

I'm using powerDowm mode to 1 to sleep between advertising if no central scan.

Here in hrs :

/* Defines pools by block size and number of blocks. Must be aligned to 4 bytes.*/
#define AppPoolsDetails_c \
_block_size_ 32 _number_of_blocks_ 6 _eol_ \
_block_size_ 64 _number_of_blocks_ 3 _eol_ \
_block_size_ 128 _number_of_blocks_ 10 _eol_ \
_block_size_ 512 _number_of_blocks_ 10 _eol_

also :

/* Defines total heap size used by the OS */
#define gTotalHeapSize_c 8000

and in mine :

/* Defines pools by block size and number of blocks. Must be aligned to 4 bytes.*/
#define AppPoolsDetails_c \
_block_size_ 32 _number_of_blocks_ 8 _eol_ \
_block_size_ 64 _number_of_blocks_ 5 _eol_ \
_block_size_ 128 _number_of_blocks_ 4 _eol_ \
_block_size_ 512 _number_of_blocks_ 10 _eol_

/* Defines total heap size used by the OS */
#define gTotalHeapSize_c 8500 //8000

in the  MKW41...connectivity.ld there is also some diference 

in HRS :

gUseBootloaderLink_d = DEFINED(gUseBootloaderLink_d) ? gUseBootloaderLink_d : 0;
*/

/* By default, the NVM is not used. */
gUseNVMLink_d = DEFINED(gUseNVMLink_d) ? gUseNVMLink_d : 1;

in my code

gUseBootloaderLink_d = DEFINED(gUseBootloaderLink_d) ? gUseBootloaderLink_d : 1;
*/

/* By default, the NVM is not used. */
gUseNVMLink_d = DEFINED(gUseNVMLink_d) ? gUseNVMLink_d : 0;

But it is may be normal as i'm using otap.

I ran in debug mode step by step my program, and in ble_con_manager, i reach gConEvtConnected_c but never ParamRequest or EvtPairingRequest... so i guess that's normal i never see on smartphone the pop up to enter 6 digit code.

0 Kudos

1,202 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Florian,

 

Could you please try performing a mass erase by using the "unlock kinetis" command with J-Link Commander on your KW41Z? A guide on how to perform it can be found here. After the unlock, does the pairing and bonding process still not initiate?


Could you please let me know the procedure that was followed to add OTA support to the HRS example? This could be having an impact in the way the information for pairing and bonding is saved to NVM.

 

Best regards,

Sebastian

0 Kudos

1,202 Views
florian_lebrun5
Contributor III

Hi Sebastian,

Here is the tutoriel i followed to merge: 

https://community.nxp.com/docs/DOC-343990 

So i have two step to perform: first flash bottloader otap client in memory, then flash my application ( in witch i merge the otap services , application code etc ...)

I will try to erase the full memory and then re program like you advise.

Thanks a lot for your help.

0 Kudos

1,202 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Florian,

 

Did you do any additional changes to the application itself to merge the OTAP and HRS examples? 

 

Please let me know of your findings about the device wipe and reprogramming.

 

Best regards,

Sebastian

0 Kudos