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

pc-ble-driver - Connection Request Failed, reason 4

Hi, I am trying to connect 4 devices with the pc-ble-driver. Therefore I modified the heartrate example.

3 Devices are connecting fine - on the 4th connection request I get: Connection Request Failed, reason 4 => No Memory for operation

In ble_stack_init() ble_enable_params.gap_enable_params.central_conn_count is set to 4.

If I try to connect 4 devices with nRFConnect 2.1.0 instead - all is working fine!

What is the difference here?

Also I am still facing the question: Which optimisations in FW or on pc-ble-driver side can I perform for maximum throughput with pc-ble-driver to 4 central(only) connections?

regards

Frederik

Parents
  • Hi,

    The problem is that the parameter ble_enable_params.common_enable_params.p_conn_bw_counts for sd_ble_enable() is set to NULL, while the BLE_COMMON_OPT_CONN_BW option is set to BLE_CONN_BW_HIGH. If p_conn_bw_counts is set to NULL, the stack will only reserve RAM for the default setting, which is BLE_CONN_BW_MID for BLE_GAP_ROLE_CENTRAL. See this and this infocenter page for more details.

    The solution is either to provide valid p_conn_bw_counts parameter to sd_ble_enable():

    ble_conn_bw_counts_t ble_conn_bw_counts;
    memset(&ble_conn_bw_counts, 0, sizeof(ble_conn_bw_counts));
    ble_conn_bw_counts.rx_counts.high_count = MAX_PEER_COUNT;
    ble_conn_bw_counts.tx_counts.high_count = MAX_PEER_COUNT;
    ble_enable_params.common_enable_params.p_conn_bw_counts = &ble_conn_bw_counts;
    

    Or to change ble_options_set() to use medium bandwidth configuration:

    common_opt.conn_bw.conn_bw.conn_bw_rx = BLE_CONN_BW_MID;
    common_opt.conn_bw.conn_bw.conn_bw_tx = BLE_CONN_BW_MID;
    

    Best regards,

    Jørgen

Reply
  • Hi,

    The problem is that the parameter ble_enable_params.common_enable_params.p_conn_bw_counts for sd_ble_enable() is set to NULL, while the BLE_COMMON_OPT_CONN_BW option is set to BLE_CONN_BW_HIGH. If p_conn_bw_counts is set to NULL, the stack will only reserve RAM for the default setting, which is BLE_CONN_BW_MID for BLE_GAP_ROLE_CENTRAL. See this and this infocenter page for more details.

    The solution is either to provide valid p_conn_bw_counts parameter to sd_ble_enable():

    ble_conn_bw_counts_t ble_conn_bw_counts;
    memset(&ble_conn_bw_counts, 0, sizeof(ble_conn_bw_counts));
    ble_conn_bw_counts.rx_counts.high_count = MAX_PEER_COUNT;
    ble_conn_bw_counts.tx_counts.high_count = MAX_PEER_COUNT;
    ble_enable_params.common_enable_params.p_conn_bw_counts = &ble_conn_bw_counts;
    

    Or to change ble_options_set() to use medium bandwidth configuration:

    common_opt.conn_bw.conn_bw.conn_bw_rx = BLE_CONN_BW_MID;
    common_opt.conn_bw.conn_bw.conn_bw_tx = BLE_CONN_BW_MID;
    

    Best regards,

    Jørgen

Children
No Data
Related