Skip to content

RFC: Move mcumgr functionality as internal Zephyr service #36017

@de-nordic

Description

@de-nordic

Origin

Zephyr port of mcumgr: https://github.com/zephyrproject-rtos/mcumgr

Purpose

Currently used fork is, snapshot updated, copy of https://github.com/apache/mynewt-mcumgr that relies on modified fork of TinyCBOR (https://github.com/zephyrproject-rtos/tinycbor) , taken from https://github.com/apache/mynewt-core/tree/master/encoding/tinycbor.

Mcumgr is missing some features, for example "image" number parsing that allows to select image which will be uploaded, has some logic that does not suit Zephyr hardcoded in common code, or written in a way that does not allow Zephyr to easily extend it's functionalities.

Ownership of mcumgr will allow Zephyr to provide required, or Zephyr specific, features in more system optimized and development process efficient way; additionally an implementation of client-side library may be considered that may benefit many projects, by making it easier to update one device from another.

Additionally to above the mcumgr uses "non-standard" (https://github.com/intel/tinycbor) version of TinyCBOR, which means that there are possible two, incompatible, sources of changes to TinyCBOR that may collide, and may force us to basically implement any changes by hand, making the Zephyr the third possible source of changes; although there have not been may updates lately to both forks, the risk is there.

Moving the mcumgr into the Zephyr code base could enable switch to the CDDL-gen (https://github.com/NordicSemiconductor/cddl-gen) CBOR API and codec generator, a move similar to done by the mcuboot (mcu-tools/mcuboot#997); the API of the project is quite similar to TinyCBOR, but it also allows to auto-generate coding-decoding functions for structures; the project is actively maintained.

Mode of integration

The mcumgr is currently a module of zephyr (modules/lib/mcumgr) and its integration would require moving it to zephyr/subsys/mgmt/mcumgr/.
Then the work on optimizing the code for Zephyr may start.
Afterwards a switch to CDDL and implementation of client side library may be performed.

Dependencies

Currently the mcumgr depends on TinyCBOR fork within Zephyr modules (https://github.com/zephyrproject-rtos/tinycbor),
but it is already there anyway.

License

Current license of mcumgr source code in modules/lib/mcumgr/, and in https://github.com/apache/mynewt-mcumgr, is http://www.apache.org/licenses/LICENSE-2.0

Metadata

Metadata

Assignees

Labels

RFCRequest For Comments: want input from the communityarea: mcumgr

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions