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

Bond information not stored in Flash

Hi, I was in a process of developing a central device with nrf51422 in PCA10028 board with NUS service client.I use SDK v12.2.0.We have an example code in the library which I modified for multiple devices support.The device connects based on NUS Service UUID in the advertisement packet.I have added peer manager based on a guide to add bonding and intends to bond with the device using static passkey.After the discovery of existing services in the server I call pm_conn_secure() function to bond two devices.

Following the same method I added peer manager and a static passkey in NUS example(peripheral).

The problem I face here is connection is ok and I could get notifications from peripheral to central device successfully but only for the first time.After a disconnection I could not reconnect both devices.I need to clear bonds in central to have a connection again.Investigating more into the issue I found that bond info is stored successfully in Central device as I could see PM_EVT-PM_EVT_PEER_DATA_UPDATE_SUCCEEDED getting called multiple times in the central,but in peripheral it is not stored as I got only a single call of PM_EVT-PM_EVT_PEER_DATA_UPDATE_SUCCEEDED in peripheral and that too without any flash operation as I checked flash_changed flag.

As far as I know the storage of bonds in flash is automatically handled by peer_manager.Could someone shine some light into this issue. ble_app_uart - Copy.zip

Parents
  • Hi Petter,

    This is the security params passed in central.Also upon BLE_GAP_EVT_AUTH_KEY_REQUEST event static passkey of peripheral is passed via sd_ble_gap_auth_key_reply() function.

    #define SEC_PARAM_BOND              1           
    #define SEC_PARAM_MITM              1                                  
    #define SEC_PARAM_LESC              0                          
    #define SEC_PARAM_KEYPRESS          0   
    #define SEC_PARAM_IO_CAPABILITIES   BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY  
    #define SEC_PARAM_OOB               0                                   
    #define SEC_PARAM_MIN_KEY_SIZE      7 
    #define SEC_PARAM_MAX_KEY_SIZE      16
    
Reply
  • Hi Petter,

    This is the security params passed in central.Also upon BLE_GAP_EVT_AUTH_KEY_REQUEST event static passkey of peripheral is passed via sd_ble_gap_auth_key_reply() function.

    #define SEC_PARAM_BOND              1           
    #define SEC_PARAM_MITM              1                                  
    #define SEC_PARAM_LESC              0                          
    #define SEC_PARAM_KEYPRESS          0   
    #define SEC_PARAM_IO_CAPABILITIES   BLE_GAP_IO_CAPS_KEYBOARD_DISPLAY  
    #define SEC_PARAM_OOB               0                                   
    #define SEC_PARAM_MIN_KEY_SIZE      7 
    #define SEC_PARAM_MAX_KEY_SIZE      16
    
Children
No Data
Related