This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sd_ble_gap_data_length_update returns NRF_ERROR_RESOURCES

s132 4.0.2, nRF5 SDK 13. In BLE_GAP_EVT_CONNECTED event handler I try to call sd_ble_gap_data_length_update returns NRF_ERROR_RESOURCES.

I have

#define NRF_BLE_GATT_MAX_MTU_SIZE	(247)

Then in ble_stack_init I have:

// Configure the maximum ATT MTU
memset(&ble_cfg, 0x00, sizeof(ble_cfg));
ble_cfg.conn_cfg.conn_cfg_tag                 = APP_BLE_CONN_CFG_TAG;
ble_cfg.conn_cfg.params.gatt_conn_cfg.att_mtu = NRF_BLE_GATT_MAX_MTU_SIZE ;
err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATT, &ble_cfg, ram_start);
APP_ERROR_CHECK(err_code);

Then in BLE_GAP_EVT_CONNECTED event handler I have:

ble_gap_data_length_params_t dl ;
memset(&dl, 0, sizeof(dl)) ;
dl.max_rx_octets = NRF_BLE_GATT_MAX_MTU_SIZE + 4U ;
dl.max_tx_octets = NRF_BLE_GATT_MAX_MTU_SIZE + 4U ;
dl.max_rx_time_us = BLE_GAP_DATA_LENGTH_AUTO ;
dl.max_tx_time_us = BLE_GAP_DATA_LENGTH_AUTO ;
NRF_LOG_INFO("sd_ble_gap_data_length_update() \n") ;
err_code = sd_ble_gap_data_length_update(peer->conn_handle, &dl, NULL) ;
APP_ERROR_CHECK(err_code) ;

And I get NRF_ERROR_RESOURCES as result of sd_ble_gap_data_length_update. How to fix it? What 'resources' are needed? My softdevice has enough ram.

Related