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?).

Parents
  • 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

Reply
  • 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

Children
  • 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!

  • I've done a git bisect of nrf-sdk, and it works on v1.9.99-dev1, but breaks on v2.0.0. The bisect log isolates the following commit as the first bad commit https://github.com/nrfconnect/sdk-nrf/commit/92fa69aa64511da3876f9278b03718fc2ad956f4 , which does a lot of changes. I suspect that this still means it's some bootloader stuff, that's the issue.

    The bisect log is as follows

    git bisect start
    # status: waiting for both good and bad commits
    # good: [651142deec73bd7d975743dcce340bc3fca3e4d9] version: Update VERSION to 1.9.99-dev1
    git bisect good 651142deec73bd7d975743dcce340bc3fca3e4d9
    # status: waiting for bad commit, 1 good commit known
    # bad: [880c82dba48655ee3a75edaefa0208782967ff17] VERSION: Update to 2.0.0
    git bisect bad 880c82dba48655ee3a75edaefa0208782967ff17
    # bad: [880c82dba48655ee3a75edaefa0208782967ff17] VERSION: Update to 2.0.0
    git bisect bad 880c82dba48655ee3a75edaefa0208782967ff17
    # bad: [fe195bdc3a4eefd346f1db3396b8284c8cb4a3cb] bluetooth: fast_pair: Add definition of ECDH public key
    git bisect bad fe195bdc3a4eefd346f1db3396b8284c8cb4a3cb
    # good: [b5f0eee0570aef591a9406f45f7f04a3725afccc] samples/nrf9160/http_update: Switch overlay to PINCTRL.
    git bisect good b5f0eee0570aef591a9406f45f7f04a3725afccc
    # good: [b1d10c6cc46b53752471023a165d9ed521a37eec] samples: lwm2m_client: Session lifetime update
    git bisect good b1d10c6cc46b53752471023a165d9ed521a37eec
    # good: [c1ef2d973c9c0023fa34eb216211e38d93e6c08e] manifest: Update sdk-nrf-802154 and nrfxlib revisions
    git bisect good c1ef2d973c9c0023fa34eb216211e38d93e6c08e
    # good: [c1ef2d973c9c0023fa34eb216211e38d93e6c08e] manifest: Update sdk-nrf-802154 and nrfxlib revisions
    git bisect good c1ef2d973c9c0023fa34eb216211e38d93e6c08e
    # bad: [9adb5598b1d53e8402ac6cf8da3c17bae828dd8e] changelog: Update changelog with the DTM changes
    git bisect bad 9adb5598b1d53e8402ac6cf8da3c17bae828dd8e
    # bad: [9adb5598b1d53e8402ac6cf8da3c17bae828dd8e] changelog: Update changelog with the DTM changes
    git bisect bad 9adb5598b1d53e8402ac6cf8da3c17bae828dd8e
    # good: [16f6fc5a53d45222786d2ef1b68809f953894a1e] manifest: Zephyr update with OpenThread changes
    git bisect good 16f6fc5a53d45222786d2ef1b68809f953894a1e
    # good: [16f6fc5a53d45222786d2ef1b68809f953894a1e] manifest: Zephyr update with OpenThread changes
    git bisect good 16f6fc5a53d45222786d2ef1b68809f953894a1e
    # bad: [a3986baabf70e78c5e769f52b2771c77fea26229] samples: lwm2m: LwM2M v1.1 SenML CBOR enabled
    git bisect bad a3986baabf70e78c5e769f52b2771c77fea26229
    # bad: [92fa69aa64511da3876f9278b03718fc2ad956f4] applications: nrf_desktop: Rework of nrf_desktop configurations
    git bisect bad 92fa69aa64511da3876f9278b03718fc2ad956f4
    # good: [34348d3910edf723ec28a6165ceae8811075ce9f] cmake: Propagate the NCS Zephyr SDK install dir
    git bisect good 34348d3910edf723ec28a6165ceae8811075ce9f
    # first bad commit: [92fa69aa64511da3876f9278b03718fc2ad956f4] applications: nrf_desktop: Rework of nrf_desktop configurations

Related