Go to file
Dominik Ermel c854c85ec7 snapshot: Update mcumgr to commit 12b496e3 from the upstream
The commit applies changes that have appeared between the last snapshot
update from the upstream:
  apache/mynewt-mcumgr 47fdde0c9a2bac821d2a814541e31d734dd78866
and the current top of the upstream:
  apache/mynewt-mcumgr 12b496e37caf20a45ab5aee4209b06c5d79ef9b1

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-10-12 18:00:47 +02:00
cborattr snapshot: Update mcumgr to commit 12b496e3 from the upstream 2021-10-12 18:00:47 +02:00
cmd snapshot: Update mcumgr to commit 12b496e3 from the upstream 2021-10-12 18:00:47 +02:00
mgmt snapshot: Update mcumgr to commit b92aa0b8c9 from upstream 2021-02-23 08:58:08 +01:00
omp snapshot: Update mcumgr to commit ae4659b4 from upstream 2020-03-10 14:58:06 +01:00
samples snapshot: Update mcumgr to commit edb485cf from the upstream 2021-10-05 14:41:41 +02:00
smp snapshot: Update mcumgr to commit 98e8f320 from upstream 2020-03-13 14:06:00 +01:00
transport snapshot: Update mcumgr to commit 1e0f283c71 from upstream 2021-08-27 17:36:03 +02:00
util snapshot: Update mcumgr to commit 98e8f320 from upstream 2020-03-13 14:06:00 +01:00
zephyr snapshot: Update mcumgr to commit 98e8f320 from upstream 2020-03-13 14:06:00 +01:00
.gitignore snapshot: Update mcumgr to commit ae4659b4 from upstream 2020-03-10 14:58:06 +01:00
.rat-excludes snapshot: Update mcumgr to commit 98e8f320 from upstream 2020-03-13 14:06:00 +01:00
CMakeLists.txt snapshot: Update mcumgr to commit f3b171f2 from the upstream 2020-03-25 11:38:09 +01:00
README-mynewt.md snapshot: Update mcumgr to commit ae4659b4 from upstream 2020-03-10 14:58:06 +01:00
README-zephyr.md ext: lib: mgmt: mcumgr management infrastructure. 2018-02-20 22:07:52 +01:00
README.md snapshot: Update mcumgr to commit edb485cf from the upstream 2021-10-05 14:41:41 +02:00
protocol.md snapshot: Update mcumgr to commit 8d087a7e from the upstream 2020-09-02 15:18:38 -05:00
repository.yml snapshot: Update mcumgr to commit e64f5060bd from upstream 2021-04-28 16:59:07 +02:00

README.md

mcumgr

This is mcumgr, version 0.2.0

mcumgr is a management library for 32-bit MCUs. The goal of mcumgr is to define a common management infrastructure with pluggable transport and encoding components. In addition, mcumgr provides definitions and handlers for some core commands: image management, file system management, and OS management.

mcumgr is operating system and hardware independent. It relies on hardware porting layers from the operating system it runs on. Currently, mcumgr runs on both the Apache Mynewt and Zephyr operating systems.

Getting started

For tips on using mcumgr with your particular OS, see the appropriate file from the list below:

Dependencies

To use mcumgr's image management support, your device must be running version 1.1.0 or later of the MCUboot boot loader. The other mcumgr features do not require MCUboot.

Command line tool

The mcumgr command line tool is available at: https://github.com/apache/mynewt-mcumgr-cli. The command line tool requires Go 1.12 or later. Once Go is installed and set up on your system, you can install the mcumgr CLI tool by issuing the following go get command:

$ go get github.com/apache/mynewt-mcumgr-cli/mcumgr

The mcumgr tool allows you to manage devices running an mcumgr server.

Architecture

The mcumgr stack has the following layout:

+---------------------+---------------------+
|             <command handlers>            |
+---------------------+---------------------+
|                   mgmt                    |
+---------------------+---------------------+
|           <transfer encoding(s)>          |
+---------------------+---------------------+
|               <transport(s)>              |
+---------------------+---------------------+

Items enclosed in angled brackets represent generic components that can be plugged into mcumgr. The items in this stack diagram are defined below:

  • Command handler: Processes incoming mcumgr requests and generates corresponding responses. A command handler is associated with a single command type, defined by a (group ID, command ID) pair.
  • mgmt: The core of mcumgr; facilitates the passing of requests and responses between the generic command handlers and the concrete transports and transfer encodings.
  • Transfer encoding: Defines how mcumgr requests and responses are encoded on the wire.
  • Transport: Sends and receives mcumgr packets over a particular medium.

Each transport is configured with a single transfer encoding.

As an example, the sample application smp_svr uses the following components:

  • Command handlers:
    • Image management (img_mgmt)
    • File system management (fs_mgmt)
    • Log management (log_mgmt)
    • OS management (os_mgmt)
  • Transfer/Transports protocols:
    • SMP/Bluetooth
    • SMP/Shell

yielding the following stack diagram:

+----------+----------+----------+----------+
| img_mgmt |  fs_mgmt | log_mgmt |  os_mgmt |
+----------+----------+----------+----------+
|                   mgmt                    |
+---------------------+---------------------+
|         SMP         |         SMP         |
+---------------------+---------------------+
|      Bluetooth      |        Shell        |
+---------------------+---------------------+

Command definition

An mcumgr request or response consists of the following two components:

  • mcumgr header
  • CBOR key-value map

How these two components are encoded and parsed depends on the transfer encoding used.

The mcumgr header structure is defined in mgmt/include/mgmt/mgmt.h as struct mgmt_hdr.

The contents of the CBOR key-value map are specified per command type.

Supported transfer encodings

Mcumgr comes with one built-in transfer encoding: Simple Management Protocol (SMP). SMP requests and responses have a very basic structure. For details, see the comments at the top of smp/include/smp/smp.h.

Supported transports

The mcumgr project defines two transports:

Implementations, being hardware- and OS-specific, are not included.

Browsing

Information and documentation for mcumgr is stored within the source.

For more information in the source, here are some pointers:

  • cborattr: Used for parsing incoming mcumgr requests. Destructures mcumgr packets and populates corresponding field variables.
  • cmd: Built-in command handlers for the core mcumgr commands.
  • ext: Third-party libraries that mcumgr depends on.
  • mgmt: Code implementing the mgmt layer of mcumgr.
  • samples: Sample applications utilizing mcumgr.
  • smp: The built-in transfer encoding: Simple management protocol.

Joining

Developers welcome!