Re: Zephyr DFU protocol

David Brown

On Tue, Aug 29, 2017 at 09:14:31AM +0000, Cufi, Carles wrote:

One other protocol I just realized is already out there is lwm2m.
There is starting to be some support for it in Zephyr, it works over
other transports, supports device management, and has support for
firmware update.
I just read through the highlights of the spec and indeed this
matches relatively closely the concept we are trying to push here
with a "management" protocol. After looking through it a bit here are
the problems I see:

a) Complexity: By reading through the specification[i] this looks
like a pretty complex protocol to me, which in many cases might be a
drawback to users wanting to reduce ROM and RAM size. This is
particularly important for very constrained devices that only need to
send some sensor data over BLE for example
I had a conversation with Sterling Hughes yesterday, and he explained
that this was pretty much the primary reason for developing the news
manager protocol instead of just using lwm2m.

b) Suitability for other transports: The specification clearly states
2 main transports: UDP and SMS. While adapting this to other
transports would likely be feasible, the protocol doesn't look
designed for it
c) Model: the protocol seems to rest on the basis of a "pull" model,
where clients are the target devices. For the reasons stated before,
this might not be suitable to simple UART, BLE or USB CDC ACM
This is the other main reason for its infeasibility.

That said, the protocol does match the Newt Manager Protocol quite
closely when it comes to supported functionality and purpose. My vote
here would be to have support for both, because I do not think
running LWM2M over UART or BLE is a good match for tiny constrained
applications that only require simple firmware updates.
Agreed. I think that lwm2m is going to end up needing to be
implemented because there will be environments that will require that
specific protocol. But, we will want something like newtmgr for other
cases, and situations where less code is desired.

It is also possible for newtmgr to be layered differently, depending
on the situation. For serial, it can either be used directly, or in a
console friendly manner (with escape characters and base-64 encoding).
It is possible to leave minicom or picocom running, and have newtmgr
connect to the serial port to exchange packets.

On BLE, it can be transported directly over GATT.

And for network interfaces, layering it over COAP or COAPS makes


Join to automatically receive all group messages.