I have implemented bonding mechanism in nRF52832 firmware. But when I request nRF Connect to connect nRF52832 second time. nRF52832 pm_conn_secure() return 0x3002 and nRF Connect log message shows "authentication failed with status BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP".
nRF52832 log messages:
0> <info> app: Version 1.0.0
0>
0> <info> app: ========| flash info |========
0> <info> app: erase unit: 4096 bytes
0> <info> app: program unit: 4 bytes
0> <info> app: end address: 0x7FFFF
0> <info> app: ==============================
0> <info> app_timer: RTC: initialized.
0> <debug> app: NOR_DATA_PERIOD=819
0>
0> <debug> app: NOR_RECORD_PERIOD=8192
0>
0> <info> app: bsp_button_longkey_handler 0.
0> <warning> app: Battery volage 102mV is too low
0>
0> <warning> app: Battery volage 8mV is too low
0>
0> <info> app: Reg 9 A
0> <info> app: bsp_button_longkey_handler 1.
0> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 185 bytes on connection 0x0.
0> <info> app: BLE_GAP_EVT_CONNECTED
0>
0> <debug> app: state=1
0>
0> <debug> nrf_ble_gatt: ATT MTU updated to 185 bytes on connection 0x0 (response).
0> <info> app: BLE_GAP_EVT_SEC_PARAMS_REQUEST
0>
0> <info> app: PM_EVT_CONN_SEC_SUCCEEDED
0>
0> <info> app: Connection secured: role: 1, conn_handle: 0x0, procedure: 2.
0> <info> app: BLE_GAP_EVT_AUTH_STATUS
0>
0> <info> app: BLE_GAP_EVT_SEC_PARAMS_REQUEST
0>
0> <info> app: PM_EVT_CONN_SEC_SUCCEEDED
0>
0> <info> app: Connection secured: role: 1, conn_handle: 0x0, procedure: 1.
0> <info> app: BLE_GAP_EVT_AUTH_STATUS
0>
0> <info> app: BLE_GAP_EVT_DISCONNECTED
0>
0> <debug> app: state=0
0>
0> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 185 bytes on connection 0x0.
0> <info> app: PM_EVT_BONDED_PEER_CONNECTED
0>
0> <info> app: BLE_GAP_EVT_CONNECTED
0>
0> <debug> app: state=1
0>
0> <debug> nrf_ble_gatt: ATT MTU updated to 185 bytes on connection 0x0 (response).
0> <info> app: PM_EVT_CONN_SEC_CONFIG_REQ
0>
0> <info> app: BLE_GAP_EVT_SEC_PARAMS_REQUEST
0>
0> <info> app: PM_EVT_CONN_SEC_FAILED
0>
0> <info> app: Faield to secure connection with handle 00.
0> <info> app: BLE_GAP_EVT_AUTH_STATUS
0>
0> <warning> app: sd_ble_gap_disconnect() failed, errCode=0x8
0>
0> <info> app: BLE_GAP_EVT_DISCONNECTED
0>
0> <debug> app: state=0
0>
0> <debug> app: _securityRequestHandler
0>
0> <warning> peer_manager: pm_conn_secure() e
0>
0> <warning> peer_manager: pm_conn_secure() return 0x3002
0>
0> <warning> app: pm_conn_secure() failed
0>
nRF Connect log messages:
13:27:42.245 Using nrf-device-lib-js version: 0.4.11
13:27:42.245 Using nrf-device-lib version: 0.11.8
13:27:42.245 Using nrfjprog DLL version: 10.15.4
13:27:42.245 Using JLink version: JLink_V7.66a
13:27:42.245 Installed JLink version does not match the provided version (V7.58b)
13:27:42.471 Updated list of uuids with data from github.com/.../v1
13:27:58.686 Selected device with s/n F092AF29DAF8
13:27:58.692 Device setup completed
13:27:58.692 Connectivity firmware version: ble-connectivity 4.1.4+Mar-11-2021-08-36-04. SoftDevice API version: 5. Baud rate: 1000000.
13:27:58.693 Opening adapter connected to COM5
13:27:59.638 Successfully opened COM5. Baud rate: 1000000. Flow control: none. Parity: none.
13:27:59.639 Reset performed on adapter COM5
13:28:00.703 Adapter connected to COM5 opened
13:28:05.416 Scan started
13:28:33.884 Connecting to device
13:28:36.201 Connected to device E8:20:9F:75:90:08: interval: 7.5ms, timeout: 4000ms, latency: 0
13:28:36.218 ATT MTU updated for device E8:20:9F:75:90:08, new value is 185
13:28:36.488 Attribute value read, handle: 0x03, value (0x): 41-4E-43-53-32
13:28:41.264 Connection parameters updated for device E8:20:9F:75:90:08: interval 15ms, timeout 3000ms, latency: 0
13:28:45.213 Security updated, mode:1, level:3
13:29:20.448 Security updated, mode:1, level:3
13:29:20.500 Storing bond info for device E8:20:9F:75:90:08
13:29:28.505 Device closed.
13:29:39.205 Selected device with s/n F092AF29DAF8
13:29:39.209 Device setup completed
13:29:39.209 Connectivity firmware version: ble-connectivity 4.1.4+Mar-11-2021-08-36-04. SoftDevice API version: 5. Baud rate: 1000000.
13:29:39.210 Opening adapter connected to COM5
13:29:40.137 Successfully opened COM5. Baud rate: 1000000. Flow control: none. Parity: none.
13:29:40.138 Reset performed on adapter COM5
13:29:41.215 Adapter connected to COM5 opened
13:29:43.952 Scan started
13:29:52.041 Connecting to device
13:29:55.253 Connected to device E8:20:9F:75:90:08: interval: 7.5ms, timeout: 4000ms, latency: 0
13:29:55.266 ATT MTU updated for device E8:20:9F:75:90:08, new value is 185
13:29:55.279 Authentication failed with status BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP
13:29:55.302 Disconnected from device E8:20:9F:75:90:08, reason: BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION
