I'm getting strange behavior when connecting to nRF52840DK.
Log from nRF:
<debug> nrf_sdh_ble: BLE event: 0x10. <debug> nrf_ble_gatt: Updating data length to 26 on connection 0x0. <error> nrf_ble_gatt: sd_ble_gap_data_length_update() (request) on connection 0x0 returned NRF_ERROR_INVALID_PARAM. <error> nrf_ble_gatt: sd_ble_gattc_exchange_mtu_request() returned NRF_ERROR_INVALID_PARAM. <info> app: BLE event received. Event type = 16
Log from android nRF Connect:
D 11:24:19.146 gatt.close() D 11:24:19.157 wait(200) V 11:24:19.369 Connecting to E5:2B:3E:67:23:CD... D 11:24:19.369 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M) D 11:24:19.979 [Server callback] Connection state changed with status: 0 and new state: DISCONNECTED (0) I 11:24:19.979 [Server] Device disconnected D 11:24:20.714 [Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0) E 11:24:20.714 Error 133 (0x85): GATT ERROR I 11:24:20.714 Disconnected
The same code works on our custom board (nrf52832). We use custom service (I have followed your custom ble service example) but this happens regardless of whether it is initialized or not. SDK configs are the same apart from logging and clock configurations.
It seems to me that I must have modified something while adding the custom service that is causing this, but I can't find what.
I use nRF5_SDK_17.0.2_d674dde, s140_nrf52_7.2.0_softdevice for DK and s132_nrf52_7.2.0_softdevice for custom board.
We need it to work on both, the DK and the custom board, so app and firmware development can continue independently (We don't have nRF52832DK).