Hi there,
We have a product using an nRF52832-QFAA, with the SDK15.2.0, the 132 Softdevice, and an application based around the Nordic UART service (nus). Customers are reporting crashes and we have narrowed it down to this code:
case BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST:
{
ble_gap_data_length_params_t dl_params;
// Clearing the struct will effectivly set members to @ref BLE_GAP_DATA_LENGTH_AUTO
memset(&dl_params, 0, sizeof(ble_gap_data_length_params_t));
err_code = sd_ble_gap_data_length_update(p_ble_evt->evt.gap_evt.conn_handle, &dl_params, NULL);
APP_ERROR_CHECK(err_code);
} break;The returned error code is 0x08 (INVALID_STATE)
This rarely happens and is inconsistent. Unpairing and repairing their phone to our device make the issue goes away. We have not been able to reproduce it, data length request changes using the nrf Connect for Desktop work fine.
Can you explain what would cause an INVALID_STATE?
Can you tell us if reducing BLE_NUS_MAX_TX_CHAR_LEN and BLE_NUS_MAX_RX_CHAR_LEN to 20 and therefore reducing the characteristic's max_len to 20 is likely to prevent this?
Thanks a lot,
Mark