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

  • 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.

  • Right, UART logging will only be available on the DK. If you are able to reproduce on a DK, please provide the logs. You can read the UART logs using a terminal software (Putty, Tera Term, RealTerm, Termite, etc). You may also be able to read UART logs from the Dongle by connecting a wire to the DK, but this would require the logging to use a different pin for UART, as the default UART TX pin is not routed out on the Dongle.

Related