nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

connecting nrf52840dk to nrf52840dongle uart examples

Greetings All,

I am trying to connect an nrf52840dk board to an nrf52840dongle for wireless serial communication.

I flashed the nrf52840dk with the central_uart sample and the nrf52840dongle with the peripheral_uart sample.

I'm using version 1.9.1 of the nRF Connect SDK 

I can't seem to get them to pair automatically, so, no serial activity possible.

(red led on nrf52840dongle does light, indicating a connection)

Here is the debug terminal output.

[00:00:08.444,152] <inf> fs_nvs: 8 Sectors of 4096 bytes
[00:00:08.444,183] <inf> fs_nvs: alloc wra: 0, fd0
[00:00:08.444,183] <inf> fs_nvs: data wra: 0, 1c
[00:00:08.444,305] <inf> sdc_hci_driver: SoftDevice Controller build revision:
0e e7 c5 66 67 18 3c ac b3 d2 cc 81 a3 dc f1 c0 |...fg.<. ........
c0 36 02 22 |.6." 
[00:00:08.448,944] <inf> bt_hci_core: No ID address. App must call settings_load()
[00:00:08.448,944] <inf> central_uart: Bluetooth initialized
[00:00:08.452,728] <inf> central_uart: Scan module initialized
[00:00:08.452,728] <inf> central_uart: NUS Client module initialized
[00:00:08.460,998] <inf> central_uart: Scanning successfully started
[00:00:19.828,613] <inf> central_uart: Filters matched. Address: FE:DB:32:64:13:31 (random) connectable: 0
[00:00:19.928,100] <inf> central_uart: Connected: FE:DB:32:64:13:31 (random)
[00:00:20.029,388] <inf> central_uart: MTU exchange done
[00:00:20.179,321] <err> bt_smp: reason 0x8
[00:00:20.179,809] <wrn> central_uart: Security failed: FE:DB:32:64:13:31 (random) level 1 err 9
[00:00:20.180,236] <wrn> central_uart: Pairing failed conn: FE:DB:32:64:13:31 (random), reason 9
[00:00:20.879,241] <inf> central_uart: Service discovery completed

Any thoughts?

Thank you.

  • Greetings Einar,

    Thank you for your reply.

    If I flash the DK as peripheral and Dongle as central, and debug peripheral.
    without the dongle being powered, I get the following output with no errors.

    [00:00:02.314,147] <inf> fs_nvs: 8 Sectors of 4096 bytes
    [00:00:02.314,147] <inf> fs_nvs: alloc wra: 0, fd0
    [00:00:02.314,147] <inf> fs_nvs: data wra: 0, 1c
    [00:00:02.314,392] <inf> sdc_hci_driver: SoftDevice Controller build revision:
    0e e7 c5 66 67 18 3c ac b3 d2 cc 81 a3 dc f1 c0 |...fg.<. ........
    c0 36 02 22 |.6."
    [00:00:02.321,807] <inf> bt_hci_core: No ID address. App must call settings_load()
    [00:00:02.321,838] <inf> peripheral_uart: Bluetooth initialized

    When I fire up central on the dongle, I get the following output without error.
    Hooray!

    [00:00:02.314,147] <inf> fs_nvs: 8 Sectors of 4096 bytes
    [00:00:02.314,147] <inf> fs_nvs: alloc wra: 0, fd0
    [00:00:02.314,147] <inf> fs_nvs: data wra: 0, 1c
    [00:00:02.314,392] <inf> sdc_hci_driver: SoftDevice Controller build revision:
    0e e7 c5 66 67 18 3c ac b3 d2 cc 81 a3 dc f1 c0 |...fg.<. ........
    c0 36 02 22 |.6."
    [00:00:02.321,807] <inf> bt_hci_core: No ID address. App must call settings_load()
    [00:00:02.321,838] <inf> peripheral_uart: Bluetooth initialized
    [00:00:43.059,356] <inf> peripheral_uart: Connected FE:DB:32:64:13:31 (random)

    If I start sending serial data, I get the following output.

    [00:00:02.912,780] <inf> fs_nvs: 8 Sectors of 4096 bytes
    [00:00:02.912,780] <inf> fs_nvs: alloc wra: 0, fd0
    [00:00:02.912,780] <inf> fs_nvs: data wra: 0, 1c
    [00:00:02.913,024] <inf> sdc_hci_driver: SoftDevice Controller build revision:
    0e e7 c5 66 67 18 3c ac b3 d2 cc 81 a3 dc f1 c0 |...fg.<. ........
    c0 36 02 22 |.6."
    [00:00:02.920,379] <inf> bt_hci_core: No ID address. App must call settings_load()
    [00:00:02.920,440] <inf> peripheral_uart: Bluetooth initialized
    [00:00:03.253,753] <inf> peripheral_uart: Connected DF:FE:3E:E2:44:AE (random)
    [00:00:14.654,235] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:14.754,394] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:14.854,278] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:14.954,345] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:15.054,290] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:15.154,327] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:15.254,241] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:15.354,309] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:15.454,315] <inf> peripheral_uart: Received data from: <log_strdup alloc failed>
    [00:00:15.554,229] <inf> peripheral_uart: Received data from: <log_strdup alloc failed>
    [00:00:15.654,205] <inf> peripheral_uart: Received data from: <log_strdup alloc failed>
    [00:00:15.754,211] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:15.854,217] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:15.954,193] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:16.054,290] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:16.154,174] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:16.254,180] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:16.354,187] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:16.454,284] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:16.554,229] <inf> peripheral_uart: Received data from: <log_strdup alloc failed>
    [00:00:16.654,144] <inf> peripheral_uart: Received data from: <log_strdup alloc failed>
    [00:00:16.754,150] <inf> peripheral_uart: Received data from: <log_strdup alloc failed>
    [00:00:16.854,156] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:16.954,254] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:17.054,138] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:17.154,113] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:17.254,119] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:17.354,187] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:17.454,101] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:17.554,138] <inf> peripheral_uart: Received data from: DF:FE:3E:E2:44:AE (random)
    [00:00:17.654,174] <inf> peripheral_uart: Received data from: <log_strdup alloc failed>
    [00:00:17.754,089] <inf> peripheral_uart: Received data from: <log_strdup alloc failed>
    [00:00:17.854,064] <inf> peripheral_uart: Received data from: <log_strdup alloc failed>
    Ad Infinitum... Sad face.

    So the bluetooth connection is good now. I need to work on figuring out the serial comm errors. Timing? Buffers?

    I got a new dongle and programmed as peripheral, with the DK as central and I get no connection error in debug.
    Hooray!
    The new dongle date code is 2.1.0 /2021.51.

    The dongles I was having the error with, have date codes 1.2.0 /2020.19

    I'm not sure if I did something offensive to the bootloaders in the older dongles, or if they're just old.
    Is it possible to obtain a bootloader image from nordic to reflash the bootloader on the old dongles?

    Thank you.

  • Hi,

    Jim Ellyson said:
    So the bluetooth connection is good now. I need to work on figuring out the serial comm errors. Timing? Buffers?

    It looks like the log buffer is filling up faster than it can be emptied or it is simply too small. If that is the case, you can increase CONFIG_LOG_STRDUP_BUF_COUNT.

    Jim Ellyson said:
    I'm not sure if I did something offensive to the bootloaders in the older dongles, or if they're just old.
    Is it possible to obtain a bootloader image from nordic to reflash the bootloader on the old dongles?

    There are some minor differences between different dongle versions, but fundamentally they should all be compatible. This one has the latest revision IC with improved APPROTECT, but it is programmed with the same bootloader hex file as the older dongles in production. You can find a link to download the production hex file in the nRF52840 dongle programming tutorial (search for pca10059_bootloader.zip). Note that there are some pitfalls when using a debugger with the dongle, as explained in that tutorial

Related