nRF52832 connection parameters for multilink

Dear all,

I'm trying to build a system with 1 central to 9 peripherals. All devices are based on nRF52832, SDK16, s132 7.0.1.

I've checked this post to get some clues but still quite confusing while scheduling. 

Here are some questions I have for scheduling and connection parameters:

  1. Can peripherals using GAP_EVENT_LENGTH different with each other?
  2. CONNECTION_INTERVAL should be unified for all the peripherals and central device? Which eaquals to tevent-Cx + scanWindow + tScanReserved ?
  3. How to determine central GAP_EVENT_LENGTH? tevent-Cx ?
  4. Should I set MIN_CONNECTION_INTERVAL and MAX_CONNECTION to the same value get better performance?

For example, I have Peripheral one with GAP_EVENT LENGTH set to 5 (which is 6.25ms) and other eight peripherals with GAP_EVENT LENGTH set to 2 (which is 2.5ms). Total gap_event length needed is 6.25 + 2.5 * 8 = 26.25ms, thus the central GAP_EVENT_LENGTH should be 22(27.5ms). Considering 10ms scan window and some scan reserved time. I set both CONNECTION_INTERVAL to 40ms for all devices, SCAN_INTERVAL is set to 40ms for central. Is it the correct thinking?

But the peripherals disconnect periodically.

*Besides, I can't set MTU_SIZE to maximum value if I set CENTRAL_LINK_COUNT to 9. It shows  .

Following is snippet of compiler message of my cenrtral device code, I've set the RAM exactally the size compiler told me so I guess I've spared as much RAM as possible to softdevice?

Any help is appreciated,

Thanks!

Parents
  • Hi,

    Can peripherals using GAP_EVENT_LENGTH different with each other?

    Yes, you can add different configurations with different GAP event length. Add configurations using the sd_ble_cfg_set() function.

    CONNECTION_INTERVAL should be unified for all the peripherals and central device? Which eaquals to tevent-Cx + scanWindow + tScanReserved ?

    Yes, it's recommend that this is a common factor. It's covered in this chapter here: https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/multilink_scheduling/suggested_intervals_windows_s132.html

    How to determine central GAP_EVENT_LENGTH? tevent-Cx ?

    It depends on the connetion interval, and number of links:

    https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/multilink_scheduling/suggested_intervals_windows_s132.html

    Should I set MIN_CONNECTION_INTERVAL and MAX_CONNECTION to the same value get better performance?

    It's the central that decides the connection interval. The slave can request a different a connection interval, but if you as the central want's to accurately control the connection interval, then set max=min.

    Total gap_event length needed is 6.25 + 2.5 * 8 = 26.25ms, thus the central GAP_EVENT_LENGTH should be 22(27.5ms). Considering 10ms scan window and some scan reserved time. I set both CONNECTION_INTERVAL to 40ms for all devices, SCAN_INTERVAL is set to 40ms for central. Is it the correct thinking?

    No. 22(27.5)ms is the sum yes, but GAP_EVENT_LENGTH is the time set aside for each connection.

     .
    I've set the RAM exactally the size compiler told me

    Are you sure? If you set DEBUG as a preprocessor symbol define, what does the log shows?

  • Can peripherals using GAP_EVENT_LENGTH different with each other?

    Yes, you can add different configurations with different GAP event length. Add configurations using the sd_ble_cfg_set() function.

    I actually want to set fixed GAP_EVENT_LENGTH for a single peripheral device, but the value is different between peripherals. So if I set the value in sdk_config.h, should it work?

    No. 22(27.5)ms is the sum yes, but GAP_EVENT_LENGTH is the time set aside for each connection.

    So if I have 9 connections with different GAP_EVENT_LENGTH, how do I supposed to choose central GAP_EVENT_LENGTH. Fot instance, one 6.25ms peripheral and eight 2.5ms peripherals.

    Are you sure? If you set DEBUG as a preprocessor symbol define, what does the log shows?

    Actually I'm not quite sure about this, I just compile the code on KEIL. Adding RX-data to ZI-data size to calculate minimum RAM size. I'll see what's going on with DEBUG macro.

    Thanks.

  • Hi,

    When you initializes the SoftDevice, you typically have this function.

    /**@brief Function for initializing the BLE stack.
     *
     * @details Initializes the SoftDevice and the BLE event interrupt.
     */
    static void ble_stack_init(void)
    {
        ret_code_t err_code;
    
        err_code = nrf_sdh_enable_request();
        APP_ERROR_CHECK(err_code);
    
        // Configure the BLE stack using the default settings.
        // Fetch the start address of the application RAM.
        uint32_t ram_start = 0;
        err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
        APP_ERROR_CHECK(err_code);
    
        // Enable BLE stack.
        err_code = nrf_sdh_ble_enable(&ram_start);
        APP_ERROR_CHECK(err_code);
    }

    Where nrf_sdh_ble_default_cfg_set is used to set the configuration. Values from sdk_config.h is used, and the tag APP_BLE_CONN_CFG_TAG is used.

    You need to add a new configuration / new tag. And when you call sd_ble_gap_connect(), you select what configuration you want to use.

    See this Message Sequence Chart: https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.3.0/group___b_l_e___c_o_n_n___c_f_g.html

  • Hi,

    I've checked ble_app_multilink_central demo, the default parameter is shown as follow snippet.

    I wonder how could it work since 8 * 6ms = 48ms yet the conntion interval is set in range 7~30ms. Also, scanning interval is 160 * 0.625 = 100ms with 50ms window. Total GAP_EVENT_LENGTH is way larger than connect interval. How does this central distribute its connection and avoid overlapping?

    Thanks

  • Hi,

    The configuration for the ble_app_multilink_central example does not look optimal. With 8(NRF_SDH_BLE_CENTRAL_LINK_COUNT)*NRF_SDH_BLE_GAP_EVENT_LENGTH > the connection interval, and with scanning as well, you will get scheduling conflicts here. i.e. scanning events and/or some expected connection events will be dropped if this central connects to 8 devices with this configuration. 

Reply Children
No Data
Related