nrf_desktop: nrf52840dongle no signs of life after flash

I'm trying to use the nrf_desktop application 100% standard, with NO changes to the codebase at all.

My initial assumption is, that once I flash the nrf52840dongle, it should act as a forwarder, as stated here https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/applications/nrf_desktop/board_configuration.html .

However, once flashed, nothing happens. dmesg does not detect the device when plugged in, and I get no signs of life (no LED, buttons do nothing, etc.). This is a fully standard nrf52840dongle, where I press the reset button to flash the device. The commands I use for flashing and building are the following:

west build -b nrf52840dongle/nrf52840 nrf/applications/nrf_desktop
nrfutil pkg generate --hw-version 52 --sd-req=0x00  --application build/merged.hex --application-version 1 build/zephyr.zip
nrfutil dfu usb-serial -pkg build/zephyr.zip -p /dev/ttyACM2

I've tried for a couple of days getting it to work, but without any luck. I must be missing something obvious! I don't have any debugger atm. but this is seriously making me consider getting one.

But my assumption is, that anything in the repo should work by default, without having to tweak many things (maybe?).

  • Hi

    I suspect the following:

    the configuration in nRF_desktop for the dongle  (nrf52840dongle/nrf52840) by default is not compatible with the pre-installed bootloader in the off the shelf 52840dongle. so you have two options:
    1) try adding following two options to the configuration file and build again the hex file, then try to program the dongle. 
    (make sure the dongle enters the bootloader by holding the button while plugging it in).

    CONFIG_FLASH_LOAD_OFFSET=0x1000
    CONFIG_BOARD_HAS_NRF5_BOOTLOADER=y

    This will make sure the image is compatible with the bootloader already in the dongle:
    (simular to this ticket RE: How to born nrf_desktop's image to nrf52840dongle )

    or 

    2) you can flash the merged.hex into the dongle using SWD interface and using a Sggger J-LINK 

    Please let us know if it solves the problem

    Thanks

    BR
    LA

  • Hi,

    Thanks for the fast answer! As I don't have a Segger J-Link debugger, I tried the first option. I had to set `CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=n` as well, as it complained about a DFU_SLOT_ID

    src/nrf/applications/nrf_desktop/src/modules/dfu.c:1005:47: error: 'DFU_SLOT_ID' undeclared (first use in this function)
     1005 |                         err = flash_area_open(DFU_SLOT_ID, &flash_area);
          |                                               ^~~~~~~~~~~
    [71/320] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/fs/nvs/nvs.c.obj

    However, after fixing that issue, I still get no lifesigns on the nrf52840dongle after flashing it. Keep in mind, I'm using `merged.hex` (which I think is the correct one?), or should I use another one?

    When flashing it, I press the RESET button, and the RED LED starts flashing, and I do get the confirmation of `Device Programmed.`.

    This is currently the changes I've made to the tree.

    diff --git a/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj.conf b/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj.conf
    index 1c3716b0ba..b02aabdd48 100644
    --- a/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj.conf
    +++ b/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj.conf
    @@ -29,7 +29,7 @@ CONFIG_DESKTOP_BLE_NEW_PEER_SCAN_ON_BOOT=y
     CONFIG_DESKTOP_BLE_PEER_ERASE=y
     
     CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y
    -CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=y
    +CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=n
     
     CONFIG_DESKTOP_BLE_QOS_ENABLE=y
     
    @@ -99,3 +99,7 @@ CONFIG_ASSERT=y
     CONFIG_ASSERT_LEVEL=2
     
     CONFIG_DESKTOP_LOG=y
    +
    +# MINE
    +CONFIG_FLASH_LOAD_OFFSET=0x1000
    +CONFIG_BOARD_HAS_NRF5_BOOTLOADER=y
    \ No newline at end of file

  • I found out that a place in the `prj.conf` set `CONFIG_BOARD_HAS_NRF5_BOOTLOADER=n`, but I've changed that now, so that I have the following diff.

    diff --git a/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj.conf b/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj.conf
    index 1c3716b0ba..ddb2b60ac0 100644
    --- a/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj.conf
    +++ b/applications/nrf_desktop/configuration/nrf52840dongle_nrf52840/prj.conf
    @@ -29,15 +29,15 @@ CONFIG_DESKTOP_BLE_NEW_PEER_SCAN_ON_BOOT=y
     CONFIG_DESKTOP_BLE_PEER_ERASE=y
     
     CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y
    -CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=y
    +CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=n
     
     CONFIG_DESKTOP_BLE_QOS_ENABLE=y
     
     ################################################################################
     # Zephyr Configuration
     
    -CONFIG_ROM_START_OFFSET=0
    -CONFIG_BOARD_HAS_NRF5_BOOTLOADER=n
    +# CONFIG_ROM_START_OFFSET=0
    +# CONFIG_BOARD_HAS_NRF5_BOOTLOADER=n
     
     CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536
     CONFIG_ISR_STACK_SIZE=1280
    @@ -99,3 +99,7 @@ CONFIG_ASSERT=y
     CONFIG_ASSERT_LEVEL=2
     
     CONFIG_DESKTOP_LOG=y
    +
    +# MINE
    +CONFIG_FLASH_LOAD_OFFSET=0x1000
    +CONFIG_BOARD_HAS_NRF5_BOOTLOADER=y
    \ No newline at end of file

    And I've confirmed that the two variables is set in the output build files.

    $ grep -ir1 NRF5_BOOTLOADER
    nrf_desktop/zephyr/.config-#
    nrf_desktop/zephyr/.config:CONFIG_BOARD_HAS_NRF5_BOOTLOADER=y
    nrf_desktop/zephyr/.config-# CONFIG_BOARD_SERIAL_BACKEND_CDC_ACM is not set
    --
    nrf_desktop/zephyr/include/generated/zephyr/autoconf.h-#define CONFIG_BOARD_QUALIFIERS "nrf52840"
    nrf_desktop/zephyr/include/generated/zephyr/autoconf.h:#define CONFIG_BOARD_HAS_NRF5_BOOTLOADER 1
    nrf_desktop/zephyr/include/generated/zephyr/autoconf.h-#define CONFIG_SOC_FAMILY_NORDIC_NRF 1
    grep: nrf_desktop/zephyr/zephyr_pre0.elf: binary file matches
    --
    nrf_desktop/zephyr/misc/generated/configs.c-GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_BOARD_QUALIFIERS, 1);
    nrf_desktop/zephyr/misc/generated/configs.c:GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_BOARD_HAS_NRF5_BOOTLOADER, 1);
    nrf_desktop/zephyr/misc/generated/configs.c-GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_SOC_FAMILY_NORDIC_NRF, 1);
    grep: nrf_desktop/zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj: binary file matches
    grep: nrf_desktop/zephyr/zephyr.elf: binary file matches
    grep: nrf_desktop/zephyr/libzephyr.a: binary file matches
    --
    b0/zephyr/.config-#
    b0/zephyr/.config:# CONFIG_BOARD_HAS_NRF5_BOOTLOADER is not set
    b0/zephyr/.config-# CONFIG_BOARD_SERIAL_BACKEND_CDC_ACM is not set
    grep: s1_image/zephyr/zephyr_pre0.elf: binary file matches
    grep: s1_image/zephyr/libzephyr.a: binary file matches
    --
    s1_image/zephyr/misc/generated/configs.c-GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_BOARD_QUALIFIERS, 1);
    s1_image/zephyr/misc/generated/configs.c:GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_BOARD_HAS_NRF5_BOOTLOADER, 1);
    s1_image/zephyr/misc/generated/configs.c-GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_SOC_FAMILY_NORDIC_NRF, 1);
    grep: s1_image/zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj: binary file matches
    grep: s1_image/zephyr/zephyr.elf: binary file matches
    --
    s1_image/zephyr/include/generated/zephyr/autoconf.h-#define CONFIG_BOARD_QUALIFIERS "nrf52840"
    s1_image/zephyr/include/generated/zephyr/autoconf.h:#define CONFIG_BOARD_HAS_NRF5_BOOTLOADER 1
    s1_image/zephyr/include/generated/zephyr/autoconf.h-#define CONFIG_SOC_FAMILY_NORDIC_NRF 1
    --
    s1_image/zephyr/.config-#
    s1_image/zephyr/.config:CONFIG_BOARD_HAS_NRF5_BOOTLOADER=y
    s1_image/zephyr/.config-# CONFIG_BOARD_SERIAL_BACKEND_CDC_ACM is not set
    
    
    
    $ grep -ir1 CONFIG_FLASH_LOAD_OFFSET
    nrf_desktop/zephyr/.config-CONFIG_BT_HCI_VS=y
    nrf_desktop/zephyr/.config:CONFIG_FLASH_LOAD_OFFSET=0x1000
    nrf_desktop/zephyr/.config-CONFIG_USB_DEVICE_STACK=y
    --
    nrf_desktop/zephyr/include/generated/zephyr/autoconf.h-#define CONFIG_BT_HCI_VS 1
    nrf_desktop/zephyr/include/generated/zephyr/autoconf.h:#define CONFIG_FLASH_LOAD_OFFSET 0x1000
    nrf_desktop/zephyr/include/generated/zephyr/autoconf.h-#define CONFIG_USB_DEVICE_STACK 1
    grep: nrf_desktop/zephyr/zephyr_pre0.elf: binary file matches
    --
    nrf_desktop/zephyr/misc/generated/configs.c-GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_BT_HCI_VS, 1);
    nrf_desktop/zephyr/misc/generated/configs.c:GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_FLASH_LOAD_OFFSET, 0x1000);
    nrf_desktop/zephyr/misc/generated/configs.c-GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_USB_DEVICE_STACK, 1);
    grep: nrf_desktop/zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj: binary file matches
    grep: nrf_desktop/zephyr/zephyr.elf: binary file matches
    grep: nrf_desktop/zephyr/libzephyr.a: binary file matches
    --
    b0/zephyr/.config-# CONFIG_MODEM is not set
    b0/zephyr/.config:CONFIG_FLASH_LOAD_OFFSET=0
    b0/zephyr/.config-# CONFIG_USB_DEVICE_STACK is not set
    grep: b0/zephyr/zephyr.elf: binary file matches
    --
    b0/zephyr/include/generated/zephyr/autoconf.h:#define CONFIG_FLASH_LOAD_OFFSET 0x0
    b0/zephyr/include/generated/zephyr/autoconf.h-#define CONFIG_NUM_IRQS 48
    grep: b0/zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj: binary file matches
    grep: b0/zephyr/libzephyr.a: binary file matches
    grep: b0/zephyr/zephyr_pre0.elf: binary file matches
    --
    b0/zephyr/misc/generated/configs.c-
    b0/zephyr/misc/generated/configs.c:GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_FLASH_LOAD_OFFSET, 0x0);
    b0/zephyr/misc/generated/configs.c-GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_NUM_IRQS, 48);
    grep: s1_image/zephyr/zephyr_pre0.elf: binary file matches
    grep: s1_image/zephyr/libzephyr.a: binary file matches
    --
    s1_image/zephyr/misc/generated/configs.c-GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_BT_HCI_VS, 1);
    s1_image/zephyr/misc/generated/configs.c:GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_FLASH_LOAD_OFFSET, 0x1000);
    s1_image/zephyr/misc/generated/configs.c-GEN_ABSOLUTE_SYM_KCONFIG(CONFIG_USB_DEVICE_STACK, 1);
    grep: s1_image/zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj: binary file matches
    grep: s1_image/zephyr/zephyr.elf: binary file matches
    --
    s1_image/zephyr/include/generated/zephyr/autoconf.h-#define CONFIG_BT_HCI_VS 1
    s1_image/zephyr/include/generated/zephyr/autoconf.h:#define CONFIG_FLASH_LOAD_OFFSET 0x1000
    s1_image/zephyr/include/generated/zephyr/autoconf.h-#define CONFIG_USB_DEVICE_STACK 1
    --
    s1_image/zephyr/.config-CONFIG_BT_HCI_VS=y
    s1_image/zephyr/.config:CONFIG_FLASH_LOAD_OFFSET=0x1000
    s1_image/zephyr/.config-CONFIG_USB_DEVICE_STACK=y

    Yet I still cannot get it to work. I've tried flashing the `build/s1.hex` and `build/nrf_desktop/zephyr/zephyr.hex` without any luck as well.

  • ok, thanks for feedback. Can you share which SDK version you are using so we can replicate?
    thanks

  • My sdk-nrf is on v2.9.0, if you would like me to try a different version feel free to ask! :) Very much appreciate the help, and the very fast replies!

Related