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
  • I have attached a new test program Imprivata_bgTestApp.zip. There is a file called README with instructions, and a description of the problem.   I suggest you try this on a Dell 64-bit Windows 10 laptop that has not had Nordic dev tools installed on it. Usually the problem occurs with in an hour or two.

    This test program reproduces the problem on two 64-bit Windows 10 laptops and does not reproduce this on one 64-bit Windows 10 laptop. I don't know what difference between these laptops causes two to fail and one to succeed. All have the same driver usbser.sys 10.0.18362.1 winbuild 160101.0800. Problem has occurred when plugged into USB 2.0 and USB 3.0 ports.

    Failing laptops: both Dell, one Windows 10 version 1903 build 18362.657, another Windows 10 version 1909 build 18363.752 (the latest public Windows 10 build)

    Laptop that does not reproduce the problem: Lenovo ThinkPad, Windows 10 version 1903 build 18362.657 (exactly the same as one failing laptop). This one has had Nordic tools like nRF Connect installed. One consequence is that when I plugged in an nRF52840 it would show in Device Manager as 'nRF Connect USB CDC ACM (COMx)'. To make it like my other laptops that do not have Nordic tools, I uninstalled the driver so that the nRF52840 would show up as 'USB Serial Device (COMx)'

  • I have had the new application running on my PC with 5 parallel devices for 8 hours yesterday and 4 hours today. So far, I have not been able to reproduce the issue. I do have another PC that does not have Nordic tools installed, but this is not a Dell PC. I will try to setup the test on that one next. It's a bit harder to find equipment for testing this with the limited factors where you have managed to reproduce the issue, due most of us working from home-office due to the Corona situation. Is it still a requirement to have heavy Bluetooth activity around the device in order to reproduce the issue? This could also be a problem to facilitate during home-office.

  • It doesn't fail on every computer.   I will work on testing the new connectivity firmware on Fanstel and the Nordic dev-dongle and the Nordic DK.

  • Hi Jørgen,

    I'm trying to test the fix on two Nordic dev-dongles (PCA10059), programmed using nRF Connect Programmer. Ideally I'd like to make sure the dev-dongle is in a known good state so I'd like to use the "Erase & write" feature. When I Add File  connectivity_4.1.1_usb_with_s140_6.1.1_critical_region_fix_increased_sched_queue_size.hex, nRF Connect shows that it has Connectivity, SoftDevice and Master Boot record (it shows a region name "MBR or Application" with address range 0 to 0xB00 which is the Master Boot Record range). It does not show a bootloader. I'm confused about why it would have MBR, and why if it has MBR it doesn't have a bootloader.   

    I went ahead with "Erase & write" and am using those dev-dongles with my test program.

    So far, using these dev-dongles and new firmware, I have still seen the original 'no event' problem on two computers. 

    -Paul

  • Hi Paul,

    The "Erase & write" function should not be available if you program the nRF52840 Dongle (PCA10059) through the USB port of the dongle. Did you connect a J-Link debugger to program the dongle through SWD? If you did a "Erase all" operation through the SWD interface, the Bootloader that comes with the dongle will have been erased. "Erase all" operations will erase all programmable flash, including UICR registers.

    The MBR is part of the softdevice-hex. It will always be present whenever the softdevice is flashed to the chip. You can read more about that in the softdevice specifications.

    Paul Bradford said:
    So far, using these dev-dongles and new firmware, I have still seen the original 'no event' problem on two computers.

     Do you mean with the firmware with increased scheduler queue size or the one with only critical region fix?

    Best regards,
    Jørgen

  • I've still seen the problem using connectivity_4.1.1_usb_with_s140_6.1.1_critical_region_fix_increased_sched_queue_size.hex

  • You mentioned "UART logging". I don't know how to do that.  The only type of firmware logging I've used was with RTT Viewer and the DK. I don't know how to do logging with the dev-dongle.

Reply Children
Related