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

  • Hi Jerry,

    I will consult internally with experts and get back to you on this.

    -Priyanka

  • Hi Jerry,

    Please take a look at the SMP Server sample. There are also these samples by my colleague, that you can refer to.

    You can also take a look at the following:

    Bootloaders and DFU docs

    nRF52840 FOTA Updates docs

    Regards,

    Priyanka

Related