DFU over the air upgrades

I want to add a service to my application that will, over the air, download and reprogram the flash on a nRF52480_dongle.  I have spent hours reading various snippets of documentation I suspect much of it is out of date and the bits that seemed current didn't mak a lick of sense to me.

I want to do something like this:

Write a bluetooth program on my PC  that will broadcast firmware images to one or more nRF52840_dongles.

Add a service to a nRF52840 application that will accept the broadcasted firmware and reprogram the flash on the nRF52480_dpngle..

I do not want to use a "soft device", what ever that is.

Regards,

Jerry

Parents Reply
  • I gave up trying to supply the project as a template and just copied the project into my workspace and opened it up under nRF_CONNECT_EXTENSION.  I then added a build configuration for a nRF52840Dongle.  When I attempted a build on the unmodified project, it ended in error;

    "c:\Nordic\MyApps\dfu_peripheral_lbs\src\main.c:11:10: fatal error: sys/printk.h: No such file or directory
    11 | #include <sys/printk.h>
    | ^~~~~~~~~~~~~~
    compilation terminated."

    Apparently, the sample from github is not compatible with the nRF_CONNECT_EXTENSION environment.

    I am dead in the water and await your assistance.

    Regards,

    Jerry

Children
  • Maybe it would be more productive to code a test application from whole cloth; can you direct me to a discussion of the necessary API calls as well as a discussion on its "operational" theory.  I fear the

    Add DFU support to your application

    is is just another rabbit hole and I will never be able to make work.

    Regards,

    Jerry

  • On further reflection, the article seems to based on an outdated SDK which explains the build error.  However, the sample shipped with version 2.4.0 of the sdk does not contain the landmarks mentioned in the article.

    When I build the unmodified sample from the sdk, I get a plethora of error messages:

    These errors not withstanding, it does build and seems to work.

    Regards,

    Jerry

  • Hi Jerry,

    Apologies for the delay. We are short staffed here owing to the summer holidays here in Norway. Yes, the article seems to be based on a previous version SDK. Were you able to get it working or do you have any further queries regarding the topic?

    -Priyanka

  • Hi Priyanka,

    No I don't know how to proceed, everything I have tried has failed.

    Regards,

    Jerry

  • Hi Priyanka,

    I have been busy the last week converting my development system over to Ubuntu.  It was a lot of work but Nordic's toolchain, sdk, and vscode extensions all seem to be better behaved under Linux than Windows.  My main motivation for converting to Linus, though, was to have access to mcumgr.  I foound the documentation for it here: docs.zephyrproject.org/.../mcumgr.html

    When I started reading, I happened upon this notice:

    Note

    This tool is provided for evaluation use only and is not recommended for use in a production environment. It has known issues and will not respect the MCUmgr protocol properly e.g. when an error is received, instead of aborting will, in some circumstances, sit in an endless loop of sending the same command over and over again. A universal replacement for this tool is currently in development and once released, support for the go tool will be dropped entirely.

    Gobsmacked, but undeterred, I tried to install it, but it ended in failure:

    (.venv) jerry@JerrysDesktopUbuntu:~/zephyrproject/zephyr$ go install github.com/apache/mynewt-mcumgr-cli/mcumgr@latest
    go: downloading github.com/apache/mynewt-mcumgr-cli v0.0.0-20221004073047-5c56bd24066c
    go: downloading mynewt.apache.org/newtmgr v0.0.0-20201028150837-60b2da78788c
    go: downloading mynewt.apache.org/newt v0.0.0-20201028015609-b57111dbd19f
    go: downloading github.com/runtimeco/go-coap v0.0.0-20190911184520-8e5532820fc0
    go: downloading github.com/sirupsen/logrus v1.5.0
    go: downloading github.com/spf13/cast v1.3.0
    go: downloading github.com/spf13/cobra v0.0.5
    go: downloading gopkg.in/abiosoft/ishell.v2 v2.0.0
    go: downloading gopkg.in/cheggaaa/pb.v1 v1.0.28
    go: downloading github.com/JuulLabs-OSS/ble v0.0.0-20200716215611-d4fcc9d598bb
    go: downloading github.com/mitchellh/go-homedir v1.1.0
    go: downloading github.com/pkg/errors v0.8.1
    go: downloading github.com/joaojeronimo/go-crc16 v0.0.0-20140729130949-59bd0194935e
    go: downloading github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07
    go: downloading golang.org/x/sys v0.0.0-20220608164250-635b8c9b7f68
    go: downloading github.com/spf13/pflag v1.0.5
    go: downloading github.com/abiosoft/readline v0.0.0-20180607040430-155bce2042db
    go: downloading github.com/fatih/color v1.7.0
    go: downloading github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568
    go: downloading golang.org/x/net v0.0.0-20191119073136-fc4aabc6c914
    go: downloading github.com/ugorji/go v1.1.7
    go: downloading github.com/ugorji/go/codec v1.1.7
    go: downloading github.com/mattn/go-runewidth v0.0.6
    go: downloading github.com/fatih/structs v1.1.0
    go: downloading github.com/mattn/go-colorable v0.1.6
    go: downloading github.com/mattn/go-isatty v0.0.12
    go: downloading github.com/mgutz/logxi v0.0.0-20161027140823-aebf8a7d67ab
    go: downloading github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
    # github.com/apache/mynewt-mcumgr-cli/mcumgr
    /usr/bin/ld: $WORK/b080/_pkg_.a(_go_.o): in function `github_0com_1ugorji_1go_1codec.rvZeroAddrK':
    /home/jerry/go/pkg/mod/github.com/ugorji/go/[email protected]/helper_unsafe.go:146: undefined reference to `reflect.unsafe_New'
    /usr/bin/ld: /home/jerry/go/pkg/mod/github.com/ugorji/go/[email protected]/helper_unsafe.go:146: undefined reference to `reflect.unsafe_New'
    /usr/bin/ld: /home/jerry/go/pkg/mod/github.com/ugorji/go/[email protected]/helper_unsafe.go:146: undefined reference to `reflect.unsafe_New'
    /usr/bin/ld: /home/jerry/go/pkg/mod/github.com/ugorji/go/[email protected]/helper_unsafe.go:146: undefined reference to `reflect.unsafe_New'
    /usr/bin/ld: /home/jerry/go/pkg/mod/github.com/ugorji/go/[email protected]/helper_unsafe.go:146: undefined reference to `reflect.unsafe_New'
    /usr/bin/ld: $WORK/b080/_pkg_.a(_go_.o):/home/jerry/go/pkg/mod/github.com/ugorji/go/[email protected]/helper_unsafe.go:146: more undefined references to `reflect.unsafe_New' follow
    collect2: error: ld returned 1 exit status

    Apparently, there is no way to upgrade Nordic devices "over the air".  I am absolutely stunned by this realization! Imagine if you will that you have sold, say a thousand, lighting units, each individually controlled by a BLE device, to an office building .  Then you get an order from some regulating authority to change the behavior of the BLE devices.  This is a nightmare scenario!

    This is an absolute show stopper for me.  Unless I can find a solution I have no choice but to abandon the project.

    Regards,

    Jerry

Related