This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52840 Dongle / nrfutil

Hi

I am currently evaluating a 52840-DK (from 2017 I believe) and several 52840 dongles (ordered very recently). I managed to successfully run the light/switch mesh example. Both using the nrf5/mesh SDK (and softdevice s140) as well as with the (newer) zephyr-based nRF Connect SDK (NCS). One remaining question is now how to best program the dongles. The only way I managed to program them so far is via the nrf connect app using the programmer utility. What I observed, however, is that it takes several iterations of selecting/de-selecting a dongle device until it finally is recognised by the programmer utility. The error messages I get look like:

16:31:04.890 Error when calling version command: Error: Error: Device or resource busy, cannot open /dev/ttyACM0
16:31:04.891 Error when fetching device versions: TypeError: Cannot read property 'part' of undefined
16:31:04.891 Error when closing serial port: Error: Port is not open


After a while (maybe 30s) the connection is finally established and all looks good:

16:31:32.676 Protocol Version: 1 found
16:31:32.679 Hardware: 52840 found
16:31:32.682 Firmware: Bootloader found
16:31:32.682 Firmware: Application found

After that I am able to program the device for a single time (and will then have to go through the lengthy iteration cycle again). Is this the expected behaviour on Linux? Or am I missing something in my setup maybe?

Is there a better way of programming the dongle(s) even? I tried nrfutil but only got errors so far when I tried to flash an NCS based application. What puzzles me, however, is that the nrfutil asks for a softdevice id (mandatory) when creating a downloadable package. I test-wise created a package with --sd-req=0x0, which - when loaded into the DK - would then trigger a scan operation in the DK and return a list of scanned bluetooth devices. So all seems to be OK from the DK side. (The DK runs the connectivity firmware.)

==> Before I dig further into this, I'd like to clarify whether it is even possible to use nrfutil for flashing the dongles ?? Also, could one dongle be used to program several other dongles or do I definitely need the DK for this?

Another question is related to debugging. Is it somehow possible to (mis-)use the USB connection of the dongle as a console? Such that you can re-direct print statements to that console?

Thanks,
Herb

  • Hi,

    After that I am able to program the device for a single time (and will then have to go through the lengthy iteration cycle again). Is this the expected behaviour on Linux? Or am I missing something in my setup maybe?

    I don't think this is normal behaviour for nRF Connect Programmer on Linux or any other platforms for that matter. Have you tried it on another computer with Linux? Or windows? Does it occur for all the dongles?

    Yes, it is possible to use nrfutil to program the dongle, but I think the easiset way is to use the programmer app in nRF Connect. Have a look at this guide for the different ways you can program the dongle.

    Also, could one dongle be used to program several other dongles or do I definitely need the DK for this?

    What do you mean by using the dongle to program other dongles? Like an external programmer? If so, no. You need a DK for this.

    Is it somehow possible to (mis-)use the USB connection of the dongle as a console? Such that you can re-direct print statements to that console?

    I don't think this is possible.

  • Hi

    I don't think this is normal behaviour for nRF Connect Programmer on Linux or any other platforms for that matter. Have you tried it on another computer with Linux? Or windows? Does it occur for all the dongles?

    I only have a single Linux box available at the moment, but it happened with all my dongles a like. No difference in behaviour whatsoever. As the "nrf connect app" doesn't support all features on all platforms I am just curious to learn what kind of limitations are existing. It may well be I am missing a particular setting/configuration, etc.

    What do you mean by using the dongle to program other dongles? Like an external programmer? If so, no. You need a DK for this.

    What I meant is to program OTA.

    Have a look at this guide for the different ways you can program the dongle.

    Yes, I had read that already. Nice tutorial. If I am not totally wrong, however, then all the nrfutil commandline examples to create a package use the --sd-req (SoftDevice) parameter. On the other hand, this excellent article mentions that NCS applications don't actually use SoftDevices. So what command(line) do I have to use to create a programmable package from an NCS based application? And - most important - can this package be programmed OTA.

    Cheers,
    Herb

  • I don't think this is normal behaviour for nRF Connect Programmer on Linux or any other platforms for that matter. Have you tried it on another computer with Linux? Or windows? Does it occur for all the dongles?

    This problem is meanwhile sorted. It was indeed a configuration issue.

    The other question - about nrfutil - still remains.

    Thanks,
    Herb

  • Hi,

    The easiest way would be to solder the header on the dongle and then use a programmer(like a DK) to program the dongle like a normal board. But you can use the bootloader to update the dongle as well.

    You can use nrfutil to create a package for NCS based application. If you don't use softdevice you can just use --sd-req 0x00 and don't provide softdevice hex. This package can be programmed OTA. In the zephyr application you also need to change the start address and vector table to 0x1000

Related