This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to resolve nRF52832 encountering disconnect reason 0x22 LMP Response Timeout when based S132 SoftDevice v6.1.0 ?

Dear all,

        I modified the example "ble_app_uart" based nRF5_SDK_15.2.0_9412b96 and S132 SoftDevice v6.1.0 to do some tests . But now I encounter the disconnect reason 0x22 LMP Response Timeout error when andriod device established connection with nRF52832 about 40 seconds. I do not know how to resovle this problem at all.

       I also search this 0x22 LMP Response Timeout error in the devzone, but I do not find any correct and effective methods until now.

      I will look forward Nordic's useful help.

      Best regards,

      tianfei00

Parents
  • Hi, 

    Did you keep the gatt_init() function responsible for handling MTU and DLE requests? I would expect this error if you have removed it. 

    Best regards,

    Vidar

  • Hi Vidar Berg,

    Firstly I used the example "ble_app_uart" based nRF5_SDK_15.2.0_9412b96.

    Secondly, in my project the code realated to gatt_init() as following:

    /**@brief Function for handling events from the GATT library. */
    void gatt_evt_handler(nrf_ble_gatt_t * p_gatt, nrf_ble_gatt_evt_t const * p_evt)
    {
        if ((m_conn_handle == p_evt->conn_handle) && (p_evt->evt_id == NRF_BLE_GATT_EVT_ATT_MTU_UPDATED))
        {
            m_ble_nus_max_data_len = p_evt->params.att_mtu_effective - OPCODE_LENGTH - HANDLE_LENGTH;
            NRF_LOG_INFO("Data len is set to 0x%X(%d)", m_ble_nus_max_data_len, m_ble_nus_max_data_len);
        }
        NRF_LOG_DEBUG("ATT MTU exchange completed. central 0x%x peripheral 0x%x",
                      p_gatt->att_mtu_desired_central,
                      p_gatt->att_mtu_desired_periph);
    }
    
    
    /**@brief Function for initializing the GATT library. */
    void gatt_init(void)
    {
        ret_code_t err_code;
    
        err_code = nrf_ble_gatt_init(&m_gatt, gatt_evt_handler);
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_ble_gatt_att_mtu_periph_set(&m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE);
        APP_ERROR_CHECK(err_code);
    }
    

    As you mentioned before, but the  gatt_init() has already existed in my code. How can I resolve this error.

    Many thanks for you.

    Best regards,

     tianfei00

Reply
  • Hi Vidar Berg,

    Firstly I used the example "ble_app_uart" based nRF5_SDK_15.2.0_9412b96.

    Secondly, in my project the code realated to gatt_init() as following:

    /**@brief Function for handling events from the GATT library. */
    void gatt_evt_handler(nrf_ble_gatt_t * p_gatt, nrf_ble_gatt_evt_t const * p_evt)
    {
        if ((m_conn_handle == p_evt->conn_handle) && (p_evt->evt_id == NRF_BLE_GATT_EVT_ATT_MTU_UPDATED))
        {
            m_ble_nus_max_data_len = p_evt->params.att_mtu_effective - OPCODE_LENGTH - HANDLE_LENGTH;
            NRF_LOG_INFO("Data len is set to 0x%X(%d)", m_ble_nus_max_data_len, m_ble_nus_max_data_len);
        }
        NRF_LOG_DEBUG("ATT MTU exchange completed. central 0x%x peripheral 0x%x",
                      p_gatt->att_mtu_desired_central,
                      p_gatt->att_mtu_desired_periph);
    }
    
    
    /**@brief Function for initializing the GATT library. */
    void gatt_init(void)
    {
        ret_code_t err_code;
    
        err_code = nrf_ble_gatt_init(&m_gatt, gatt_evt_handler);
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_ble_gatt_att_mtu_periph_set(&m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE);
        APP_ERROR_CHECK(err_code);
    }
    

    As you mentioned before, but the  gatt_init() has already existed in my code. How can I resolve this error.

    Many thanks for you.

    Best regards,

     tianfei00

Children
Related