security failed to level up when one central switch from one peripheral to another

my code base is samples/bluetooth/central_hids and samples/bluetooth/peripheral_hids_keyboard, NCS 2.6.1

Central

diff --git a/prj.conf b/prj.conf
index c85e49d..0543efe 100644
--- a/prj.conf
+++ b/prj.conf
-CONFIG_BT_PRIVACY=y
+CONFIG_BT_PRIVACY=n

Peripheral

diff --git a/prj.conf b/prj.conf
index 75e6885..36ef2e2 100644
--- a/prj.conf
+++ b/prj.conf

+CONFIG_NFC_OOB_PAIRING=n

log from central device DK52833 A, 

*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
Starting Bluetooth Central HIDS example
I: 6 Sectors of 4096 bytes
I: alloc wra: 0, fb8
I: data wra: 0, 88
I: SoftDevice Controller build revision: 
I: 36 f0 e5 0e 87 68 48 fb |6....hH.
I: 02 fd 9f 82 cc 32 e5 7b |.....2.{
I: 91 b1 5c ed             |..\.    
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: D3:C6:37:CF:3A:67 (random)
I: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059
I: LMP: version 5.4 (0x0d) subver 0x118f
Scanning successfully started
Filters matched on UUID 0x1812.
Address: F6:64:AD:1F:01:5F (random) connectable: yes
Connected: F6:64:AD:1F:01:5F (random)
Failed to set security: -12
The discovery procedure succeeded
E: HID information read error
ERROR: HIDS client preparation failed!
Disconnected: F6:64:AD:1F:01:5F (random) (reason 8)
HIDS client active - releasingFilters matched on UUID 0x1812.
Address: C4:6F:94:85:BB:43 (random) connectable: yes
Connected: C4:6F:94:85:BB:43 (random)
Security changed: C4:6F:94:85:BB:43 (random) level 4
The discovery procedure succeeded
HIDS is ready to work
Subscribe to report id: 0
Subscribe to boot keyboard report
Notification, id: 0, size: 8, data: 0x0 0x0 0xb 0x0 0x0 0x0 0x0 0x0
Notification, id: 0, size: 8, data: 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
Notification, id: 0, size: 8, data: 0x2 0x0 0x0 0x0 0x0 0x0 0x0 0x0
Notification, id: 0, size: 8, data: 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
Disconnected: C4:6F:94:85:BB:43 (random) (reason 8)
HIDS client active - releasingFilters matched on UUID 0x1812.
Address: F6:64:AD:1F:01:5F (random) connectable: yes
Connected: F6:64:AD:1F:01:5F (random)
Failed to set security: -12
The discovery procedure succeeded
E: HID information read error
ERROR: HIDS client preparation failed!
Disconnected: F6:64:AD:1F:01:5F (random) (reason 8)
HIDS client active - releasingFilters matched on UUID 0x1812.
Address: C4:6F:94:85:BB:43 (random) connectable: yes
Connected: C4:6F:94:85:BB:43 (random)
Security changed: C4:6F:94:85:BB:43 (random) level 4
The discovery procedure succeeded
HIDS is ready to work
Subscribe to report id: 0
Subscribe to boot keyboard report
Notification, id: 0, size: 8, data: 0x0 0x0 0xb 0x0 0x0 0x0 0x0 0x0
Notification, id: 0, size: 8, data: 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
Disconnected: C4:6F:94:85:BB:43 (random) (reason 8)
HIDS client active - releasingFilters matched on UUID 0x1812.
Address: F6:64:AD:1F:01:5F (random) connectable: yes
Connected: F6:64:AD:1F:01:5F (random)
Failed to set security: -12
The discovery procedure succeeded
E: HID information read error
ERROR: HIDS client preparation failed!
*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
Starting Bluetooth Central HIDS example
I: 6 Sectors of 4096 bytes
I: alloc wra: 0, fb0
I: data wra: 0, 98
I: SoftDevice Controller build revision: 
I: 36 f0 e5 0e 87 68 48 fb |6....hH.
I: 02 fd 9f 82 cc 32 e5 7b |.....2.{
I: 91 b1 5c ed             |..\.    
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: D3:C6:37:CF:3A:67 (random)
I: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059
I: LMP: version 5.4 (0x0d) subver 0x118f
Scanning successfully started
Filters matched on UUID 0x1812.
Address: C4:6F:94:85:BB:43 (random) connectable: yes
Connected: C4:6F:94:85:BB:43 (random)
Security changed: C4:6F:94:85:BB:43 (random) level 4
The discovery procedure succeeded
HIDS is ready to work
Subscribe to report id: 0
Subscribe to boot keyboard report
Disconnected: C4:6F:94:85:BB:43 (random) (reason 8)
HIDS client active - releasingFilters matched on UUID 0x1812.
Address: F6:64:AD:1F:01:5F (random) connectable: yes
Connected: F6:64:AD:1F:01:5F (random)
Failed to set security: -12
The discovery procedure succeeded
E: HID information read error
ERROR: HIDS client preparation failed!
*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
Starting Bluetooth Central HIDS example
I: 6 Sectors of 4096 bytes
I: alloc wra: 0, fb0
I: data wra: 0, 98
I: SoftDevice Controller build revision: 
I: 36 f0 e5 0e 87 68 48 fb |6....hH.
I: 02 fd 9f 82 cc 32 e5 7b |.....2.{
I: 91 b1 5c ed             |..\.    
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: D3:C6:37:CF:3A:67 (random)
I: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059
I: LMP: version 5.4 (0x0d) subver 0x118f
Scanning successfully started
Filters matched on UUID 0x1812.
Address: F6:64:AD:1F:01:5F (random) connectable: yes
Connected: F6:64:AD:1F:01:5F (random)
Failed to set security: -12
The service could not be found during the discovery
Disconnected: F6:64:AD:1F:01:5F (random) (reason 62)
Filters matched on UUID 0x1812.
Address: F6:64:AD:1F:01:5F (random) connectable: yes
Connected: F6:64:AD:1F:01:5F (random)
Failed to set security: -12
The service could not be found during the discovery
Disconnected: F6:64:AD:1F:01:5F (random) (reason 62)
Filters matched on UUID 0x1812.
Address: F6:64:AD:1F:01:5F (random) connectable: yes
Connected: F6:64:AD:1F:01:5F (random)
Failed to set security: -12
The service could not be found during the discovery
Disconnected: F6:64:AD:1F:01:5F (random) (reason 62)
Filters matched on UUID 0x1812.
Address: F6:64:AD:1F:01:5F (random) connectable: yes
Connected: F6:64:AD:1F:01:5F (random)
Failed to set security: -12
The service could not be found during the discovery
Disconnected: F6:64:AD:1F:01:5F (random) (reason 62)
Filters matched on UUID 0x1812.
Address: F6:64:AD:1F:01:5F (random) connectable: yes
Connected: F6:64:AD:1F:01:5F (random)
Failed to set security: -12
The service could not be found during the discovery
Disconnected: F6:64:AD:1F:01:5F (random) (reason 62)
Filters matched on UUID 0x1812.
Address: F6:64:AD:1F:01:5F (random) connectable: yes
Connected: F6:64:AD:1F:01:5F (random)
Failed to set security: -12
The service could not be found during the discovery
Disconnected: F6:64:AD:1F:01:5F (random) (reason 62)
Filters matched on UUID 0x1812.
Address: F6:64:AD:1F:01:5F (random) connectable: yes
Connected: F6:64:AD:1F:01:5F (random)
Failed to set security: -12
The discovery procedure succeeded
E: HID information read error
ERROR: HIDS client preparation failed!

log from peripheral B, using DK52833 A as central

**** Failed to open the serial port /dev/ttyACM0 ****
---- Opened the serial port /dev/ttyACM2 ----
*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
Starting Bluetooth Peripheral HIDS keyboard example
I: 6 Sectors of 4096 bytes
I: alloc wra: 0, fa0
I: data wra: 0, a8
I: SoftDevice Controller build revision: 
I: 36 f0 e5 0e 87 68 48 fb |6....hH.
I: 02 fd 9f 82 cc 32 e5 7b |.....2.{
I: 91 b1 5c ed             |..\.    
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: C4:6F:94:85:BB:43 (random)
I: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059
I: LMP: version 5.4 (0x0d) subver 0x118f
Advertising successfully started
Connected D3:C6:37:CF:3A:67 (random)
Advertising successfully started
Security changed: D3:C6:37:CF:3A:67 (random) level 4
*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
Starting Bluetooth Peripheral HIDS keyboard example
I: 6 Sectors of 4096 bytes
I: alloc wra: 0, fa0
I: data wra: 0, a8
I: SoftDevice Controller build revision: 
I: 36 f0 e5 0e 87 68 48 fb |6....hH.
I: 02 fd 9f 82 cc 32 e5 7b |.....2.{
I: 91 b1 5c ed             |..\.    
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: C4:6F:94:85:BB:43 (random)
I: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059
I: LMP: version 5.4 (0x0d) subver 0x118f
Advertising successfully started
Connected D3:C6:37:CF:3A:67 (random)
Advertising successfully started
Security changed: D3:C6:37:CF:3A:67 (random) level 4
*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
Starting Bluetooth Peripheral HIDS keyboard example
I: 6 Sectors of 4096 bytes
I: alloc wra: 0, fa0
I: data wra: 0, a8
I: SoftDevice Controller build revision: 
I: 36 f0 e5 0e 87 68 48 fb |6....hH.
I: 02 fd 9f 82 cc 32 e5 7b |.....2.{
I: 91 b1 5c ed             |..\.    
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: C4:6F:94:85:BB:43 (random)
I: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059
I: LMP: version 5.4 (0x0d) subver 0x118f
Advertising successfully started

log from peripheral C, using DK52833 A as central

*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
Starting Bluetooth Peripheral HIDS keyboard example
I: 6 Sectors of 4096 bytes
I: alloc wra: 1, f18
I: data wra: 1, 84
I: SoftDevice Controller build revision: 
I: 36 f0 e5 0e 87 68 48 fb |6....hH.
I: 02 fd 9f 82 cc 32 e5 7b |.....2.{
I: 91 b1 5c ed             |..\.    
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: F6:64:AD:1F:01:5F (random)
I: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059
I: LMP: version 5.4 (0x0d) subver 0x118f
Advertising successfully started
Connected D3:C6:37:CF:3A:67 (random)
Advertising successfully started
*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
Starting Bluetooth Peripheral HIDS keyboard example
I: 6 Sectors of 4096 bytes
I: alloc wra: 1, f18
I: data wra: 1, 84
I: SoftDevice Controller build revision: 
I: 36 f0 e5 0e 87 68 48 fb |6....hH.
I: 02 fd 9f 82 cc 32 e5 7b |.....2.{
I: 91 b1 5c ed             |..\.    
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: F6:64:AD:1F:01:5F (random)
I: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059
I: LMP: version 5.4 (0x0d) subver 0x118f
Advertising successfully started
Connected D3:C6:37:CF:3A:67 (random)
Advertising successfully started
Key report send error: -13
Key report send error: -13
Key report send error: -13
Key report send error: -13
Disconnected from D3:C6:37:CF:3A:67 (random) (reason 8)
Advertising continued
Connected D3:C6:37:CF:3A:67 (random)
Advertising successfully started
Disconnected from D3:C6:37:CF:3A:67 (random) (reason 8)
Advertising continued
Connected D3:C6:37:CF:3A:67 (random)
Advertising successfully started
Key report send error: -13
Key report send error: -13
Key report send error: -13
Key report send error: -13

but both of the peripheral can be connected from my phone using lightblue without any issue.

log from peripheral B using phone as central

*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
Starting Bluetooth Peripheral HIDS keyboard example
I: 6 Sectors of 4096 bytes
I: alloc wra: 0, f68
I: data wra: 0, 13c
I: SoftDevice Controller build revision: 
I: 36 f0 e5 0e 87 68 48 fb |6....hH.
I: 02 fd 9f 82 cc 32 e5 7b |.....2.{
I: 91 b1 5c ed             |..\.    
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: C4:6F:94:85:BB:43 (random)
I: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059
I: LMP: version 5.4 (0x0d) subver 0x118f
Advertising successfully started
I: BAS Notifications enabled
Connected 98:0D:AF:20:52:A2 (public)
Advertising successfully started
Security changed: 98:0D:AF:20:52:A2 (public) level 4
W: Ignoring data for unknown channel ID 0x003a
Output report has been received 98:0D:AF:20:52:A2 (public)
I: BAS Notifications disabled
Disconnected from 98:0D:AF:20:52:A2 (public) (reason 19)
Advertising continued

log from peripheral C using phone as central

*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
Starting Bluetooth Peripheral HIDS keyboard example
I: 6 Sectors of 4096 bytes
I: alloc wra: 1, ec8
I: data wra: 1, 134
I: SoftDevice Controller build revision: 
I: 36 f0 e5 0e 87 68 48 fb |6....hH.
I: 02 fd 9f 82 cc 32 e5 7b |.....2.{
I: 91 b1 5c ed             |..\.    
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF52x (0x0002)
I: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: F6:64:AD:1F:01:5F (random)
I: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059
I: LMP: version 5.4 (0x0d) subver 0x118f
Advertising successfully started
I: BAS Notifications enabled
Connected 98:0D:AF:20:52:A2 (public)
Advertising successfully started
Security changed: 98:0D:AF:20:52:A2 (public) level 4
W: Ignoring data for unknown channel ID 0x003a
Output report has been received 98:0D:AF:20:52:A2 (public)
I: BAS Notifications disabled
Disconnected from 98:0D:AF:20:52:A2 (public) (reason 19)
Advertising continued

Parents Reply Children
Related