Trouble flashing nrf52840 dongle (Peripheral UART sample)

I am trying to port the BLE Peripheral UART sample to work on the nrf52840 dongle. It's not in the list of supported board but I don't see why it shouldn't work (at least, the BLE advertising part). I created a new app from the sample and created a build configuration for the nrf52840dongle. I then build the code which succeeds without error. Now, I can't use Visual Studio Code to flash the dongle so I followed the steps here: https://academy.nordicsemi.com/flash-instructions-for-nrf52840-dongle/

I tried with both "merged.hex" and "zephyr.hex" but in both cases, when I use "nrf Connect for Mobile" to scan BLE devices, the dongle doesn't show up. I also tried the same procedure but with the GUI programmer but same error. All that happens after the flash succeeds, is that both leds light up (blue and green). I should mention that I successfully flashed a nrf52840dk which works as expected (the BLE device shows up when scanning with Nrf Connect for Mobile).

What am I doing wrong?

Some logs of what I tried:

~/code/nordic/peripheral_uart/build/peripheral_uart/zephyr$ nrfutil pkg generate --hw-version 52 --sd-req=0x00  --application zephyr.hex --application-version 1 app.zip

|===============================================================|
|##      ##    ###    ########  ##    ## #### ##    ##  ######  |
|##  ##  ##   ## ##   ##     ## ###   ##  ##  ###   ## ##    ## |
|##  ##  ##  ##   ##  ##     ## ####  ##  ##  ####  ## ##       |
|##  ##  ## ##     ## ########  ## ## ##  ##  ## ## ## ##   ####|
|##  ##  ## ######### ##   ##   ##  ####  ##  ##  #### ##    ## |
|##  ##  ## ##     ## ##    ##  ##   ###  ##  ##   ### ##    ## |
| ###  ###  ##     ## ##     ## ##    ## #### ##    ##  ######  |
|===============================================================|
|You are not providing a signature key, which means the DFU     |
|files will not be signed, and are vulnerable to tampering.     |
|This is only compatible with a signature-less bootloader and is|
|not suitable for production environments.                      |
|===============================================================|

Zip created at app.zip
~/code/nordic/peripheral_uart/build/peripheral_uart/zephyr$ nrfutil device program --firmware app.zip --traits nordicDfu
[00:00:10] ###### 100% [2/2 DA8F3E6471E3] Programmed
~/code/nordic/peripheral_uart/build/peripheral_uart/zephyr$ cd ../../                                                          master
~/code/nordic/peripheral_uart/build$ nrfutil pkg generate --hw-version 52 --sd-req=0x00  --application merged.hex --application-version 1 app.zip


|===============================================================|
|##      ##    ###    ########  ##    ## #### ##    ##  ######  |
|##  ##  ##   ## ##   ##     ## ###   ##  ##  ###   ## ##    ## |
|##  ##  ##  ##   ##  ##     ## ####  ##  ##  ####  ## ##       |
|##  ##  ## ##     ## ########  ## ## ##  ##  ## ## ## ##   ####|
|##  ##  ## ######### ##   ##   ##  ####  ##  ##  #### ##    ## |
|##  ##  ## ##     ## ##    ##  ##   ###  ##  ##   ### ##    ## |
| ###  ###  ##     ## ##     ## ##    ## #### ##    ##  ######  |
|===============================================================|
|You are not providing a signature key, which means the DFU     |
|files will not be signed, and are vulnerable to tampering.     |
|This is only compatible with a signature-less bootloader and is|
|not suitable for production environments.                      |
|===============================================================|

Zip created at app.zip
~/code/nordic/peripheral_uart/build$ nrfutil device program --firmware app.zip --traits nordicDfu                                            master
[00:00:10] ###### 100% [2/2 DA8F3E6471E3] Programmed

Parents
  • Update:

    I also tried to build and flash the "Bluetooth: Peripheral LBS" which according to its documentation supports the nrf52840 dongle. But after I flash nothing happens although the documentation states that the LED should be blinking.

    Here's the steps I followed

    1) I created a new application from sample

    2) Create a build configuration, keep all defaults except for the board which I change to nrf52840dongle/nrf52840.

    3) Click build.

    4) Put the dongle in bootloader mode (red led fading in/out).

    5) Open the Programmer, select device, add file, select build/merged.hex, click "Write".

    I tried with two different dongles to make sure it wasn't a hardware issue.

    What am I doing wrong?

  • Update2: 

    I managed to get the "Bluetooth: Peripheral LBS" sample to work by copying the pm_static_nrf52840dongle_nrf52840.yml file from the "Bluetooth Mesh light fixture sample" sample to the root of the project.

    However, the "BLE Peripheral UART" sample is still not working as expected.

  • Hi olalonde,

    That is really quite strange. I just built the Peripheral LBS sample myself, and the memory layout is as expected. The application starts at 0x00001000, which is the only requirement for the dongle to work. I unfortunately don't have a dongle with me so I couldn't verify that it works yet.

    Do you have the hex file of the Peripheral LBS sample when it didn't work? Also, what SDK version were you using?

    As for Peripheral UART, how is it not working? Are you able to see its advertisement with the nRF Connect app, for example?

    Hieu

  • Hi,

    1) peripheral_lbs v2.7.0 is normal, but v2.9.0 can't advertise in dongle. I guess nordic make something wrong in the new NCS version.

    I attach the hex file for test.

    zephyr_v270_lbs.hex

    2) peripheral_uart is failed to advertise in both NCS version for dongle, I guess maybe need to modify main.c due to UART function, but I don't have time to trace now.

Reply Children
Related