Repairing issue with mobile

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

Repairing issue with mobile

747 Views
chintan
Contributor III

Hello,

I am working with KW36 module for my BLE project. I have enabled the Pairing and Bonding to connect with mobile device using authentication. I have also enabled the NVM functionality to store BLE device information to NVM memory.

As per my requirement, I want to store only one BLE device information to NVM memory. So for another BLE device, first I have to remove the information of first BLE device and then store the second BLE device information.

I am using example code: frdmkw36_wireless_examples_bluetooth_w_uart_bm

Below are steps that I am following:

   1. Turn on KW36 module in Peripheral mode.

   2. Connect first mobile device with KW36 module. Device information will be store in NVM.

   3. By sending command on UART via NXP IOT application, I am disconnecting the mobile device and removing the bond. Also erasing the first mobile device information.

   4. After this I try to pair and bond with second device.

After following above steps, module does not stores the Second device information to NVM. Module gives Hard Fault error and enter into infinite loop.

Code flow for second mobile pairing and bonding as below:

         1. First disconnected the first mobile device using Gap_Disconnect() function.

         2. Removed the bonding of first mobile device using Gap_RemoveBond(uint8_t nvmIndex) function.

         3. Erased data from Flash sector 0x7B800 to 0x7F7FF using "NV_FlashEraseSector()" function.

         4. Program the Flash sector from 0x7B800 to 0x7F7FF as per initialization process.

But, still not able to store the second device information.

I am only able to pair, bond and store information to NVM of Second device after restart the KW36 module.

Please guide how can I store the second device information without restart the module?

Thank you.

0 Kudos
3 Replies

646 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Chintan,

I hope you are doing great,

What is the SDK version that you working on?

How are you calling the NV_FlashEraseSector? What are the parameters of this function?

Did you try the same process without the NVM define?

Regards,

Mario

0 Kudos

646 Views
chintan
Contributor III

Hello Mario,

I am fine. Hope you are doing great also.

SDK version is 2.2.1

Parameters for NV_FlashEraseSector() are as below:

   1. NVM start address: 0x7b800

   2. Size: 16384 (which is 16KB)

By passing this parameters data from NVM region get erased successfully.

Did you try the same process without the NVM define?

>> No, I didn't try without NVM define. Because my requirement is that bonded user able to connect with system even after reset the system.

I have tried below changes in which I got half success.

>> Instead of using NV_FlaseEraseSector(), I have called NvFormat() function. Due to this the NVM region get erased and I am able to connect and store information of another mobile device without reset the module. So my problem is solved that not able to connect and store another mobile device information into NVM. 

>> But now each time I tried to store another mobile device information to NVM, the Page Counter is increment. So, Kindly suggest is there any wrong effect of increment page counter?

Also, kindly suggest is this right process I have done? and Is there any other method to accomplish my task?

Thank You.

0 Kudos

646 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Chintan,

I have been checking the issue that you are facing.

Are you sure that you are erasing the bonding information? Is it possible that you could look at the memory flash debugging the MCU?

Please look at the address 0x7f8000.

However, is it possible that you could the App_NvmErase API?

Please look at the 2.3 Non-Volatile Memory (NVM) access

"SDKs\kw36\docs\wireless\Bluetooth\Bluetooth Low Energy Application Developer Guide.pdf"

Regards,

Mario

0 Kudos