This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

disconnecting while operations are in progress never gives BLE_GAP_EVT_DISCONNECTED event

2020-01-24-092119EST-ProductStoppedGettingEventsFromNordicDK.txtImprivataTestNordicEventsNotReceived.zipCalls_to_pc_ble_driver.cpp0285.2020-02-24-TestProgramUploadedToNordicSupport.zipFeb25TestProgramUploadedToNordicSupport.zipImprivata_bgTestApp.zipbgSDKTestAppMay4.zip2020-05-05-035347-NordicDK_USB840M_200505_ClockInternal_2in1.hex.txt.txtbgSDKTestAppMay6.zipI’m developing an application based on pc-ble-driver to talk to an nRF52840-based dongle (from Fanstel).

I’m having trouble disconnecting cleanly when a connection has operations in progress.  For example, I call ‘sd_ble_gattc_write’, which returns NRF_SUCCESS, but I don’t receive event BLE_GATTC_EVT_WRITE_RSP (after waiting 60 seconds), so I decide to disconnect. When this happens, sd_ble_gap_disconnect returns NRF_SUCCESS, but I do not receive BLE_GAP_EVT_DISCONNECTED even after waiting 30 seconds. The connection supervision timeout is 4 seconds.  What could cause the disconnect to not generate any BLE_GAP_EVT_DISCONNECTED event?

What I’m trying to accomplish here: if a connection is not responsive, I want to end that connection, without disturbing other connections I have open.

Thanks,

Paul Bradford

  • This problem occurs with the nRF52840 dev-dongle, the nRF52840 development kit, as well as the Fanstel dongle. It's not Fanstel-specific.

  • It does, in fact, look like there stops coming events from the softdevice when the CONNECT issue occurs. I have added some debug logs in the serialization library and softdevice handler library and I see that the sd_ble_gap_connect function is being called. After this, I do not see the event handler in the SDH library being called. I can't see any errors or obvious reasons for this. When debugging after the error occurs, the chip seems to be in sleep/WFE.

    I will check with the softdevice team tomorrow if they can help with further debugging.

    Paul, did you manage to capture debug logs for the GATTC_READ/WRITE issue? Sounds like it could be caused by the same issue from your previous log file.

  • I have not reproduced the GATC_READ/WRITE issue since I last setup the Development Kit with debug firmware.   It's been about four days. I'll let it keep running. I did reproduce it (with my product, not my test program) in January, with debug firmware on the DK, and that's the log file 2020-01-24-092119EST-ProductStoppedGettingEventsFromNordicDK. See my update from Jan. 28. That log showed that I issued a GATTC_READ and got no event in response. If I reproduce this with my test program, I don't expect the logs to show anything different from the January log file. I'm not sure what you mean by "it could be caused by the same issue".   If you mean that the CONNECT issue might be the same as the GATTC_READ/WRITE issue, I agree it's possible.

    What is the "SDH library"?

  • You can read about the SoftDevice Handler library in the SDK documentation. This is used by most examples in the SDK, to handle the interaction with the softdevice.

    I have involved our SDK team, and they are currently investigating this issue. I will get back to you as soon as I receive more feedback from them.

  • Our developers are having some problems with reproducing this on their side. This is a bit strange since I'm able to reproduce within a few minutes every time I run the test with my test-phone. I will be working with them further on Monday to assure they have all the details on how the issue can be reproduced. Have a nice weekend!

Related