5240 SDK V14.2.0 Bluetooth reconnect failure

I have a BT app on an IPad. I can connect to the the 52840 dev board  fine. I tell the iPad app to disconnect and it does.

nRF52840 dev board disconnects. When I try to connect to the dev board from the iPad app again the connection fails to complete.

I don't see BLE_GAP_EVT_CONN_PARAM_UPDATE event message during the second connection attempt.

I also don't see AMT_EVT_NOTIF_ENABLED type of message.

I don't know BT so debugging this is a bit new to me.

Thanks.

Parents
  • Question 1:

    After disconnect is received by nRF52840 we call gap_params_init(), gatt_init(), advertising_data_set(), sd_ble_gap_adv_start(),

    bsp_indication_set(BSP_INDICATE_ADVERTISING);

    I think this should be good.

    Question 2:

    Using nRF Connect app on Android I cannot connect a second time. When I try to connect Connect app displays

    "Error 133 (0x85): GATT_ERROR"

    There are no indications on the 52840 device for this connection attempt.

    Question 3:

    On 52840 device  BLE_GAP_EVT_CONNECTED event is received on first connection. When attempting a second connection using iPad app  BLE_GAP_EVT_CONNECTED is received but no other events.

    Sample Log:

    <debug> app: PHY update request.
    <debug> nrf_ble_gatt: Data length updated to 251 on connection 0x1.
    <debug> nrf_ble_gatt: max_rx_octets: 251
    <debug> nrf_ble_gatt: max_tx_octets: 251
    <debug> nrf_ble_gatt: max_rx_time: 2120
    <debug> nrf_ble_gatt: max_tx_time: 2120
    <info> app: Data length updated to 251 bytes.
    <debug> nrf_ble_gatt: Data length updated to 251 on connection 0x1.
    <debug> nrf_ble_gatt: max_rx_octets: 251
    <debug> nrf_ble_gatt: max_tx_octets: 251
    <debug> nrf_ble_gatt: max_rx_time: 2120
    <info> app: ATT MTU exchange completed. MTU set to 247 bytes.
    <debug> app: _evt_handler Event: (0x00)
    <info> app: Notifications enabled. 0x00
    <debug> app: CONNECTED
    <info> app: Connection interval updated: 144, 144.
    <debug> app: _evt_handler Event: (0x03)
    <info> app: AMT_EVT_TRANSFER_FINISHED. 0x03
    <debug> app: Disconnected: reason 0x13.  <<<<<< DISCONNECT at this point

    Reconnect from iPad app:

    <debug> nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x1.
    <debug> nrf_ble_gatt: Updating data length to 251 on connection 0x1.
    <debug> app: ++++ Connected

    <debug> app: PHY update request.
    <debug> nrf_ble_gatt: Data length updated to 251 on connection 0x1.
    <debug> nrf_ble_gatt: max_rx_octets: 251
    <debug> nrf_ble_gatt: max_tx_octets: 251
    <debug> nrf_ble_gatt: max_rx_time: 2120
    <debug> nrf_ble_gatt: max_tx_time: 2120
    <info> app: Data length updated to 251 bytes.
    <debug> nrf_ble_gatt: Data length updated to 251 on connection 0x1.
    <debug> nrf_ble_gatt: max_rx_octets: 251
    <debug> nrf_ble_gatt: max_tx_octets: 251
    <debug> nrf_ble_gatt: max_rx_time: 2120
    <info> app: ATT MTU exchange completed. MTU set to 247 bytes.

    No other log output

Reply
  • Question 1:

    After disconnect is received by nRF52840 we call gap_params_init(), gatt_init(), advertising_data_set(), sd_ble_gap_adv_start(),

    bsp_indication_set(BSP_INDICATE_ADVERTISING);

    I think this should be good.

    Question 2:

    Using nRF Connect app on Android I cannot connect a second time. When I try to connect Connect app displays

    "Error 133 (0x85): GATT_ERROR"

    There are no indications on the 52840 device for this connection attempt.

    Question 3:

    On 52840 device  BLE_GAP_EVT_CONNECTED event is received on first connection. When attempting a second connection using iPad app  BLE_GAP_EVT_CONNECTED is received but no other events.

    Sample Log:

    <debug> app: PHY update request.
    <debug> nrf_ble_gatt: Data length updated to 251 on connection 0x1.
    <debug> nrf_ble_gatt: max_rx_octets: 251
    <debug> nrf_ble_gatt: max_tx_octets: 251
    <debug> nrf_ble_gatt: max_rx_time: 2120
    <debug> nrf_ble_gatt: max_tx_time: 2120
    <info> app: Data length updated to 251 bytes.
    <debug> nrf_ble_gatt: Data length updated to 251 on connection 0x1.
    <debug> nrf_ble_gatt: max_rx_octets: 251
    <debug> nrf_ble_gatt: max_tx_octets: 251
    <debug> nrf_ble_gatt: max_rx_time: 2120
    <info> app: ATT MTU exchange completed. MTU set to 247 bytes.
    <debug> app: _evt_handler Event: (0x00)
    <info> app: Notifications enabled. 0x00
    <debug> app: CONNECTED
    <info> app: Connection interval updated: 144, 144.
    <debug> app: _evt_handler Event: (0x03)
    <info> app: AMT_EVT_TRANSFER_FINISHED. 0x03
    <debug> app: Disconnected: reason 0x13.  <<<<<< DISCONNECT at this point

    Reconnect from iPad app:

    <debug> nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x1.
    <debug> nrf_ble_gatt: Updating data length to 251 on connection 0x1.
    <debug> app: ++++ Connected

    <debug> app: PHY update request.
    <debug> nrf_ble_gatt: Data length updated to 251 on connection 0x1.
    <debug> nrf_ble_gatt: max_rx_octets: 251
    <debug> nrf_ble_gatt: max_tx_octets: 251
    <debug> nrf_ble_gatt: max_rx_time: 2120
    <debug> nrf_ble_gatt: max_tx_time: 2120
    <info> app: Data length updated to 251 bytes.
    <debug> nrf_ble_gatt: Data length updated to 251 on connection 0x1.
    <debug> nrf_ble_gatt: max_rx_octets: 251
    <debug> nrf_ble_gatt: max_tx_octets: 251
    <debug> nrf_ble_gatt: max_rx_time: 2120
    <info> app: ATT MTU exchange completed. MTU set to 247 bytes.

    No other log output

Children
No Data
Related