about Error 8 (0x8): GATT CONN TIMEOUT

Hello,

I am writing to inquire about an issue occurring on our custom board.

Ideally, we should print the logs from the device to identify the exact cause, but since that is not possible at the moment, I am writing to describe the problem.

The device operates normally, but at some point, the following issue arises:

- Symptom: The Central and Peripheral establish a BLE connection, but the Peripheral does not receive messages sent from the Central.
- Current Solution: Power off and on the custom board (Peripheral) to restart it.

- Current BLE Operation Sequence:
1. The custom board stops advertising after connecting with the Central.
2. The custom board resumes advertising if the connection with the Central is lost.

The previous developer mentioned that it is essential to reset (restart) when starting advertising, and without a reset, BLE might not function properly.

Is this correct? Or is there an alternative solution other than resetting?

SoftDevice Version: s132_nrf52_7.2.0_softdevice
Example App Based On: ble_uart_peripheral
MCU: nrf52832

Thank you.

  • ble_nus.c: ble_nus_init()=> start
    service_handle=e
    rx_handles.value_handle=12
    rx_handles.user_desc_handle=0
    rx_handles.cccd_handle=0
    rx_handles.sccd_handle=0
    tx_handles.value_handle=14
    tx_handles.user_desc_handle=0
    tx_handles.cccd_handle=15
    tx_handles.sccd_handle=0
    ble_nus.c: ble_nus_init()end
    
    UART started.
    main.c: on_adv_evt()=> event=EVT_FAST
    // BLE - Connected
    nrf_ble_gatt.c: nrf_ble_gatt_on_ble_evt()=> evt_id=10
    nrf_ble_gatt.c: nrf_ble_gatt_on_ble_evt()=> BLE_GAP_EVT_CONNECTED: on_connected_evt()
    nrf_ble_gatt.c: on_connected_evt()=> connected.role=1
    nrf_ble_gatt.c: on_connected_evt()=> p_link->att_mtu_desired= 247 -> 247
    nrf_ble_gatt.c: on_connected_evt()=> Requesting to update ATT MTU to 247 bytes on connection 0x0.
    nrf_ble_gatt.c: on_connected_evt()=> sd_ble_gattc_exchange_mtu_request()
    nrf_ble_gatt.c: on_connected_evt()=> data_length_update()
    nrf_ble_gatt.c: data_length_update()=> Updating data length to 251 on connection 0x0.
    nrf_ble_gatt.c: data_length_update()=> sd_ble_gap_data_length_update()
    ble_conn_params.c: ble_evt_handler()=> evt_id=10
    ble_conn_params.c: on_connect()
    ble_conn_params.c: on_connect()=> conn_params_negotiation()
    ble_nus.c: ble_nus_on_ble_evt()=> evt_id=10
    ble_nus.c: ble_nus_on_ble_evt()=> on_connect()
    ble_nus.c: on_connect()=> conn_handle=0
    ble_nus.c: on_connect()=> err_code=3401
    ble_nus.c: on_connect()=> p_nus->tx_handles.nrf_ble_gatt.c: nrf_ble_gatt_on_ble_evt()=> evt_id=3a
    nrf_ble_gatt.c: nrf_ble_gatt_on_ble_evt()=> BLE_GATTC_EVT_EXCHANGE_MTU_RSP: on_exchange_mtu_rsp_evt()
    nrf_ble_gatt.c: on_exchange_mtu_rsp_evt()=> ATT MTU updated to 247 bytes on connection 0x0 (response).
    ble_conn_params.c: ble_evt_handler()=> evt_id=3a
    ble_nus.c: ble_nus_on_ble_evt()=> evt_id=3a
    main.c: ble_evt_handler()=> evt_id=3a
    
    nrf_ble_gatt.c: nrf_ble_gatt_on_ble_evt()=> evt_id=24
    nrf_ble_gatt.c: nrf_ble_gatt_on_ble_evt()=> BLE_GAP_EVT_DATA_LENGTH_UPDATE: on_data_length_update_evt()
    nrf_ble_gatt.c: on_data_length_update_evt()=> start
    Data length updated to 251 on connection 0x0.
    max_rx_octets: 27
    max_tx_octets: 251
    max_rx_time: 328
    max_tx_time: 2120
    nrf_ble_gatt.c: on_data_length_update_evt()=> end
    ble_conn_params.c: ble_evt_handler()=> evt_id=24
    ble_nus.c: ble_nus_on_ble_evt()=> evt_id=24
    main.c: ble_evt_handler()=> evt_id=24
    
    nrf_ble_gatt.c: nrf_ble_gatt_on_ble_evt()=> evt_id=12
    ble_conn_params.c: ble_evt_handler()=> evt_id=12
    ble_conn_params.c: on_conn_params_update()=> conn_params_negotiation()
    ble_nus.c: ble_nus_on_ble_evt()=> evt_id=12
    main.c: ble_evt_handler()=> evt_id=12
    
    nrf_ble_gatt.c:
     nrf_ble_gatt_on_ble_evt()=> evt_id=50
    ble_conn_params.c: ble_evt_handler()=> evt_id=50
    ble_conn_params.c: on_write()=> ble_srv_is_notification_enabled()
    ble_nus.c: ble_nus_on_ble_evt()=> evt_id=50
    ble_nus.c: ble_nus_on_ble_evt()=> on_connect()
    ble_nus.c: on_write()
    ble_nus.c: on_write()=> p_evt_write->handle=15, tx_handles.cccd_handle=15
    ble_nus.c: on_write()=> (p_nus->tx_handles.cccd_handle) noti enabled
    ble_nus.c: on_write()=> nus_data_handler(BLE_NUS_EVT_COMM_STARTED)
    main.c: ble_evt_handler()=> evt_id=50
    nrf_ble_gatt.c: nrf_ble_gatt_on_ble_evt()=> evt_id=12
    ble_conn_params.c: ble_evt_handler()=> evt_id=12
    ble_conn_params.c: on_conn_params_update()=> conn_params_negotiation()
    ble_nus.c: ble_nus_on_ble_evt()=> evt_id=12
    main.c: ble_evt_handler()=> evt_id=12
    nrf_ble_gatt.c: nrf_ble_gatt_on_ble_evt()=> evt_id=50
    ble_conn_params.c: ble_evt_handler()=> evt_id=50
    ble_conn_params.c: on_write()=> ble_srv_is_notification_enabled()
    ble_nus.c: ble_nus_on_ble_evt()=> evt_id=50
    ble_nus.c: ble_nus_on_ble_evt()=> on_connect()
    ble_nus.c: on_write()
    ble_nus.c: on_write()=> p_evt_write->handle=12, tx_handles.cccd_handle=15
    ble_nus.c: on_write()=> nus_data_handler(BLE_NUS_EVT_RX_DATA)
    main.c: nus_data_handler()=> ######### Received data from BLE NUS. Writing data on UART.
    30
    main.c: ble_evt_handler()=> evt_id=50
    
    nrf_ble_gatt.c: nrf_ble_gatt_on_ble_evt()=> evt_id=50
    ble_conn_params.c: ble_evt_handler()=> evt_id=50
    ble_conn_params.c: on_write()=> ble_srv_is_notification_enabled()
    ble_nus.c: ble_nus_on_ble_evt()=> evt_id=50
    ble_nus.c: ble_nus_on_ble_evt()=> on_connect()
    ble_nus.c: on_write()
    ble_nus.c: on_write()=> p_evt_write->handle=12, tx_handles.cccd_handle=15
    ble_nus.c: on_write()=> nus_data_handler(BLE_NUS_EVT_RX_DATA)
    main.c: nus_data_handler()=> ######### Received data from BLE NUS. Writing data on UART.
    30
    main.c: ble_evt_handler()=> evt_id=50
    
    nrf_ble_gatt.c: nrf_ble_gatt_on_ble_evt()=> evt_id=50
    ble_conn_params.c: ble_evt_handler()=> evt_id=50
    ble_conn_params.c: on_write()=> ble_srv_is_notification_enabled()
    ble_nus.c: ble_nus_on_ble_evt()=> evt_id=50
    ble_nus.c: ble_nus_on_ble_evt()=> on_connect()
    ble_nus.c: on_write()
    ble_nus.c: on_write()=> p_evt_write->handle=12, tx_handles.cccd_handle=15
    ble_nus.c: on_write()=> nus_data_handler(BLE_NUS_EVT_RX_DATA)
    main.c: nus_data_handler()=> ######### Received data from BLE NUS. Writing data on UART.
    30
    main.c: ble_evt_handler()=> evt_id=50
    
    nrf_ble_gatt.c: nrf_ble_gatt_on_ble_evt()=> evt_id=12
    ble_conn_params.c: ble_evt_handler()=> evt_id=12
    ble_conn_params.c: on_conn_params_update()=> conn_params_negotiation()
    ble_nus.c: ble_nus_on_ble_evt()=> evt_id=12
    main.c: ble_evt_handler()=> evt_id=12
    
    // restart
    ble_nus.c: ble_nus_init()=> start
    service_handle=e
    rx_handles.value_handle=12
    rx_handles.user_desc_handle=0
    rx_handles.cccd_handle=0
    rx_handles.sccd_handle=0
    tx_handles.value_handle=14
    tx_handles.user_desc_handle=0
    tx_handles.cccd_handle=15
    tx_handles.sccd_handle=0
    ble_nus.c: ble_nus_init()end
    
    UART started.
    main.c: on_adv_evt()=> event=EVT_FAST
    
    // restart
    ble_nus.c: ble_nus_init()=> start
    service_handle=e
    rx_handles.value_handle=12
    rx_handles.user_desc_handle=0
    rx_handles.cccd_handle=0
    rx_handles.sccd_handle=0
    tx_handles.value_handle=14
    tx_handles.user_desc_handle=0
    tx_handles.cccd_handle=15
    tx_handles.sccd_handle=0
    ble_nus.c: ble_nus_init()end
    
    UART started.
    main.c: on_adv_evt()=> event=EVT_FAST
    
    

    Hello,

    Here are the logs from the device.

    According to the logs, it appears that while the connection to the Central is established, the Peripheral is not sending messages to the Central. Additionally, the device seems to be rebooting due to the WDT (Watchdog Timer) within approximately 10 to 15 seconds.

    It seems that the logic in the main loop is causing the issue. I will provide updates on the progress moving forward.

    Thank you.

  • Yes, please update us on the progress. It is difficult to speculate on why the WD might be timing out since I haven't seen the code.

Related