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

Connection Timeout with nRF Connect Desktop tool

Hello,

 

I am using nRF52840, SDK_16.0.0, SoftDevice S140 V7.0.1 and Segger for flashing the image. I am using ‘ble_app_blinky’.

 

I modified ble_app_blinky with below parameters and with “Just Works”. I merged with Secure Serial bootloader and loaded on nRF52840 DK and its working fine with nRF Connect mobile app. Now we want to do the same with nRF Connect Desktop tool. I am facing issues.

  #define APP_ADV_INTERVAL                1600                                    /**< The advertising interval (in units of 0.625 ms; this value corresponds to 1000 ms). */
  #define APP_ADV_DURATION                BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED   /**< The advertising time-out (in units of seconds). When set to 0, we will never time out. */

  //#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(500, UNIT_1_25_MS)      /**< Minimum acceptable connection interval (0.5 seconds). */
  #define MIN_CONN_INTERVAL               MSEC_TO_UNITS(1000, UNIT_1_25_MS)       /**< Minimum acceptable connection interval (1 seconds). */
  #define MAX_CONN_INTERVAL               MSEC_TO_UNITS(1000, UNIT_1_25_MS)       /**< Maximum acceptable connection interval (1 second). */
  #define SLAVE_LATENCY                   5                                       /**< Slave latency. */
    // As per standards, "connSlaveLatency shall be an integer in the range of 0 to ((connSupervisionTimeout / (connInterval*2)) - 1)" "( (13 / (1 * 2)) - 1)"

  #define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(13000, UNIT_10_MS)        /**< Connection supervisory time-out (13 seconds). */
  /* As per standards, “The connSupervisionTimeout shall be a multiple of 10 ms in the range of 100 ms to 32.0 s and it
     shall be larger than (1 + connSlaveLatency) * connInterval * 2.”  "(1 + 5) * 1 * 2 = 12" < 13 */

1) After clicking Connect, device got connected. Then I selected “Pair…” with “IO Capability” as “No Keyboard, no display”. Now I am able to write/read. But once “Connection parameters updated for device” I am getting BLE_HCI_CONNECTION_TIMEOUT after 13sec. I am not sure the reason behind this.

a) Even I selected “Update connection…” and gave parameters as Interval 1 sec, Latency 5 and Timeout 13 s but still same issue.

2) Similar to nRF Mobile app how to see RAW data of Advertisement packet in nRF Desktop connect tool.

3) Using nRF Connect app, I am able to select type of data. But how to do the same in nRF Connect desktop tool. I am not seeing such options.

4) Initially when I inserted nRF52840 Dongle, I got a pop-up window to flash. After flashing I am seeing green LED always ON. If I want to re-flash the same image on to dongle from where I can get the image file.

 

5) Just a correction. For Latency there is no units. In below its showing as 5 ms when I configure Latency as 5.

Thanks & Regards

Vishnu Beema

  • Hi,

    Then I selected “Pair…” with “IO Capability” as “No Keyboard, no display”. Now I am able to write/read. But once “Connection parameters updated for device” I am getting BLE_HCI_CONNECTION_TIMEOUT after 13sec.

    1) Does it work with these settings? 

     

    #define MIN_CONN_INTERVAL               MSEC_TO_UNITS(100, UNIT_1_25_MS)        /**< Minimum acceptable connection interval (0.1 seconds). */
    #define MAX_CONN_INTERVAL               MSEC_TO_UNITS(200, UNIT_1_25_MS)        /**< Maximum acceptable connection interval (0.2 second). */
    #define SLAVE_LATENCY                   5                                       /**< Slave latency. */
    #define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(7000, UNIT_10_MS)         /**< Connection supervisory timeout (7 seconds). */

    2) Do you get any error-code on the nRF52 side? Any errors printed in the log from the nRF52(use Segger RTT or UART as logger backend)?

  • Hi,

     

    1) There is no error on device side. It’s just disconnecting. Below is the RTT log. Even with original ble_app_blink, just changed with my BLE configuration and it’s just disconnecting. You can crosscheck as is with my settings.

    2) With the settings you mentioned its working fine. But we need Connection interval for 1 sec and Slave latency as 5 so save battery. With my settings its working fine with nRF Connect Android app but not with nRF Connect Desktop tool.

     

    3) As per my other ticket even there is issue with iPhone nRF Connect mobile app. If any issue with nRF Connect Desktop tool please check with your team.

        https://devzone.nordicsemi.com/f/nordic-q-a/57945/connecting-to-nrf-connect-app-in-ipad

    Thanks & Regards

    Vishnu Beema

  • What is the disconnect reason on the nRF5-side ?

    You can print it in ble_evt_handler() like this, snippet:

            case BLE_GAP_EVT_DISCONNECTED:
            
                NRF_LOG_INFO("Disconnected");
                NRF_LOG_INFO("Disconnected reason: 0x%x",p_ble_evt->evt.gap_evt.params.disconnected.reason)

    If its 0x16 (BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION), then check if you are calling sd_ble_gap_disconnect() in the function on_conn_params_evt().

    If its 0x08 (BLE_HCI_CONNECTION_TIMEOUT), then try to set NRF_SDH_CLOCK_LF_ACCURACY in sdk_config.h to 1 (500ppm), if you have NRF_SDH_CLOCK_LF_SRC set to 0.

  • Hi,

    I am getting 0x8 as error

    1) But NRF_SDH_CLOCK_LF_SRC is already set to 1. Still do I need to set NRF_SDH_CLOCK_LF_ACCURACY to 1.

    2) I was working well with nRF Connect mobile app. With the changes you mention, will there be any impact on timing issues and Current consumption.

    Thanks & Regards

    Vishnu Beema

  • Hi,

    You can keep NRF_SDH_CLOCK_LF_SRC at 1.

    1) Did you try to set NRF_SDH_CLOCK_LF_ACCURACY to 1 ? Did it change the behavior?

    2) If it did not change the behavior, can you then try to caputure a sniffer trace ? See nRF Sniffer.

Related