KW38 BLE central mode scanning unexpected stop

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

KW38 BLE central mode scanning unexpected stop

1,917 Views
Curly
Contributor II

Hi,

 

I'm using frdmkw38, SDK 2.6.11, MCUXpresso IDE 11.3.1.

Reference from AN12977 to achieve that in central mode and scanning to get RSSI from peripheral. 

Device could scan the specific uuid and add to whitelist, then re-scan with whitelist and show RSSI, but after minutes, device will stop and ScanningCallback could not get any event.

Is there any way to know what cause the problem?

Thanks.

 

Curly

Labels (2)
Tags (1)
0 Kudos
6 Replies

1,884 Views
Curly
Contributor II

Hi Ricardo,

 

Yes, I'm using the Wireless Uart example, and the modification as below.

Setting the EVK board as Central to scan peripheral device, if scanned specific uuid from device, then add to whitelist.

After peripheral device with specific uuid has added into whitelist, Central will scan with whitelist and get RSSI noticication from BleApp_HandleControllerNotification function.

 

The problem I found is that the scanning of central device will stop in a few minutes and system won't report any BLE event, even if using Gap_StopScanning() and restart scanning, it does not work

scanning callback.png

scan state changed.png

Curly

0 Kudos

1,865 Views
Ricardo_Zamora
NXP TechSupport
NXP TechSupport

Hi Curly,

 

Did you try with the files included in the AN Software for AN12977? (KW39/38/37 Documentation)

Ricardo_Zamora_1-1629305839469.png

Path: AN12977SW\AN12977 all file\SDK_2.6.6_FRDM-KW38_MR1\SDK_2.6.6_FRDM-KW38_MR1\boards\frdmkw38\wireless_examples\bluetooth\w_uart

Are you experiencing the same behavior?

 

Best Regards,

Ricardo

0 Kudos

1,848 Views
Curly
Contributor II

Hi Ricardo,

 

I tried the source code, AN Software for AN12977, has the same behavior.

After scaning for minutes, it will stop reporting RSSI and did not receive any event in ScanningCallback.

Could you help to check for this problem?

0 Kudos

1,823 Views
Curly
Contributor II

Hi Ricardo,

 

Found that smart phone will change BLE MAC address periodically, thus, it should re-scanning all peripheral to get RSSI.

But if scanning all peripheral continuously without add whilelist, device will cause hard fault.

MicrosoftTeams-image.png

 

Curly

0 Kudos

1,814 Views
Ricardo_Zamora
NXP TechSupport
NXP TechSupport

Hi Curly,

 

Yes, you are right, the smartphones use a Random Address.

For this, the best would be to use the Privacy, and enabling the Pairing and Bounding in the KW38.

You can find information about the Privacy feature in section 4.4 of the Bluetooth® Low Energy Application Developer’s Guide. (Path: SDK_doc.zip\docs\wireless\Bluetooth)

And to use the Privacy, you would need to Enable the following definitions in app_preinclude.h:

 

/*! Enable/disable use of bonding capability */

#define gAppUseBonding_d   1

 

/*! Enable/disable use of pairing procedure */

#define gAppUsePairing_d   1

 

/*! Enable/disable use of privacy */

#define gAppUsePrivacy_d   1

 

You can use one of the BLE examples of the SDK (for example the Heart Rate Sensor), and the IoT Toolbox. (Just for testing these capabilities).

Hope this helps.

 

Regards,

Ricardo

0 Kudos

1,897 Views
Ricardo_Zamora
NXP TechSupport
NXP TechSupport

Hi Curly,

 

Hope you are doing well. Are you using the Wireless UART example? What modifications did you do?

I am checking the question that you have. Could you please provide more information about the final application that you want to develop?

 

Best Regards,

Ricardo

0 Kudos