Enable CONFIG_BT_SETTINGS causes the BT pairing failed

Hello nRF Team, 

I am developing a ble terminal app based on the Bluetooth: Peripheral UART sample (nRF Connect SDKv2.7.0) on nRF52840DK. I was testing the app BLE pairing and bonding capability with the nRF52840 Dongle & nRF Desktop app, and I encountered the Dongle could not pair with the DK when CONFIG_BT_SETTINGS=y.

The nRF Desktop app log 

12:09:02.814	Scan started
12:09:04.014	Connecting to device
12:09:04.073	Connected to device D7:83:FD:55:7E:E2: interval: 7.5ms, timeout: 4000ms, latency: 0
12:09:04.103	Data length updated for device D7:83:FD:55:7E:E2, new value is 69
12:09:04.187	Phy updated for device D7:83:FD:55:7E:E2, tx: 2 Mb/s, rx: 2 Mb/s
12:09:04.406	Attribute value read, handle: 0x0B, value (0x): 4E-6F-72-64-69-63-5F-55-41-52-54-5F-53-65-72-76-69-63-65
12:09:09.139	Connection parameters updated for device D7:83:FD:55:7E:E2: interval 30ms, timeout 420ms, latency: 0
12:09:16.748	Authentication failed with status BLE_GAP_SEC_STATUS_UNSPECIFIED


Further testing with other andriod phones show simailiar behaviour.  My question is what is the cause this issue and is there any workaround/solution to this issue, as my app required ble bonding capability?

Thank you!

Parents
  • Hi, 

    Please check the RTT log from the nRF52840DK to confirm the pair. 

    Since the nRF52840 Dongle is for prototyping instead of development and doesn't have an onboard debugger, it cannot provide RTT log and debugging. Please use nRF52840DK instead of nRF52840 Dongle for the development. 

    Regards,
    Amanda H.

  • Dear Amanda,

    Thank you for your prompt reply. I am sorry for my misleading description of the problem. I would like to clarify that I am developing my application on the nRF52840DK, and the nRF52840 Dongle is used as a BLE transceiver along with the nRF Bluetooth Low Energy Desktop App to emulate an Android phone for testing BLE Pairing/Bonding capability.

    Unfortunately, the RTT log from nRF52840DK didn’t provide insight into the problem. Here are config and logs from the sample:

    #
    # Copyright (c) 2018 Nordic Semiconductor
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    # Enable the UART driver
    CONFIG_UART_ASYNC_API=y
    CONFIG_NRFX_UARTE0=y
    CONFIG_SERIAL=y
    
    CONFIG_GPIO=y
    
    # Make sure printk is printing to the UART console
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    
    CONFIG_HEAP_MEM_POOL_SIZE=2048
    
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="Nordic_UART_Service"
    CONFIG_BT_MAX_CONN=1
    CONFIG_BT_MAX_PAIRED=1
    
    # Enable the NUS service
    CONFIG_BT_NUS=y
    
    # Enable bonding
    CONFIG_BT_SETTINGS=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=y
    CONFIG_SETTINGS=y
    
    # Enable DK LED and Buttons library
    CONFIG_DK_LIBRARY=y
    
    # This example requires more stack
    CONFIG_MAIN_STACK_SIZE=1152
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    # Configurate logger
    CONFIG_LOG=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_UART=n
    CONFIG_LOG_PRINTK=n
    
    CONFIG_ASSERT=y


    SEGGER J-Link V7.94e - Real time terminal output
    SEGGER J-Link (unknown) V1.0, SN=683201456
    Process: JLink.exe
    [00:00:00.019,744] <inf> fs_nvs: 8 Sectors of 4096 bytes
    [00:00:00.019,775] <inf> fs_nvs: alloc wra: 0, f40
    [00:00:00.019,775] <inf> fs_nvs: data wra: 0, 198
    [00:00:00.019,989] <inf> bt_sdc_hci_driver: SoftDevice Controller build revision:
    d6 da c7 ae 08 db 72 6f  2a a3 26 49 2a 4d a8 b3 |......ro *.&I*M..
    98 0e 07 7f                                      |....
    
    [00:00:00.023,681] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.023,712] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
    [00:00:00.023,742] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 214.51162 Build 1926957230
    [00:00:00.024,353] <inf> bt_hci_core: No ID address. App must call settings_load()
    [00:00:00.024,353] <inf> peripheral_uart: Bluetooth initialized
    [00:00:00.025,756] <inf> bt_hci_core: Identity: D7:83:FD:55:7E:E2 (random)
    [00:00:00.025,787] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x11fb, manufacturer 0x0059
    [00:00:00.025,817] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x11fb
    [00:00:05.941,528] <inf> peripheral_uart: Connected F9:2D:CF:A2:C9:C4 (random)



    Thank you for your assistance, Amanda. I look forward to your feedback regarding the issue.

    Anthony

Reply
  • Dear Amanda,

    Thank you for your prompt reply. I am sorry for my misleading description of the problem. I would like to clarify that I am developing my application on the nRF52840DK, and the nRF52840 Dongle is used as a BLE transceiver along with the nRF Bluetooth Low Energy Desktop App to emulate an Android phone for testing BLE Pairing/Bonding capability.

    Unfortunately, the RTT log from nRF52840DK didn’t provide insight into the problem. Here are config and logs from the sample:

    #
    # Copyright (c) 2018 Nordic Semiconductor
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    # Enable the UART driver
    CONFIG_UART_ASYNC_API=y
    CONFIG_NRFX_UARTE0=y
    CONFIG_SERIAL=y
    
    CONFIG_GPIO=y
    
    # Make sure printk is printing to the UART console
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    
    CONFIG_HEAP_MEM_POOL_SIZE=2048
    
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="Nordic_UART_Service"
    CONFIG_BT_MAX_CONN=1
    CONFIG_BT_MAX_PAIRED=1
    
    # Enable the NUS service
    CONFIG_BT_NUS=y
    
    # Enable bonding
    CONFIG_BT_SETTINGS=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=y
    CONFIG_SETTINGS=y
    
    # Enable DK LED and Buttons library
    CONFIG_DK_LIBRARY=y
    
    # This example requires more stack
    CONFIG_MAIN_STACK_SIZE=1152
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    # Configurate logger
    CONFIG_LOG=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_UART=n
    CONFIG_LOG_PRINTK=n
    
    CONFIG_ASSERT=y


    SEGGER J-Link V7.94e - Real time terminal output
    SEGGER J-Link (unknown) V1.0, SN=683201456
    Process: JLink.exe
    [00:00:00.019,744] <inf> fs_nvs: 8 Sectors of 4096 bytes
    [00:00:00.019,775] <inf> fs_nvs: alloc wra: 0, f40
    [00:00:00.019,775] <inf> fs_nvs: data wra: 0, 198
    [00:00:00.019,989] <inf> bt_sdc_hci_driver: SoftDevice Controller build revision:
    d6 da c7 ae 08 db 72 6f  2a a3 26 49 2a 4d a8 b3 |......ro *.&I*M..
    98 0e 07 7f                                      |....
    
    [00:00:00.023,681] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.023,712] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
    [00:00:00.023,742] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 214.51162 Build 1926957230
    [00:00:00.024,353] <inf> bt_hci_core: No ID address. App must call settings_load()
    [00:00:00.024,353] <inf> peripheral_uart: Bluetooth initialized
    [00:00:00.025,756] <inf> bt_hci_core: Identity: D7:83:FD:55:7E:E2 (random)
    [00:00:00.025,787] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x11fb, manufacturer 0x0059
    [00:00:00.025,817] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x11fb
    [00:00:05.941,528] <inf> peripheral_uart: Connected F9:2D:CF:A2:C9:C4 (random)



    Thank you for your assistance, Amanda. I look forward to your feedback regarding the issue.

    Anthony

Children
  • Hi, 

    To pair with Peripheral UART from the nRF BLE app, you need to enable LESC pairing

    Then it will ask if the key matches like this

    After confirming on the nRF BLE app, then it will ask to confirm from the DK in the RTT log. Pressing Button 1 on DK to pair. It would show the security change without error. 

    -Amanda H.

  • Hi Amanda,

    Thank you for your prompt reply and detailed instructions. I can pair the dongle and DK without difficulty when I set the CONFIG_BT_SETTINGS=n just as your instructions depicted. However, when I set the CONFIG_BT_SETTINGS=y and followed the same procedures as before, it wouldn't pair just as my second reply showed. 

    I tested on the vanilla, and my customized sample (Bluetooth: Peripheral UART), and both behave similarly. I suspected there was something I missed.

    Since my ultimate goal is BLE bonding, do you have any guidelines for bonding the devices on the nRF Desktop App? 

    Thank you.

    Anthony

Related