You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added description on serial recovery mode features and
its configuration.
Signed-off-by: Andrzej Puzdrowski <[email protected]>
Signed-off-by: Anna Kielar <[email protected]>
Copy file name to clipboardExpand all lines: docs/readme-zephyr.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -209,3 +209,55 @@ swap-using-scratch is used whereby an application has loaded a firmware update
209
209
and marked it as test/confirmed but MCUboot will not swap the images and
210
210
erasing the secondary slot from the zephyr application returns an error
211
211
because the slot is marked for upgrade.
212
+
213
+
## Serial recovery
214
+
215
+
### Interface selection
216
+
217
+
A serial recovery protocol is available over either a hardware serial port or a USB CDC ACM virtual serial port.
218
+
The SMP server implementation can be enabled by the ``CONFIG_MCUBOOT_SERIAL=y`` Kconfig option.
219
+
To set a type of an interface, use the ``BOOT_SERIAL_DEVICE`` Kconfig choice, and select either the ``CONFIG_BOOT_SERIAL_UART`` or the ``CONFIG_BOOT_SERIAL_CDC_ACM`` value.
220
+
Which interface belongs to the protocol shall be set by the devicetree-chosen node:
221
+
-`zephyr,console` - If a hardware serial port is used.
222
+
-`zephyr,cdc-acm-uart` - If a virtual serial port is used.
223
+
224
+
### Entering the serial recovery mode
225
+
226
+
To enter the serial recovery mode, the device has to initiate rebooting, and a triggering event has to occur (for example, pressing a button).
227
+
228
+
By default, the serial recovery GPIO pin active state enters the serial recovery mode.
229
+
Use the ``mcuboot_button0`` devicetree button alias to assign the GPIO pin to the MCUboot.
230
+
231
+
Alternatively, MCUboot can wait for a limited time to check if DFU is invoked by receiving an MCUmgr command.
232
+
Select ``CONFIG_BOOT_SERIAL_WAIT_FOR_DFU=y`` to use this mode. ``CONFIG_BOOT_SERIAL_WAIT_FOR_DFU_TIMEOUT`` option defines
233
+
the amount of time in milliseconds the device will wait for the trigger.
234
+
235
+
### Direct image upload
236
+
237
+
By default, the SMP server implementation will only use the first slot.
238
+
To change it, invoke the `image upload` MCUmgr command with a selected image number, and make sure the ``CONFIG_MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD=y`` Kconfig option is enabled.
239
+
Note that the ``CONFIG_UPDATEABLE_IMAGE_NUMBER`` Kconfig option adjusts the number of image-pairs supported by the MCUboot.
240
+
241
+
The mapping of image number to partition is as follows:
242
+
* 0 and 1 - image-0, the primary slot of the first image.
243
+
* 2 - image-1, the secondary slot of the first image.
244
+
* 3 - image-2.
245
+
* 4 - image-3.
246
+
247
+
0 is a default upload target when no explicit selection is done.
248
+
249
+
### System-specific commands
250
+
251
+
Use the ``CONFIG_ENABLE_MGMT_PERUSER=y`` Kconfig option to enable the following additional commands:
252
+
* Storage erase - This command allows erasing the storage partition (enable with ``CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y``).
253
+
* Custom image list - This command allows fetching version and installation status (custom properties) for all images (enable with ``CONFIG_BOOT_MGMT_CUSTOM_IMG_LIST=y``).
254
+
255
+
### In-place image decryption
256
+
257
+
Images uploaded by the serial recovery can be decrypted on the fly by using ECIES primitives described in the [ECIES encryption](encrypted_images.md#ecies-encryption) section.
258
+
259
+
Enable support for this feature by using ``CONFIG_BOOT_SERIAL_ENCRYPT_EC256=y``.
260
+
261
+
### More configuration
262
+
263
+
For details on other available configuration options for the serial recovery protocol, check the Kconfig options (for example by using ``menuconfig``).
0 commit comments