KW45B41Z83- BLE stack hanging after sometime

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

KW45B41Z83- BLE stack hanging after sometime

1,530 Views
jaimy_v
Contributor I

We are using a custom board with KW45B41z83 module. The board is used as peripheral and connects with Android phone app. When run for long intervals or after repeated connect/disconnect, sometimes the BLE stack seems to hang. It does not happen always, but occurs in random. Other tasks in the code are running.

In code it is waiting inside BluetoothLEHost_HandleMessages in 

OSA_EventWait((osa_event_handle_t)mAppEvent,

osaEventFlagsAll_c,

(uint8_t)FALSE,

gAppTaskWaitTimeout_ms_c ,

&event);

 

 

gAppTaskWaitTimeout_ms_c was initially defined as osaWaitForever_c.

Later we changed this to 100s and we saw that it is getting timed out.

Could you help us to debug the issue. We are using the lib_ble_OPT_host_peripheral_cm33_gcc.a lib

0 Kudos
Reply
4 Replies

1,502 Views
luis_maravilla
NXP Employee
NXP Employee

Hello,

Could you help us share details about what does your BLE stack hang mean? Could it refer to a loss of transmission, packet loss, interrupt connection?

 

Are you using an SDK example as a base for your project? Could you help us confirm if you can run an example code without modifications from the latest SDK and replicate this issue?

 

Could you help confirm about how did you implement the change from [osaWaitForever_c] to gAppTaskWaitTimeout_ms_c 1000?

 

Best Regards

Luis

0 Kudos
Reply

1,468 Views
jaimy_v
Contributor I

Hi,

The SDK example we have taken is wireless_examples - bluetooth- eatt_peripheral-freertos.

0 Kudos
Reply

1,491 Views
jaimy_v
Contributor I

Hi,

BLE stack is hanging - we are not able to disconnect/reconnect the device. No data is being received. There is no event in mAppEvent and it is waiting forever.

We modified gAppTaskWaitTimeout_ms_c in app_preinclude_common.h. We are using SDK example as base, but have modified it for our application. We wanted to know how we can debug to know where it was getting stuck. Is there any place we can check in BLE stack to know what could be going wrong.

Tags (1)
0 Kudos
Reply

1,453 Views
luis_maravilla
NXP Employee
NXP Employee

Hello,

Could you help us test the example without modifications and let us know if you observe the same behavior?

 

Since you are using the eatt_peripheral_freertos example, please note that the expected responses for data reception are displayed on the board running the EATT Central example.

For more information on the expected terminal outputs for both EATT Central and EATT Peripheral roles, please refer to the Bluetooth Low Energy Demo Applications User’s Guide Chapter 5.4 and 5.5

If possible, could you help us verify the behavior by testing with another board running the EATT Central example instead of the mobile app?

 

Could you help us share the modifications implemented for gAppTaskWaitTimeout_ms_c?

 

Best Regards

Luis

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2189902%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EKW45B41Z83-%20BLE%20stack%20hanging%20after%20sometime%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2189902%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWe%20are%20using%20a%20custom%20board%20with%20KW45B41z83%20module.%20The%20board%20is%20used%20as%20peripheral%20and%20connects%20with%20Android%20phone%20app.%20When%20run%20for%20long%20intervals%20or%20after%20repeated%20connect%2Fdisconnect%2C%20sometimes%20the%20BLE%20stack%20seems%20to%20hang.%20It%20does%20not%20happen%20always%2C%20but%20occurs%20in%20random.%20Other%20tasks%20in%20the%20code%20are%20running.%3C%2FP%3E%3CP%3EIn%20code%20it%20is%20waiting%20inside%26nbsp%3B%3CSPAN%3EBluetoothLEHost_HandleMessages%20in%3C%2FSPAN%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CP%3E%3CSPAN%3EOSA_EventWait((%3C%2FSPAN%3E%3CSPAN%3Eosa_event_handle_t%3C%2FSPAN%3E%3CSPAN%3E)mAppEvent%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EosaEventFlagsAll_c%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Euint8_t%3C%2FSPAN%3E%3CSPAN%3E)FALSE%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EgAppTaskWaitTimeout_ms_c%20%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%26amp%3Bevent)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3EgAppTaskWaitTimeout_ms_c%20was%20initially%20defined%20as%20osaWaitForever_c.%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ELater%20we%20changed%20this%20to%20100s%20and%20we%20saw%20that%20it%20is%20getting%20timed%20out.%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ECould%20you%20help%20us%20to%20debug%20the%20issue.%20We%20are%20using%20the%20lib_ble_OPT_host_peripheral_cm33_gcc.a%20lib%3C%2FSPAN%3E%3C%2FP%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2192027%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20KW45B41Z83-%20BLE%20stack%20hanging%20after%20sometime%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2192027%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3ECould%20you%20help%20us%20test%20the%20example%20without%20modifications%20and%20let%20us%20know%20if%20you%20observe%20the%20same%20behavior%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ESince%20you%20are%20using%20the%20eatt_peripheral_freertos%20example%2C%20please%20note%20that%20the%20expected%20responses%20for%20data%20reception%20are%20displayed%20on%20the%20board%20running%20the%20EATT%20Central%20example.%3C%2FP%3E%0A%3CP%3EFor%20more%20information%20on%20the%20expected%20terminal%20outputs%20for%20both%20EATT%20Central%20and%20EATT%20Peripheral%20roles%2C%20please%20refer%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fmcuxpresso.nxp.com%2Fmcuxsdk%2Flatest%2Fhtml%2F_static%2Fwireless%2FBluetooth%2FBluetooth_Low_Energy_Demo_Applications_User%2527s_Guide.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EBluetooth%20Low%20Energy%20Demo%20Applications%20User%E2%80%99s%20Guide%3C%2FA%3E%20Chapter%205.4%20and%205.5%3C%2FP%3E%0A%3CP%3EIf%20possible%2C%20could%20you%20help%20us%20verify%20the%20behavior%20by%20testing%20with%20another%20board%20running%20the%20EATT%20Central%20example%20instead%20of%20the%20mobile%20app%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ECould%20you%20help%20us%20share%20the%20modifications%20implemented%20for%20gAppTaskWaitTimeout_ms_c%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBest%20Regards%3C%2FP%3E%0A%3CP%3ELuis%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2191558%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20KW45B41Z83-%20BLE%20stack%20hanging%20after%20sometime%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2191558%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EThe%20SDK%20example%20we%20have%20taken%20is%20wireless_examples%20-%20bluetooth-%20eatt_peripheral-freertos.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2190414%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20KW45B41Z83-%20BLE%20stack%20hanging%20after%20sometime%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2190414%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EBLE%20stack%20is%20hanging%20-%20we%20are%20not%20able%20to%20disconnect%2Freconnect%20the%20device.%20No%20data%20is%20being%20received.%20There%20is%20no%20event%20in%26nbsp%3B%3CSPAN%3EmAppEvent%20and%20it%20is%20waiting%20forever.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EWe%20modified%26nbsp%3B%3CSPAN%3EgAppTaskWaitTimeout_ms_c%20in%20app_preinclude_common.h.%20We%20are%20using%20SDK%20example%20as%20base%2C%20but%20have%20modified%20it%20for%20our%20application.%20We%20wanted%20to%20know%20how%20we%20can%20debug%20to%20know%20where%20it%20was%20getting%20stuck.%20Is%20there%20any%20place%20we%20can%20check%20in%20BLE%20stack%20to%20know%20what%20could%20be%20going%20wrong.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2190194%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20KW45B41Z83-%20BLE%20stack%20hanging%20after%20sometime%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2190194%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3ECould%20you%20help%20us%20share%20details%20about%20what%20does%20your%20BLE%20stack%20hang%20mean%3F%20Could%20it%20refer%20to%20a%20loss%20of%20transmission%2C%20packet%20loss%2C%20interrupt%20connection%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EAre%20you%20using%20an%20SDK%20example%20as%20a%20base%20for%20your%20project%3F%20Could%20you%20help%20us%20confirm%20if%20you%20can%20run%20an%20example%20code%20without%20modifications%20from%20the%20latest%20SDK%20and%20replicate%20this%20issue%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ECould%20you%20help%20confirm%20about%20how%20did%20you%20implement%20the%20change%20from%20%5BosaWaitForever_c%5D%20to%20gAppTaskWaitTimeout_ms_c%201000%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBest%20Regards%3C%2FP%3E%0A%3CP%3ELuis%3C%2FP%3E%3C%2FLINGO-BODY%3E