iOS timeout when trying to connect. Error 0x13

Hello,

I have my s332 application working properly, I have an Android phone and never got any connection errors. Using nrfConnect app I tried to connect from iOS and an error 0x13 appeared. I've search the DevZone for cases like this but nothing really worked..

I tried this https://devzone.nordicsemi.com/f/nordic-q-a/19453/ios-iphone-ble-service-discovery-timeout-with-ant-shared-channel-demo and this https://devzone.nordicsemi.com/f/nordic-q-a/29086/error-ble_gatt-sd_ble_gap_data_length_update-request-on-connection-0x0-returned-unexpected-value-0x13

I checked my NRF_SDH_BLE_GATT_MAX_MTU_SIZE and NRF_SDH_BLE_GAP_DATA_LENGTH, max_mtu size is 23 and data_lenght is 27 (23+4).

I'm using nRF52832 and SDK 17.0.2.

Does anyone know how to solve this error?

  • Hello,

    I assume 0x13 is the disconnect reason here:
    #define BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION           0x13  /**< Remote User Terminated Connection. */ 

    So it looks like the peripheral device intentionally disconnect. I suggest to search through and add logging/breakpoint to identify where in your project you are calling sd_ble_gap_disconnect() with disconnect reason BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION, this should help us understand what is triggering the disconnect.

    A wild guess, check in your code if you are calling pm_handler_on_pm_evt() or pm_handler_disconnect_on_sec_failure() somewhere, and for instance comment it out and check if it works now.

    Kenneth

Related