1# DFU support configuration options
2
3# Copyright (c) 2017 Nordic Semiconductor ASA
4# SPDX-License-Identifier: Apache-2.0
5
6#
7# DFU
8#
9
10menuconfig IMG_MANAGER
11	bool "DFU image manager"
12	depends on STREAM_FLASH
13	depends on !MCUBOOT_BOOTLOADER_MODE_RAM_LOAD || RETENTION_BOOTLOADER_INFO_OUTPUT_FUNCTION
14	help
15	  Enable support for managing DFU image.
16
17if IMG_MANAGER
18
19choice
20	prompt "Image manager"
21	default MCUBOOT_IMG_MANAGER
22	help
23	  Choice support for managing DFU image.
24	  So far only mcuboot support is available.
25
26config MCUBOOT_IMG_MANAGER
27	bool "Image manager for mcuboot"
28	depends on FLASH_MAP
29	select MCUBOOT_BOOTUTIL_LIB
30	help
31	  Enable support for managing DFU image downloaded using mcuboot.
32
33endchoice
34
35if MCUBOOT_IMG_MANAGER
36
37config MCUBOOT_SHELL
38	bool "MCUboot shell"
39	depends on SHELL
40	help
41	  Enable shell module, which provides information about image slots and
42	  allows to perform such operations as: confirm, erase and request
43	  upgrade.
44
45config MCUBOOT_TRAILER_SWAP_TYPE
46	bool "use trailer's swap_type field"
47	default y
48	help
49	  Enables usage swap type field which is required after
50	  "Fix double swap on interrupted revert"  mcuboot patch
51	  (https://github.com/JuulLabs-OSS/mcuboot/pull/485)
52	  Disable this option if need to be compatible with earlier version
53	  of MCUBoot.
54
55config MCUBOOT_UPDATE_FOOTER_SIZE
56	hex "Estimated update footer size"
57	default 0x0
58	help
59	  Estimated size of update image data, which is used to prevent loading of firmware updates
60	  that MCUboot cannot update due to being too large. This should be set from sysbuild, only
61	  used when MCUMGR_GRP_IMG_TOO_LARGE_SYSBUILD is enabled.
62
63config IMG_BLOCK_BUF_SIZE
64	int "Image writer buffer size"
65	default 512
66	help
67	  Size (in Bytes) of buffer for image writer. Must be a multiple of
68	  the access alignment required by used flash driver.
69
70config IMG_ERASE_PROGRESSIVELY
71	bool "Erase flash progressively when receiving new firmware"
72	select STREAM_FLASH_ERASE if FLASH_HAS_EXPLICIT_ERASE
73	help
74	  If enabled, flash is erased as necessary when receiving new firmware,
75	  instead of erasing the whole image slot at once. This is necessary
76	  on some hardware that has long erase times, to prevent long wait
77	  times at the beginning of the DFU process.
78
79config IMG_ENABLE_IMAGE_CHECK
80	bool "Image check functions"
81	select FLASH_AREA_CHECK_INTEGRITY
82	help
83	  If enabled, there will be available the function to check flash
84	  integrity.  It can be used to verify flash integrity after received
85	  a new firmware.  This is useful to avoid firmware reboot and test.
86	  Another use is to ensure that firmware upgrade routines from internet
87	  server to flash slot are performing properly.
88
89endif # MCUBOOT_IMG_MANAGER
90
91module = IMG_MANAGER
92module-str = image manager
93source "subsys/logging/Kconfig.template.log_config"
94
95if !MCUBOOT
96config UPDATEABLE_IMAGE_NUMBER
97	int "Number of updateable images"
98	default 1
99	range 1 3
100	help
101	  If value is set to 2 or greater then, this enables support needed when
102	  application is combined with MCUboot multi-image boot.
103endif
104
105endif # IMG_MANAGER
106