Skip to content

Commit 8a8d981

Browse files
committed
doc: subsys: Add dfu and mgmt subsytem doc
Add documentation for two closely-related subystems: dfu and mgmt, which are currently undocumented. Signed-off-by: Carles Cufi <[email protected]>
1 parent 81d211f commit 8a8d981

File tree

3 files changed

+115
-0
lines changed

3 files changed

+115
-0
lines changed

doc/subsystems/dfu.rst

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
.. _dfu:
2+
3+
Device Firmware Upgrade Subsystem
4+
#################################
5+
6+
Overview
7+
********
8+
9+
The Device Firmware Upgrade subsystem provides the necessary frameworks to
10+
upgrade the image of a Zephyr-based application at run time. It currently
11+
consists of two different modules:
12+
13+
* :file:`boot/`: Interface code to bootloaders
14+
* :file:`img_util/`: Image management code
15+
16+
The DFU subsystem deals with image management, but not with the transport
17+
or management protocols themselves required to send the image to the target
18+
device. For information on these protocols and frameworks please refer to the
19+
:ref:`mgmt` section.
20+
21+
Bootloaders
22+
***********
23+
24+
.. _mcuboot:
25+
26+
MCUboot
27+
=======
28+
29+
Zephyr is directly compatible with the open source, cross-RTOS `MCUboot`_ boot
30+
loader. It interfaces with MCUboot and is aware of the image format required
31+
by it, so that Device Firmware Upgrade is available when MCUboot is the boot
32+
loader used with Zephyr. The source code itself is hosted in the
33+
`MCUboot GitHub Project`_ page.
34+
35+
In order to use MCUboot with Zephyr you need to take the following into account:
36+
37+
1. You will need to define the :ref:`mcuboot_partitions` required by MCUboot in
38+
the :ref:`flash_partitions`.
39+
2. Your application's :file:`.conf` file needs to enable the
40+
:option:`CONFIG_BOOTLOADER_MCUBOOT` Kconfig option in order for Zephyr to
41+
be built in an MCUboot-compatible manner
42+
3. You need to build and flash MCUboot itself on your device
43+
4. You might need to take precautions to avoid mass erasing the flash and also
44+
to flash the Zephyr application image at the correct offset (right after the
45+
bootloader)
46+
47+
More detailed information regarding the use of MCUboot with Zephyr can be found
48+
in the `MCUboot with Zephyr`_ documentation page on the MCUboot website.
49+
50+
.. _MCUboot with Zephyr: https://mcuboot.com/mcuboot/readme-zephyr.html
51+
.. _MCUboot GitHub Project: https://github.com/runtimeco/mcuboot

doc/subsystems/mgmt.rst

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
.. _mgmt:
2+
3+
Management Subsystem
4+
####################
5+
6+
Overview
7+
********
8+
9+
The management subsystem allows remote management of Zephyr-enabled devices.
10+
The following management operations are available:
11+
12+
* Image management
13+
* File System management
14+
* Log management (currently disabled)
15+
* OS management
16+
17+
over the following transports:
18+
19+
* BLE (Bluetooth Low Energy)
20+
* Serial (UART)
21+
22+
The management subsystem is based on the Simple Management Protocol (SMP)
23+
provided by `MCUmgr`_, an open source project that provides a
24+
management subystem that is portable across multiple real-time operating
25+
systems.
26+
27+
The management subsystem is split in two different locations in the Zephyr tree:
28+
29+
* :file:`ext/lib/mgmt/mcumgr/` contains a clean import of the MCUmgr project
30+
* :file:`subsys/mgmt/` contains the Zephyr-specific bindings to MCUmgr
31+
32+
Additionally there is a :ref:`sample <smp_svr_sample>` that provides management
33+
functionality over BLE and serial.
34+
35+
.. _mcumgr_cli:
36+
37+
Command-line Tool
38+
*****************
39+
40+
MCUmgr provides a command-line tool, :file:`mcumgr`,for managing remote devices.
41+
The tool is written in the Go programming language.
42+
43+
Installation information can be found in the `MCUmgr command-line tool`_
44+
section of the `MCUmgr documentation`_. A full rundown of the necessary commands
45+
to perform Device Firmware Upgrade is located in
46+
`MCUmgr command-line tool examples`_, and a practical step-by-step guide to DFU
47+
using MCUmgr can be found in :ref:`smp_svr_sample`.
48+
49+
Bootloader integration
50+
**********************
51+
52+
The :ref:`dfu` subsystem integrates the management subsystem with the
53+
bootloader, providing the ability to send and upgrade a Zephyr image to a
54+
device.
55+
56+
Currently only the MCUboot bootloader is supported. See :ref:`mcuboot` for more
57+
information.
58+
59+
.. _MCUmgr: https://github.com/apache/mynewt-mcumgr
60+
.. _MCUmgr documentation: https://github.com/apache/mynewt-mcumgr#mcumgr
61+
.. _MCUmgr command-line tool: https://github.com/apache/mynewt-mcumgr#command-line-tool
62+
.. _MCUmgr command-line tool examples: https://github.com/apache/mynewt-mcumgr-cli#examples

doc/subsystems/subsystems.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ to applications.
1111

1212
bluetooth/bluetooth.rst
1313
c_library
14+
dfu
1415
logging/index
16+
mgmt
1517
networking/networking.rst
1618
power_management.rst
1719
sensor

0 commit comments

Comments
 (0)