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

How to deal with BLE_GATTS_EVT_SYS_ATTR_MISSING error?

Hi,When I use nRF Connect app(IOS version) to connect my ble device,BLE_GATTS_EVT_SYS_ATTR_MISSING log information appears in my RTT Viewer(Picture IOS_Phone_Conncet).After about 96s,app(IOS version) will disconnect to my ble device.Disconnect Reason is 0x0016 (#define BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION 0x16 /**< Local Host Terminated Connection. */ in ble.hci.h).(Picture IOS_Phone_Disconnect). When i use nRF Connect(Andriod version),it have no this problem(Picture Andriod_Phone_connect). I want to know how to deal with BLE_GATTS_EVT_SYS_ATTR_MISSING error,it seems BLE_GATTS_EVT_SYS_ATTR_MISSING cause the disconnnection when connect to app(IOS version).

My ble device use nRF5_SDK_11.0.0_89a8197. IOS_Phone_Connect.png IOS_Phone_Disconnect.png Android Phone Connect.png

Regards,alivexiaoluo.

Parents
  • BLE_GATTS_EVT_SYS_ATTR_MISSING is typically handled inside the peer manager / device manager module (sys att are store persistently when bonded). Add the following to code to your on_ble_evt() handler if you are not using either of these modules :

        case BLE_GATTS_EVT_SYS_ATTR_MISSING:
            // No system attributes have been stored.
            err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
            APP_ERROR_CHECK(err_code);
            break; // BLE_GATTS_EVT_SYS_ATTR_MISSING
    
Reply
  • BLE_GATTS_EVT_SYS_ATTR_MISSING is typically handled inside the peer manager / device manager module (sys att are store persistently when bonded). Add the following to code to your on_ble_evt() handler if you are not using either of these modules :

        case BLE_GATTS_EVT_SYS_ATTR_MISSING:
            // No system attributes have been stored.
            err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
            APP_ERROR_CHECK(err_code);
            break; // BLE_GATTS_EVT_SYS_ATTR_MISSING
    
Children
  • Thanks,Vidar! I have already add the code above to on_ble_evt() function,but the disconnection between ios phone and device still exist. So the BLE_GATTS_EVT_SYS_ATTR_MISSING is not the reason of the disconnection. Disconnect Reason is 0x0016.(#define BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION 0x16 /**< Local Host Terminated Connection. */ in ble.hci.h) I have found the connection between ios phone and device established,the device try to update connection parameters.after 3(#define MAX_CONN_PARAMS_UPDATE_COUNT 3) timers,the disconnection occurs.I doubt connection parameters update is the reason of this disconnection. how the connection parameter update event occurs during connection establishment? Both IOS phone and Android phone will update connection parameter.

  • Depending on configuration, the connection parameter module may terminate the link if the central device does not accept a connection interval within your max/min range. Please check if .disconnect_on_fail parameter is set to false in conn_params_init().

Related