Hi, I am using s130v2 and running the example code from: nRF5_SDK_12.3.0_d7731ad\examples\ble_peripheral\ble_app_hrs\pca10028\s130\arm4
This is the only modification I have made: bool erase_bonds=true; (under main) I have attached the main.c also herewith. I have used Samsung Galaxy S6 phone Android version: 5.1.1 To reproduce the scenario, please follow the following sequence:
-
Erase the chip using nRF Go Studio.
-
Flash s130v2 .hex file via nRF Go Studio.
-
Run the example code under nRF5_SDK_12.3.0_d7731ad\examples\ble_peripheral\ble_app_hrs\pca10028\s130\arm4 (with the attached main.c).
-
Use nRFConnect app to scan and connect to the device - Then click bond in the nRFConnect app. The device would bond successfully. In the app, click "Delete Bond" - the app would disconnect with the device successfully.
-
Power cycle the board. Repeat step 4. This time, when "Bond" is clicked in the nRFConnect app, the device would disconnect automatically.
Update: The reason for disconnection is under BLE_GAP_EVT_AUTH_STATUS (in security_dispatcher.c), auth_status_process has p_gap_evt->params.auth_status.auth_status to be 0x85. Hence, auth_status_failure_process(p_gap_evt); is called. Not sure how to solve this..