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

Multilink central disconnect problem

I wrote a peripheral similar to NUS. Then I use the multilink central to connect to 3 of them. First two are fine. But when the 3rd is added, the 3rd one would connect, but every 30 seconds, it would break the connection with code 0x13 (no resource?). I have tried different things but no improvement. The first two are always connected. This is with SDK v13. Any ideas?

Parents
  • FormerMember
    0 FormerMember

    The disconnect is because of this bug in the GATT module (nrf_ble_gatt.h/.c): nrf_ble_gatt.h locally sets and uses its own settings for the number of connections, which by default is '2'. Changing the defines in nrf_ble_gatt.h to the correct value, or redefining NRF_BLE_CENTRAL_LINK_COUNT/NRF_BLE_PERIPHERAL_LINK_COUNT should solve the problem.

    Update 19.06.17: To make the links stable for longer packets, the following changes have to be made:

    • Increase the connection interval: It takes more time to transmit longer packets, and each connected peripheral will require some time.

    • Configure the softdevice with the correct GAP and GATT parameters in ble_stack_init(), both for the central and the peripherals:

       memset(&ble_cfg, 0, sizeof(ble_cfg));
       ble_cfg.conn_cfg.params.gap_conn_cfg.conn_count     = PERIPHERAL_LINK_COUNT + CENTRAL_LINK_COUNT;
       ble_cfg.conn_cfg.params.gap_conn_cfg.event_length   = my_connection_event_length; 
       ble_cfg.conn_cfg.conn_cfg_tag                       = CONN_CFG_TAG;
      
       err_code = sd_ble_cfg_set(BLE_CONN_CFG_GAP, &ble_cfg, ram_start);
       APP_ERROR_CHECK(err_code);
      
       memset(&ble_cfg, 0, sizeof(ble_cfg));
       ble_cfg.conn_cfg.params.gatt_conn_cfg.att_mtu       = NRF_BLE_GATT_MAX_MTU_SIZE;
       ble_cfg.conn_cfg.conn_cfg_tag                       = CONN_CFG_TAG;
      
       err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATT, &ble_cfg, ram_start);
       APP_ERROR_CHECK(err_code);
      
  • Can you explain the relationship among number of links, my_connection_event_length, and connection interval? Eg. if I have 8 links in total, 100ms connection interval, what to set the my_connection_event_length?

Reply Children
No Data
Related