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

Parents
  • Hi,

    The logging lever looks correct.

    I do not think there is any timestamp functionality in J-Link RTT Viewer. You may utilize the suggestions in this post to enable timestamps in NRF_LOG module.

    Click insert->Insert image/video/file, and select "File Upload" in the new window:

    No problem from my side, I understood it as this was a request from your side. I'm checking with the FAE you have been in contact with!

    Can you provide the steps required to get into this specific situation where the firmware fails? I will try to reproduce it on our end. There are no modifications to the connectivity firmware in your setup, besides the added logging, right?

  • I uploaded the logging from the firmware. The firmware has no modifications except to enable logging. I am still trying to create a standalone test program to try to reproduce this problem, so far without success. The trace comes from using my company's product , which calls pc-ble-driver.   The problem always occurs after receiving a series of BLE_GATTC_EVT_HVX events. After receiving those events, I try to do sd_ble_gattc_read or sd_ble_gattc_write with BLE_GATT_OP_WRITE_REQ) on the same connection, and never receive any event for that connection. If I try to disconnect that connection, I get no disconnect event. The only way to get the chip working again is sd_rpc_conn_reset

Reply
  • I uploaded the logging from the firmware. The firmware has no modifications except to enable logging. I am still trying to create a standalone test program to try to reproduce this problem, so far without success. The trace comes from using my company's product , which calls pc-ble-driver.   The problem always occurs after receiving a series of BLE_GATTC_EVT_HVX events. After receiving those events, I try to do sd_ble_gattc_read or sd_ble_gattc_write with BLE_GATT_OP_WRITE_REQ) on the same connection, and never receive any event for that connection. If I try to disconnect that connection, I get no disconnect event. The only way to get the chip working again is sd_rpc_conn_reset

Children
No Data
Related