Connect a Laptop with Windows to Peripheral UART example

Sure, my question is very stupid, but after one day I found nothing to explain the principle of the situation, I decided to ask.

I have a laptop with built-in Bluetooth 5.2 and Windows 11. It runs a terminal testing program.

I have nRF5340 DK with the example Peripheral UART installed (nRF Connect SDK1.8.0). The board works normally, I tested it with a phone with Android and nRF Connect for Mobile. Everything is working fine. The board is connected to a desktop computer on which a terminal program is running and connected to COM port ( not USB).

Windows (laptop), sees the board. After pressing adding device (on Win), the LED on the board (connected) lights up for 1 second, Windows thinks about 5 seconds, and says try again. I imagine that it will connect to the board, and a window will appear to install a serial port to which I can connect through the terminal program. No PIN display window appears. I tried to quickly press button 1, possibly to confirm, nothing. I can transmit data over the phone without the board being BONDED. Let me just say that I've been doing Nordic for 6 months, and I've learned some things. But here I can't even imagine what should happen. Google didn't help either. Does anything else need to be installed on the board?

In the final version, it should be a remote device to which with any laptop with Bluetooth 5.2, to be able to connect and through a terminal program to exchange data via serial port.

  • At least I don't see any more information. I think there is a timeout that is running out.

    [00:00:00.512,329] <inf> fs_nvs: 2 Sectors of 4096 bytes
    [00:00:00.512,329] <inf> fs_nvs: alloc wra: 0, f70
    [00:00:00.512,359] <inf> fs_nvs: data wra: 0, dc
    [00:00:00.534,667] <inf> bt_hci_core: No ID address. App must call settings_load()
    [00:00:00.534,698] <inf> peripheral_uart: Bluetooth initialized
    [00:01:13.407,714] <inf> peripheral_uart: Connected 5C:FB:3A:53:9C:3A (public)
    [00:01:14.162,231] <inf> peripheral_uart: Passkey for 5C:FB:3A:53:9C:3A (public): 426108
    [00:01:14.162,231] <inf> peripheral_uart: Press Button 1 to confirm, Button 2 to reject.
    [00:01:24.005,706] <wrn> peripheral_uart: Security failed: 5C:FB:3A:53:9C:3A (public) level 1 err 9
    [00:01:24.005,828] <inf> peripheral_uart: Pairing failed conn: 5C:FB:3A:53:9C:3A (public), reason 9
    [00:01:24.006,011] <inf> peripheral_uart: Disconnected: 5C:FB:3A:53:9C:3A (public) (reason 8)
    [00:01:34.948,791] <inf> peripheral_uart: Connected 5C:FB:3A:53:9C:3A (public)
    [00:01:35.463,623] <inf> peripheral_uart: Passkey for 5C:FB:3A:53:9C:3A (public): 051090
    [00:01:35.463,623] <inf> peripheral_uart: Press Button 1 to confirm, Button 2 to reject.
    [00:01:38.374,816] <inf> peripheral_uart: Numeric Match, conn 0x20000a60
    [00:01:45.307,098] <wrn> peripheral_uart: Security failed: 5C:FB:3A:53:9C:3A (public) level 1 err 9
    [00:01:45.307,220] <inf> peripheral_uart: Pairing failed conn: 5C:FB:3A:53:9C:3A (public), reason 9
    [00:01:45.307,403] <inf> peripheral_uart: Disconnected: 5C:FB:3A:53:9C:3A (public) (reason 8)

  • Sorry, there might have been a misunderstanding here. I meant that you need to set both CONFIG_BT_DEBUG_LOG and CONFIG_BT_DEBUG_SMP to Y in your prj.conf  file to get more information in the log.

    Best regards,

    Simon

  • [00:00:00.448,089] <inf> fs_nvs: 2 Sectors of 4096 bytes
    [00:00:00.448,089] <inf> fs_nvs: alloc wra: 0, f70
    [00:00:00.448,089] <inf> fs_nvs: data wra: 0, dc
    [00:00:00.469,238] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.469,238] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
    [00:00:00.469,238] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 223.20160 Build 1719410646
    [00:00:00.470,153] <dbg> bt_smp.bt_smp_init: LE SC enabled
    [00:00:00.470,489] <inf> bt_hci_core: No ID address. App must call settings_load()
    [00:00:00.470,489] <inf> peripheral_uart: Bluetooth initialized
    [00:00:00.473,022] <inf> bt_hci_core: Identity: DF:1C:CC:6F:45:96 (random)
    [00:00:00.473,052] <inf> bt_hci_core: HCI: version 5.2 (0x0b) revision 0x22b0, manufacturer 0x0059
    [00:00:00.473,052] <inf> bt_hci_core: LMP: version 5.2 (0x0b) subver 0x22b0
    [00:00:00.718,994] <dbg> bt_smp.bt_smp_pkey_ready: 
    [00:00:44.320,068] <dbg> bt_smp.bt_smp_accept: conn 0x20000a60 handle 15
    [00:00:44.320,098] <dbg> bt_smp.bt_smp_connected: chan 0x20001010 cid 0x0006
    [00:00:44.320,220] <inf> peripheral_uart: Connected 5C:FB:3A:53:9C:3A (public)
    [00:00:44.597,351] <dbg> bt_smp.bt_smp_recv: Received SMP code 0x01 len 6
    [00:00:44.597,351] <dbg> bt_smp.smp_pairing_req: 
    [00:00:44.598,876] <dbg> bt_smp.smp_init: prnd 92f9c4cda9547020542d544580fd9eae
    [00:00:44.719,696] <dbg> bt_smp.bt_smp_recv: Received SMP code 0x0c len 64
    [00:00:44.719,696] <dbg> bt_smp.smp_public_key: 
    [00:00:44.719,818] <dbg> bt_smp.smp_f4: u f966c0cd4ab920a2644d57fac6f892acdd844bd7a9bd20758f62ab6cc463cb54
    [00:00:44.719,848] <dbg> bt_smp.smp_f4: v 9ba09d2dce8da508ed1dec35545e25cdad6b9144b303a2b2b57e606e4685df93
    [00:00:44.719,879] <dbg> bt_smp.smp_f4: x 92f9c4cda9547020542d544580fd9eae z 0x0
    [00:00:44.721,008] <dbg> bt_smp.smp_f4: res c05fe9716a9ecd30ccee3eb0db664a61
    [00:00:44.898,468] <dbg> bt_smp.bt_smp_recv: Received SMP code 0x04 len 16
    [00:00:44.898,468] <dbg> bt_smp.smp_pairing_random: 
    [00:00:44.898,498] <dbg> bt_smp.smp_g2: u 9ba09d2dce8da508ed1dec35545e25cdad6b9144b303a2b2b57e606e4685df93
    [00:00:44.898,529] <dbg> bt_smp.smp_g2: v f966c0cd4ab920a2644d57fac6f892acdd844bd7a9bd20758f62ab6cc463cb54
    [00:00:44.898,559] <dbg> bt_smp.smp_g2: x bbb90de01a71ce7fc6d360b880ea22ee
    [00:00:44.898,559] <dbg> bt_smp.smp_g2: y 92f9c4cda9547020542d544580fd9eae
    [00:00:44.899,719] <dbg> bt_smp.smp_g2: res 3e7647b4529c77b74a6971e267d877b9
    [00:00:44.899,749] <dbg> bt_smp.smp_g2: passkey 239673
    [00:00:44.899,871] <inf> peripheral_uart: Passkey for 5C:FB:3A:53:9C:3A (public): 239673
    [00:00:44.899,871] <inf> peripheral_uart: Press Button 1 to confirm, Button 2 to reject.
    [00:00:44.969,177] <dbg> bt_smp.bt_smp_dhkey_ready: 0x20006d7f
    [00:00:47.987,152] <inf> peripheral_uart: Numeric Match, conn 0x20000a60
    [00:00:54.683,074] <dbg> bt_smp.bt_smp_disconnected: chan 0x20001010 cid 0x0006
    [00:00:54.683,105] <dbg> bt_smp.smp_pairing_complete: status 0x8
    [00:00:54.683,105] <dbg> bt_smp.bt_smp_encrypt_change: chan 0x20001010 conn 0x20000a60 handle 15 encrypt 0x00 hci status 0x1f
    [00:00:54.683,227] <wrn> peripheral_uart: Security failed: 5C:FB:3A:53:9C:3A (public) level 1 err 9
    [00:00:54.683,349] <inf> peripheral_uart: Pairing failed conn: 5C:FB:3A:53:9C:3A (public), reason 9
    [00:00:54.683,532] <inf> peripheral_uart: Disconnected: 5C:FB:3A:53:9C:3A (public) (reason 8)
    [00:01:04.271,759] <dbg> bt_smp.bt_smp_accept: conn 0x20000a60 handle 15
    [00:01:04.271,789] <dbg> bt_smp.bt_smp_connected: chan 0x20001010 cid 0x0006
    [00:01:04.271,911] <inf> peripheral_uart: Connected 5C:FB:3A:53:9C:3A (public)
    [00:01:04.543,762] <dbg> bt_smp.bt_smp_recv: Received SMP code 0x01 len 6
    [00:01:04.543,762] <dbg> bt_smp.smp_pairing_req: 
    [00:01:04.545,318] <dbg> bt_smp.smp_init: prnd e16181486351fbbb429949be5a679a84
    [00:01:04.666,076] <dbg> bt_smp.bt_smp_recv: Received SMP code 0x0c len 64
    [00:01:04.666,076] <dbg> bt_smp.smp_public_key: 
    [00:01:04.666,198] <dbg> bt_smp.smp_f4: u f966c0cd4ab920a2644d57fac6f892acdd844bd7a9bd20758f62ab6cc463cb54
    [00:01:04.666,229] <dbg> bt_smp.smp_f4: v 9e24905bf10a70a9a10ea523872d25ed65fa69a2e15e267b68fd9aa4ce785dbf
    [00:01:04.666,259] <dbg> bt_smp.smp_f4: x e16181486351fbbb429949be5a679a84 z 0x0
    [00:01:04.667,419] <dbg> bt_smp.smp_f4: res ebdd52513e772cea9cb31253b5030c88
    [00:01:04.844,909] <dbg> bt_smp.bt_smp_recv: Received SMP code 0x04 len 16
    [00:01:04.844,940] <dbg> bt_smp.smp_pairing_random: 
    [00:01:04.844,970] <dbg> bt_smp.smp_g2: u 9e24905bf10a70a9a10ea523872d25ed65fa69a2e15e267b68fd9aa4ce785dbf
    [00:01:04.845,001] <dbg> bt_smp.smp_g2: v f966c0cd4ab920a2644d57fac6f892acdd844bd7a9bd20758f62ab6cc463cb54
    [00:01:04.845,001] <dbg> bt_smp.smp_g2: x fe2e72d3dc6e7968f8e6b538bda89b14
    [00:01:04.845,031] <dbg> bt_smp.smp_g2: y e16181486351fbbb429949be5a679a84
    [00:01:04.846,221] <dbg> bt_smp.smp_g2: res 159fb5e98b20313ecd4c29356eb350e9
    [00:01:04.846,252] <dbg> bt_smp.smp_g2: passkey 245417
    [00:01:04.846,374] <inf> peripheral_uart: Passkey for 5C:FB:3A:53:9C:3A (public): 245417
    [00:01:04.846,374] <inf> peripheral_uart: Press Button 1 to confirm, Button 2 to reject.
    [00:01:04.915,740] <dbg> bt_smp.bt_smp_dhkey_ready: 0x20006d7f
    [00:01:06.340,301] <inf> peripheral_uart: Numeric Match, conn 0x20000a60
    [00:01:14.569,458] <dbg> bt_smp.bt_smp_disconnected: chan 0x20001010 cid 0x0006
    [00:01:14.569,488] <dbg> bt_smp.smp_pairing_complete: status 0x8
    [00:01:14.569,519] <dbg> bt_smp.bt_smp_encrypt_change: chan 0x20001010 conn 0x20000a60 handle 15 encrypt 0x00 hci status 0x1f
    [00:01:14.569,641] <wrn> peripheral_uart: Security failed: 5C:FB:3A:53:9C:3A (public) level 1 err 9
    [00:01:14.569,732] <inf> peripheral_uart: Pairing failed conn: 5C:FB:3A:53:9C:3A (public), reason 9
    [00:01:14.569,915] <inf> peripheral_uart: Disconnected: 5C:FB:3A:53:9C:3A (public) (reason 8)
    [00:01:21.716,705] <dbg> bt_smp.bt_smp_accept: conn 0x20000a60 handle 15
    [00:01:21.716,735] <dbg> bt_smp.bt_smp_connected: chan 0x20001010 cid 0x0006
    [00:01:21.716,857] <inf> peripheral_uart: Connected 5C:FB:3A:53:9C:3A (public)
    [00:01:21.992,614] <dbg> bt_smp.bt_smp_recv: Received SMP code 0x01 len 6
    [00:01:21.992,645] <dbg> bt_smp.smp_pairing_req: 
    [00:01:21.994,171] <dbg> bt_smp.smp_init: prnd f336db04b25935564e557ea799e4592a
    [00:01:22.114,959] <dbg> bt_smp.bt_smp_recv: Received SMP code 0x0c len 64
    [00:01:22.114,959] <dbg> bt_smp.smp_public_key: 
    [00:01:22.115,081] <dbg> bt_smp.smp_f4: u f966c0cd4ab920a2644d57fac6f892acdd844bd7a9bd20758f62ab6cc463cb54
    [00:01:22.115,112] <dbg> bt_smp.smp_f4: v 145991bbb068fcaa11495cb1a38f1460cbabf32f1ca76f13958389befa99d56f
    [00:01:22.115,142] <dbg> bt_smp.smp_f4: x f336db04b25935564e557ea799e4592a z 0x0
    [00:01:22.116,302] <dbg> bt_smp.smp_f4: res a43326b1a05e7a2411d14de6c394224a
    [00:01:22.293,731] <dbg> bt_smp.bt_smp_recv: Received SMP code 0x04 len 16
    [00:01:22.293,762] <dbg> bt_smp.smp_pairing_random: 
    [00:01:22.293,792] <dbg> bt_smp.smp_g2: u 145991bbb068fcaa11495cb1a38f1460cbabf32f1ca76f13958389befa99d56f
    [00:01:22.293,823] <dbg> bt_smp.smp_g2: v f966c0cd4ab920a2644d57fac6f892acdd844bd7a9bd20758f62ab6cc463cb54
    [00:01:22.293,823] <dbg> bt_smp.smp_g2: x 9c0a1983151bbb373f05d6fd0d18e14f
    [00:01:22.293,853] <dbg> bt_smp.smp_g2: y f336db04b25935564e557ea799e4592a
    [00:01:22.295,013] <dbg> bt_smp.smp_g2: res 29e16266206bca04111c8730fb3720d8
    [00:01:22.295,013] <dbg> bt_smp.smp_g2: passkey 694104
    [00:01:22.295,135] <inf> peripheral_uart: Passkey for 5C:FB:3A:53:9C:3A (public): 694104
    [00:01:22.295,135] <inf> peripheral_uart: Press Button 1 to confirm, Button 2 to reject.
    [00:01:22.364,501] <dbg> bt_smp.bt_smp_dhkey_ready: 0x20006d7f
    [00:01:24.381,927] <inf> peripheral_uart: Numeric Match, conn 0x20000a60
    [00:01:32.138,336] <dbg> bt_smp.bt_smp_disconnected: chan 0x20001010 cid 0x0006
    [00:01:32.138,366] <dbg> bt_smp.smp_pairing_complete: status 0x8
    [00:01:32.138,397] <dbg> bt_smp.bt_smp_encrypt_change: chan 0x20001010 conn 0x20000a60 handle 15 encrypt 0x00 hci status 0x1f
    [00:01:32.138,519] <wrn> peripheral_uart: Security failed: 5C:FB:3A:53:9C:3A (public) level 1 err 9
    [00:01:32.138,641] <inf> peripheral_uart: Pairing failed conn: 5C:FB:3A:53:9C:3A (public), reason 9
    [00:01:32.138,793] <inf> peripheral_uart: Disconnected: 5C:FB:3A:53:9C:3A (public) (reason 8)
    

    I tried to press the button on the board first, then on the laptop, it doesn't matter. Three attempts, in the first and third, first on the laptop, then on the board.

  • Hi Stefan

    Multiple devs have reviewed your logs, and there are just a few reasons the error you're seeing BT_SMP_ERR_UNSPECIFIED after a pairing request have been received should be trigged, so we've narrowed it down somewhat at least.

    Can you also add HCI logging so we can get a look there as well. The following configs in prj.conf should do it

    CONFIG_BT_DEBUG_HCI_CORE=y
    CONFIG_BT_DEBUG_HCI_DRIVER=y
    Can you also confirm that the Windows 11 device has removed previous bonds before trying to bond to this device, and that the DK isn't already paired. As we thought we were able to reproduce it for a moment here, but it was fixed by erasing previous bonding information on the two devices.
    Best regards,
    Simon
  • Everything I wrote on the topic is based on the standard example:

    /SDK/ncs/v1.8.0/nrf/samples/bluetooth/peripheral_uart  (/build_nrf5340dk_nrf5340_cpuapp).

    I only added, already 4, debug lines. I am attaching the file, they are finally written.

    In Windows I removed all Bluetooth devices, there is nothing.

    The kit was programmed before the tests with another example, i.e. there should be nothing left.

    ( I am currently thinking about how to speed up the transmission speeds. How to declare and change: ATT_MTU size, PHY, LE Data Length, LE Connection interval. It was programmed with: Bluetooth: Throughput. After reading the whole forum and other information on the net, I came to the conclusion that it is not clear at all. The standard example (uart) works with intervals of about 100+ ms, 20-bytes packet, string format. I changed everything, now it works with binary transfer, interval about 40ms, 40-bytes packet. BUT that's another question, so I'm not asking anything.

    I will post another question in the forum after clarifying some more things.)

     

    I don't see any movement in the debug window at the time of connection. I made three attempts.

    laptopW11_002.zip

Related