commit | 35d290eadf4414f4902da67e01b165a39e61080c | [log] [tgz] |
---|---|---|
author | Dominik Ermel <dominik.ermel@nordicsemi.no> | Thu Feb 11 12:14:41 2021 +0000 |
committer | Fabio Utzig <utzig@utzig.org> | Fri Feb 12 07:33:38 2021 -0300 |
tree | 083a4bea837d435029612a12d9cbd27d0d0fef34 | |
parent | c8151d8023f2f985c66a9dcecb4e741cf5306393 [diff] |
zephyr: Use flash_img_init_id instead of flash_img_init Within mcumgr Zephyr port, the img_mgmt_find_best_area_id is used to get information on the update flash ID, yet the call to the flash_img_init selects such flash ID via value hardcoded during compilation. This may lead to situation where the mcumgr library and flash_img_init may select different partition for update. This commit replaces call to flash_img_init with flash_img_init_id, which takes flash area ID as a parameter, and uses img_mgmt_find_best_area_id to get the ID. This approach is better as img_mgmt_find_best_area_id, while searching for empty image, will also check its boot status (pending, test, etc). Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This is mcumgr, version 0.1.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.
For tips on using mcumgr with your particular OS, see the appropriate file from the list below:
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.
The mcumgr
command line tool is available at: https://github.com/apache/mynewt-mcumgr-cli. The command line tool requires Go 1.7 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.
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:
Each transport is configured with a single transfer encoding.
As an example, the sample application smp_svr
uses the following components:
img_mgmt
)fs_mgmt
)log_mgmt
)os_mgmt
)yielding the following stack diagram:
+----------+----------+----------+----------+ | img_mgmt | fs_mgmt | log_mgmt | os_mgmt | +----------+----------+----------+----------+ | mgmt | +---------------------+---------------------+ | SMP | SMP | +---------------------+---------------------+ | Bluetooth | Shell | +---------------------+---------------------+
An mcumgr request or response consists of the following two components:
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.
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
.
The mcumgr project defines two transports:
Implementations, being hardware- and OS-specific, are not included.
Information and documentation for mcumgr is stored within the source.
For more information in the source, here are some pointers:
mgmt
layer of mcumgr.Developers welcome!