commit | 03242ecb716e96c804941203f3bf57dd7f86beb3 | [log] [tgz] |
---|---|---|
author | Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl> | Fri Apr 05 09:54:08 2024 +0200 |
committer | kasjer <kasjer@users.noreply.github.com> | Tue Apr 16 11:04:36 2024 +0200 |
tree | d21250aa7fbb1c8d6bbeefc6a89276e74e9e5cc0 | |
parent | 545f2b214402b46b7d8c2ffb86b7b65996c93422 [diff] |
Allow build when no FLASH_AREA_IMAGE_1 is defined Normally two flash areas are available FLASH_AREA_IMAGE_0 and FLASH_AREA_IMAGE_1. For cases bootloader is able to write to FLASH_AREA_IMAGE_0 directly (USB DFU) bsp used to define fake FLASH_AREA_IMAGE_1 with empty size. Bootloader with DFU functionality other then mcumgr still uses img_mgmt functions to confirm image. This change changes functions that operate on FLASH_AREA_IMAGE_1 to return MGMT_ERR_ENOTSUP when FLASH_AREA_IMAGE_1 is not defined. This allows to have bsp.yml without artificial zero sized areas. Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
This is mcumgr, version 0.4.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.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
or go install
command, depending on your Go version:
Go version < 1.18
$ go get github.com/apache/mynewt-mcumgr-cli/mcumgr
Go version >= 1.18
$ go install github.com/apache/mynewt-mcumgr-cli/mcumgr@latest
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!