Hello,
Request your kind support for solving HardFault issue on FRDM KW38 board during BLE operations of a custom app (GAP central) with a mobile app (peripheral).
Target hardware: FRDM KW38
SDK: MKW38A512xxx4 version: 2.6.5
Pairing/Bonding and NVM support are enabled: gAppUseBonding_d is 1, gAppUsePairing_is 1, gAppUseNvm_d is 1.
Pairing security mode: gSecurityMode_1_Level_1_c
Operation sequence:
1. KW38 target app scans and connects/bonds with the phone
2. Phone transfers some app data
3. Initiate disconnect from KW38. After disconnection de-bond the phone at KW38.
After a couple of repeated sequence above, the Hardfault happens (screenshot attached). Any issues at BLE stack side?
Thank you.
Hi Prince, I hope you're doing well!
I tried replicating the issue, but wasn't able to cause it on purpose. Could you please provide some more information about the program you're running on the KW38? Is it based on a existent SDK example?
Take care, best regards,
Sebastian
Hi Sebastian,
Thank you for your time, analyzing this issue.
I used the KW38 Wireless UART example project as the base (the connection handling part is almost the same, except that I have enabled the pairing/bonding). but added with my custom app code. The app works fine/stable on FRDM KW36 (with KW36 SDK/APIs). RAM and Flash usages are within 50% of total space.
Do I need to refresh SDK components every time, when the SW is build in different PCs? (SDK versions are the same)
Best regards,
Prince
Hi Prince,
Thank you for providing more information.
I performed another test, this time with two FRDM-KW38 with the wireless UART SDK example configured with Pairing, Bonding, NVM, and Security Mode 1 and Level 1:
I unfortunately, didn't see the behavior you're reporting, as I tried replicating is as much as possible with these two devices by connecting, sending data through the WUART (first from Central to Peripheral, then from Peripheral to Central), and then triggering a disconnection from the Central Device, and reconnecting.
The problem could be related to the version of the SDK being used, as the current latest version for the KW38 is 2.6.5, while the current version for the KW36 is 2.2.3.
Is the code for the two boards exactly the same?
Best regards,
Sebastian
Hi Sebastian,
The application code used at both boards are the same. Also, I use latest SDK versions.
I tested again with isolating some parts of my app code, then the issue is not happening. So, the problem could be in the app code. I will analyze it.
Thank you for your support.
Hi Prince,
Please let us know if you have any further issues or need any more information!
Take care, best regards,
Sebastian
Hi Sebastian,
Thank you.
In continuation with testing on FRDM KW38 and KW36, I have one more observation/issue related scan and connect. Test setup is the same as before (reproducible on Wireless UART sample app as well):
1. The peer (phone app) is advertising; FRDM KW36/KW38 gets scan callback and about to connect to the peer with App_Connect().
2. Now, in peer/phone switch off the BLE
3. App_Connect() call returns success in KW36/38
4. KW36 always gets GenericCallback with event type: gInternalError_c
5. But, in KW38 rarely gets GenericCallback/gInternalError_c in this case. No responses/callbacks from stack side, for most of the times.
Queries:
1. Why is KW38 not responding in this case?
2. Once I get GenericCallback/gInternalError_c (in KW36) what is the right procedure for further/normal operation (further scanning/connect)? I tried BleApp_Start(gGapCentral_c) in KW36, but it did not help finding any devices any more (even when the peer was advertising)
Thanks,
Prince
Hi Prince,
I again performed some tests, but did not see the behavior you're reporting.
My test procedure was the following, with the pairing, bonding, NVM and security settings you described initially:
I attached my modified wireless_uart.c source file to this post.
Please let me know if you continue to have issues.
Take care, best regards,
Sebastian