David Vincze | 03368b8 | 2020-04-01 12:53:53 +0200 | [diff] [blame] | 1 | # Copyright (c) 2017-2020 Linaro Limited |
David Vincze | c308413 | 2020-02-18 14:50:47 +0100 | [diff] [blame] | 2 | # Copyright (c) 2020 Arm Limited |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: Apache-2.0 |
| 5 | # |
| 6 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 7 | mainmenu "MCUboot configuration" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 8 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 9 | comment "MCUboot-specific configuration options" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 10 | |
Emanuele Di Santo | 865777d | 2018-11-08 11:28:15 +0100 | [diff] [blame] | 11 | # Hidden option to mark a project as MCUboot |
| 12 | config MCUBOOT |
| 13 | default y |
| 14 | bool |
Rajavardhan Gundi | 07ba28f | 2018-12-10 15:44:48 +0530 | [diff] [blame] | 15 | select MPU_ALLOW_FLASH_WRITE if ARM_MPU |
Marcin Niestroj | c6be76a | 2020-03-22 14:39:35 +0100 | [diff] [blame] | 16 | select USE_DT_CODE_PARTITION if HAS_FLASH_LOAD_OFFSET |
Andrzej Puzdrowski | f573b39 | 2020-11-10 14:35:15 +0100 | [diff] [blame] | 17 | select MCUBOOT_BOOTUTIL_LIB |
Emanuele Di Santo | 865777d | 2018-11-08 11:28:15 +0100 | [diff] [blame] | 18 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 19 | config BOOT_USE_MBEDTLS |
| 20 | bool |
| 21 | # Hidden option |
| 22 | default n |
| 23 | help |
| 24 | Use mbedTLS for crypto primitives. |
| 25 | |
| 26 | config BOOT_USE_TINYCRYPT |
| 27 | bool |
| 28 | # Hidden option |
| 29 | default n |
Sebastian Bøe | 913a385 | 2019-01-22 13:53:12 +0100 | [diff] [blame] | 30 | # When building for ECDSA, we use our own copy of mbedTLS, so the |
| 31 | # Zephyr one must not be enabled or the MBEDTLS_CONFIG_FILE macros |
| 32 | # will collide. |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 33 | help |
| 34 | Use TinyCrypt for crypto primitives. |
| 35 | |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 36 | config BOOT_USE_CC310 |
| 37 | bool |
| 38 | # Hidden option |
| 39 | default n |
| 40 | # When building for ECDSA, we use our own copy of mbedTLS, so the |
| 41 | # Zephyr one must not be enabled or the MBEDTLS_CONFIG_FILE macros |
| 42 | # will collide. |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 43 | help |
| 44 | Use cc310 for crypto primitives. |
| 45 | |
| 46 | config BOOT_USE_NRF_CC310_BL |
| 47 | bool |
| 48 | default n |
| 49 | |
| 50 | config NRFXLIB_CRYPTO |
| 51 | bool |
| 52 | default n |
| 53 | |
| 54 | config NRF_CC310_BL |
| 55 | bool |
| 56 | default n |
| 57 | |
Andrzej Puzdrowski | 9754328 | 2018-04-12 15:16:56 +0200 | [diff] [blame] | 58 | menu "MCUBoot settings" |
| 59 | |
Andrzej Puzdrowski | fdff3e1 | 2020-09-15 08:23:25 +0200 | [diff] [blame] | 60 | config SINGLE_APPLICATION_SLOT |
| 61 | bool "Single slot bootloader" |
Dominik Ermel | 4dc3f44 | 2020-05-26 08:45:14 +0000 | [diff] [blame] | 62 | default n |
| 63 | help |
| 64 | Single image area is used for application which means that |
| 65 | uploading a new application overwrites the one that previously |
| 66 | occupied the area. |
| 67 | |
Håkon Øye Amundsen | 21f0376 | 2021-11-12 08:21:31 +0000 | [diff] [blame] | 68 | choice BOOT_SIGNATURE_TYPE |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 69 | prompt "Signature type" |
| 70 | default BOOT_SIGNATURE_TYPE_RSA |
| 71 | |
Arvin Farahmand | fb5ec18 | 2020-05-05 11:44:12 -0400 | [diff] [blame] | 72 | config BOOT_SIGNATURE_TYPE_NONE |
| 73 | bool "No signature; use only hash check" |
| 74 | select BOOT_USE_TINYCRYPT |
| 75 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 76 | config BOOT_SIGNATURE_TYPE_RSA |
| 77 | bool "RSA signatures" |
| 78 | select BOOT_USE_MBEDTLS |
Marti Bolivar | a4818a5 | 2018-04-12 13:02:38 -0400 | [diff] [blame] | 79 | select MBEDTLS |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 80 | |
Fabio Utzig | 105b59a | 2019-05-13 15:08:12 -0700 | [diff] [blame] | 81 | if BOOT_SIGNATURE_TYPE_RSA |
| 82 | config BOOT_SIGNATURE_TYPE_RSA_LEN |
| 83 | int "RSA signature length" |
| 84 | range 2048 3072 |
| 85 | default 2048 |
| 86 | endif |
| 87 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 88 | config BOOT_SIGNATURE_TYPE_ECDSA_P256 |
| 89 | bool "Elliptic curve digital signatures with curve P-256" |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 90 | |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 91 | if BOOT_SIGNATURE_TYPE_ECDSA_P256 |
Håkon Øye Amundsen | 21f0376 | 2021-11-12 08:21:31 +0000 | [diff] [blame] | 92 | choice BOOT_ECDSA_IMPLEMENTATION |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 93 | prompt "Ecdsa implementation" |
Fabio Utzig | 34e93a5 | 2020-02-03 09:59:53 -0300 | [diff] [blame] | 94 | default BOOT_ECDSA_TINYCRYPT |
Håkon Øye Amundsen | ee7282d | 2020-09-28 09:48:29 +0000 | [diff] [blame] | 95 | |
Fabio Utzig | 34e93a5 | 2020-02-03 09:59:53 -0300 | [diff] [blame] | 96 | config BOOT_ECDSA_TINYCRYPT |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 97 | bool "Use tinycrypt" |
| 98 | select BOOT_USE_TINYCRYPT |
Håkon Øye Amundsen | ee7282d | 2020-09-28 09:48:29 +0000 | [diff] [blame] | 99 | |
| 100 | config BOOT_ECDSA_CC310 |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 101 | bool "Use CC310" |
Håkon Øye Amundsen | ee7282d | 2020-09-28 09:48:29 +0000 | [diff] [blame] | 102 | depends on HAS_HW_NRF_CC310 |
| 103 | select BOOT_USE_NRF_CC310_BL |
| 104 | select NRF_CC310_BL |
| 105 | select NRFXLIB_CRYPTO |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 106 | select BOOT_USE_CC310 |
Håkon Øye Amundsen | ee7282d | 2020-09-28 09:48:29 +0000 | [diff] [blame] | 107 | endchoice # Ecdsa implementation |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 108 | endif |
Fabio Utzig | 34e93a5 | 2020-02-03 09:59:53 -0300 | [diff] [blame] | 109 | |
| 110 | config BOOT_SIGNATURE_TYPE_ED25519 |
| 111 | bool "Edwards curve digital signatures using ed25519" |
| 112 | |
| 113 | if BOOT_SIGNATURE_TYPE_ED25519 |
Håkon Øye Amundsen | 21f0376 | 2021-11-12 08:21:31 +0000 | [diff] [blame] | 114 | choice BOOT_ED25519_IMPLEMENTATION |
Fabio Utzig | 34e93a5 | 2020-02-03 09:59:53 -0300 | [diff] [blame] | 115 | prompt "Ecdsa implementation" |
| 116 | default BOOT_ED25519_TINYCRYPT |
| 117 | config BOOT_ED25519_TINYCRYPT |
| 118 | bool "Use tinycrypt" |
| 119 | select BOOT_USE_TINYCRYPT |
| 120 | config BOOT_ED25519_MBEDTLS |
| 121 | bool "Use mbedTLS" |
| 122 | select BOOT_USE_MBEDTLS |
| 123 | select MBEDTLS |
| 124 | endchoice |
| 125 | endif |
| 126 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 127 | endchoice |
| 128 | |
Fabio Utzig | c690c76 | 2018-04-26 10:51:09 -0300 | [diff] [blame] | 129 | config BOOT_SIGNATURE_KEY_FILE |
| 130 | string "PEM key file" |
Håkon Øye Amundsen | 705c6c2 | 2020-09-28 09:45:40 +0000 | [diff] [blame] | 131 | default "root-ec-p256.pem" if BOOT_SIGNATURE_TYPE_ECDSA_P256 |
| 132 | default "root-ed25519.pem" if BOOT_SIGNATURE_TYPE_ED25519 |
| 133 | default "root-rsa-3072.pem" if BOOT_SIGNATURE_TYPE_RSA && BOOT_SIGNATURE_TYPE_RSA_LEN=3072 |
| 134 | default "root-rsa-2048.pem" if BOOT_SIGNATURE_TYPE_RSA && BOOT_SIGNATURE_TYPE_RSA_LEN=2048 |
Fabio Utzig | c690c76 | 2018-04-26 10:51:09 -0300 | [diff] [blame] | 135 | default "" |
| 136 | help |
Marek Pieta | bdcfc85 | 2020-08-04 02:22:55 -0700 | [diff] [blame] | 137 | You can use either absolute or relative path. |
| 138 | In case relative path is used, the build system assumes that it starts |
| 139 | from the directory where the MCUBoot KConfig configuration file is |
| 140 | located. If the key file is not there, the build system uses relative |
| 141 | path that starts from the MCUBoot repository root directory. |
Fabio Utzig | c690c76 | 2018-04-26 10:51:09 -0300 | [diff] [blame] | 142 | The key file will be parsed by imgtool's getpub command and a .c source |
| 143 | with the public key information will be written in a format expected by |
| 144 | MCUboot. |
| 145 | |
Andrzej Puzdrowski | 9a605b6 | 2020-03-16 13:34:30 +0100 | [diff] [blame] | 146 | config MCUBOOT_CLEANUP_ARM_CORE |
| 147 | bool "Perform core cleanup before chain-load the application" |
| 148 | depends on CPU_CORTEX_M |
Jamie McCrae | 9e8eddc | 2023-02-27 12:51:09 +0000 | [diff] [blame] | 149 | default y |
Ioannis Glaropoulos | 518d93a | 2020-10-22 14:22:14 +0200 | [diff] [blame] | 150 | help |
| 151 | This option instructs MCUboot to perform a clean-up of a set of |
| 152 | architecture core HW registers before junping to the application |
| 153 | firmware. The clean-up sets these registers to their warm-reset |
| 154 | values as specified by the architecture. |
| 155 | |
Jamie McCrae | 9e8eddc | 2023-02-27 12:51:09 +0000 | [diff] [blame] | 156 | This option is enabled by default to prevent possible problems when |
| 157 | booting zephyr (or other) applications whereby e.g. a MPU stack guard |
| 158 | may be initialised in RAM which is then used by the application |
| 159 | start-up code which can cause a module fault and potentially make the |
| 160 | module irrecoverable. |
Andrzej Puzdrowski | 9a605b6 | 2020-03-16 13:34:30 +0100 | [diff] [blame] | 161 | |
Marti Bolivar | a4818a5 | 2018-04-12 13:02:38 -0400 | [diff] [blame] | 162 | config MBEDTLS_CFG_FILE |
| 163 | default "mcuboot-mbedtls-cfg.h" |
| 164 | |
David Vincze | 03368b8 | 2020-04-01 12:53:53 +0200 | [diff] [blame] | 165 | config BOOT_HW_KEY |
| 166 | bool "Use HW key for image verification" |
| 167 | default n |
| 168 | help |
| 169 | Use HW key for image verification, otherwise the public key is embedded |
| 170 | in MCUBoot. If enabled the public key is appended to the signed image |
| 171 | and requires the hash of the public key to be provisioned to the device |
| 172 | beforehand. |
| 173 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 174 | config BOOT_VALIDATE_SLOT0 |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 175 | bool "Validate image in the primary slot on every boot" |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 176 | default y |
| 177 | help |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 178 | If y, the bootloader attempts to validate the signature of the |
| 179 | primary slot every boot. This adds the signature check time to |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 180 | every boot, but can mitigate against some changes that are |
| 181 | able to modify the flash image itself. |
| 182 | |
Wouter Cappelle | bb7a39d | 2021-05-03 16:44:44 +0200 | [diff] [blame] | 183 | config BOOT_VALIDATE_SLOT0_ONCE |
| 184 | bool "Validate image in the primary slot just once after after upgrade" |
| 185 | depends on !BOOT_VALIDATE_SLOT0 && SINGLE_APPLICATION_SLOT |
| 186 | default n |
| 187 | help |
| 188 | If y, the bootloader attempts to validate the signature of the |
| 189 | primary slot only once after an upgrade of the main slot. |
| 190 | It caches the result in the magic area, which makes it an unsecure |
| 191 | method. This option is usefull for lowering the boot up time for |
| 192 | low end devices with as a compromise lowering the security level. |
| 193 | If unsure, leave at the default value. |
| 194 | |
David Brown | 08a30a4 | 2022-04-26 14:49:51 -0600 | [diff] [blame] | 195 | config BOOT_PREFER_SWAP_MOVE |
| 196 | bool "Prefer the newer swap move algorithm" |
| 197 | default y if SOC_FAMILY_NRF |
Thomas Stranger | aa217e2 | 2022-10-28 21:17:55 +0200 | [diff] [blame] | 198 | default y if !$(dt_nodelabel_enabled,scratch_partition) |
David Brown | 08a30a4 | 2022-04-26 14:49:51 -0600 | [diff] [blame] | 199 | help |
| 200 | If y, the BOOT_IMAGE_UPGRADE_MODE will default to using |
| 201 | "move" instead of "scratch". This is a separate bool config |
| 202 | option, because Kconfig doesn't allow defaults to be |
| 203 | overridden in choice options. Most devices should be using |
| 204 | swap move. |
| 205 | |
Andrzej Puzdrowski | fdff3e1 | 2020-09-15 08:23:25 +0200 | [diff] [blame] | 206 | if !SINGLE_APPLICATION_SLOT |
Håkon Øye Amundsen | 21f0376 | 2021-11-12 08:21:31 +0000 | [diff] [blame] | 207 | choice BOOT_IMAGE_UPGRADE_MODE |
David Vincze | 5a6e181 | 2020-06-29 13:34:42 +0200 | [diff] [blame] | 208 | prompt "Image upgrade modes" |
David Brown | 08a30a4 | 2022-04-26 14:49:51 -0600 | [diff] [blame] | 209 | default BOOT_SWAP_USING_MOVE if BOOT_PREFER_SWAP_MOVE |
David Vincze | 5a6e181 | 2020-06-29 13:34:42 +0200 | [diff] [blame] | 210 | default BOOT_SWAP_USING_SCRATCH |
| 211 | |
| 212 | config BOOT_SWAP_USING_SCRATCH |
| 213 | bool "Swap mode that run with the scratch partition" |
| 214 | help |
| 215 | This is the most conservative swap mode but it can work even on |
| 216 | devices with heterogeneous flash page layout. |
| 217 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 218 | config BOOT_UPGRADE_ONLY |
| 219 | bool "Overwrite image updates instead of swapping" |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 220 | help |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 221 | If y, overwrite the primary slot with the upgrade image instead |
| 222 | of swapping them. This prevents the fallback recovery, but |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 223 | uses a much simpler code path. |
| 224 | |
Fabio Utzig | c58842e | 2019-11-28 10:30:01 -0300 | [diff] [blame] | 225 | config BOOT_SWAP_USING_MOVE |
Fabio Utzig | dd2b680 | 2020-01-06 09:10:45 -0300 | [diff] [blame] | 226 | bool "Swap mode that can run without a scratch partition" |
Fabio Utzig | c58842e | 2019-11-28 10:30:01 -0300 | [diff] [blame] | 227 | help |
| 228 | If y, the swap upgrade is done in two steps, where first every |
| 229 | sector of the primary slot is moved up one sector, then for |
| 230 | each sector X in the secondary slot, it is moved to index X in |
| 231 | the primary slot, then the sector at X+1 in the primary is |
| 232 | moved to index X in the secondary. |
| 233 | This allows a swap upgrade without using a scratch partition, |
| 234 | but is currently limited to all sectors in both slots being of |
| 235 | the same size. |
David Vincze | 5a6e181 | 2020-06-29 13:34:42 +0200 | [diff] [blame] | 236 | |
| 237 | config BOOT_DIRECT_XIP |
| 238 | bool "Run the latest image directly from its slot" |
| 239 | help |
| 240 | If y, mcuboot selects the newest valid image based on the image version |
| 241 | numbers, thereafter the selected image can run directly from its slot |
| 242 | without having to move/copy it into the primary slot. For this reason the |
| 243 | images must be linked to be executed from the given image slot. Using this |
| 244 | mode results in a simpler code path and smaller code size. |
| 245 | |
Johan Öhman | b588907 | 2022-04-01 09:10:28 +0200 | [diff] [blame] | 246 | config BOOT_RAM_LOAD |
| 247 | bool "RAM load" |
| 248 | help |
| 249 | If y, mcuboot selects the newest valid image based on the image version |
| 250 | numbers, thereafter the selected image is copied to RAM and executed from |
| 251 | there. For this reason, the image has to be linked to be executed from RAM. |
| 252 | The address that the image is copied to is specified using the load-addr |
| 253 | argument to the imgtool.py script which writes it to the image header. |
| 254 | |
David Vincze | 5a6e181 | 2020-06-29 13:34:42 +0200 | [diff] [blame] | 255 | endchoice |
Fabio Utzig | c58842e | 2019-11-28 10:30:01 -0300 | [diff] [blame] | 256 | |
Johan Öhman | b588907 | 2022-04-01 09:10:28 +0200 | [diff] [blame] | 257 | # Workaround for not being able to have commas in macro arguments |
| 258 | DT_CHOSEN_Z_SRAM := zephyr,sram |
| 259 | |
| 260 | if BOOT_RAM_LOAD |
| 261 | config BOOT_IMAGE_EXECUTABLE_RAM_START |
| 262 | hex "Boot image executable ram start" |
| 263 | default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_SRAM)) |
| 264 | |
| 265 | config BOOT_IMAGE_EXECUTABLE_RAM_SIZE |
| 266 | int "Boot image executable base size" |
| 267 | default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM),0) |
| 268 | endif |
| 269 | |
David Vincze | 505fba2 | 2020-10-22 13:53:29 +0200 | [diff] [blame] | 270 | config BOOT_DIRECT_XIP_REVERT |
| 271 | bool "Enable the revert mechanism in direct-xip mode" |
Andrzej Puzdrowski | 32342e7 | 2020-11-18 17:04:44 +0100 | [diff] [blame] | 272 | depends on BOOT_DIRECT_XIP |
David Vincze | 505fba2 | 2020-10-22 13:53:29 +0200 | [diff] [blame] | 273 | default n |
| 274 | help |
| 275 | If y, enables the revert mechanism in direct-xip similar to the one in |
| 276 | swap mode. It requires the trailer magic to be added to the signed image. |
| 277 | When a reboot happens without the image being confirmed at runtime, the |
| 278 | bootloader considers the image faulty and erases it. After this it will |
| 279 | attempt to boot the previous image. The images can also be made permanent |
| 280 | (marked as confirmed in advance) just like in swap mode. |
| 281 | |
Fabio Utzig | d0533ed | 2018-12-19 07:56:33 -0200 | [diff] [blame] | 282 | config BOOT_BOOTSTRAP |
Sam Bristow | d0ca0ff | 2019-10-30 20:51:35 +1300 | [diff] [blame] | 283 | bool "Bootstrap erased the primary slot from the secondary slot" |
Fabio Utzig | d0533ed | 2018-12-19 07:56:33 -0200 | [diff] [blame] | 284 | default n |
| 285 | help |
| 286 | If y, enables bootstraping support. Bootstrapping allows an erased |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 287 | primary slot to be initialized from a valid image in the secondary slot. |
Fabio Utzig | d0533ed | 2018-12-19 07:56:33 -0200 | [diff] [blame] | 288 | If unsure, leave at the default value. |
| 289 | |
Fabio Utzig | ca8ead2 | 2019-12-20 07:06:04 -0300 | [diff] [blame] | 290 | config BOOT_SWAP_SAVE_ENCTLV |
| 291 | bool "Save encrypted key TLVs instead of plaintext keys in swap metadata" |
| 292 | default n |
| 293 | help |
| 294 | If y, instead of saving the encrypted image keys in plaintext in the |
| 295 | swap resume metadata, save the encrypted image TLVs. This should be used |
| 296 | when there is no security mechanism protecting the data in the primary |
| 297 | slot from being dumped. If n is selected (default), the keys are written |
| 298 | after being decrypted from the image TLVs and could be read by an |
| 299 | attacker who has access to the flash contents of the primary slot (eg |
| 300 | JTAG/SWD or primary slot in external flash). |
| 301 | If unsure, leave at the default value. |
| 302 | |
Håkon Øye Amundsen | e829e9d | 2021-11-12 14:01:01 +0000 | [diff] [blame] | 303 | config BOOT_ENCRYPT_IMAGE |
| 304 | bool |
| 305 | help |
| 306 | Hidden option used to check if any image encryption is enabled. |
| 307 | |
Fabio Utzig | 5fe874c | 2018-08-31 07:41:50 -0300 | [diff] [blame] | 308 | config BOOT_ENCRYPT_RSA |
Fabio Utzig | 42cc29a | 2019-11-05 07:54:41 -0300 | [diff] [blame] | 309 | bool "Support for encrypted upgrade images using RSA" |
Håkon Øye Amundsen | e829e9d | 2021-11-12 14:01:01 +0000 | [diff] [blame] | 310 | select BOOT_ENCRYPT_IMAGE |
Fabio Utzig | 5fe874c | 2018-08-31 07:41:50 -0300 | [diff] [blame] | 311 | help |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 312 | If y, images in the secondary slot can be encrypted and are decrypted |
| 313 | on the fly when upgrading to the primary slot, as well as encrypted |
Fabio Utzig | 42cc29a | 2019-11-05 07:54:41 -0300 | [diff] [blame] | 314 | back when swapping from the primary slot to the secondary slot. The |
| 315 | encryption mechanism used in this case is RSA-OAEP (2048 bits). |
| 316 | |
| 317 | config BOOT_ENCRYPT_EC256 |
| 318 | bool "Support for encrypted upgrade images using ECIES-P256" |
Håkon Øye Amundsen | e829e9d | 2021-11-12 14:01:01 +0000 | [diff] [blame] | 319 | select BOOT_ENCRYPT_IMAGE |
Fabio Utzig | 42cc29a | 2019-11-05 07:54:41 -0300 | [diff] [blame] | 320 | help |
| 321 | If y, images in the secondary slot can be encrypted and are decrypted |
| 322 | on the fly when upgrading to the primary slot, as well as encrypted |
| 323 | back when swapping from the primary slot to the secondary slot. The |
| 324 | encryption mechanism used in this case is ECIES using primitives |
| 325 | described under "ECIES-P256 encryption" in docs/encrypted_images.md. |
Fabio Utzig | 5fe874c | 2018-08-31 07:41:50 -0300 | [diff] [blame] | 326 | |
Fabio Utzig | b6f014c | 2020-04-02 13:25:01 -0300 | [diff] [blame] | 327 | config BOOT_ENCRYPT_X25519 |
| 328 | bool "Support for encrypted upgrade images using ECIES-X25519" |
Håkon Øye Amundsen | e829e9d | 2021-11-12 14:01:01 +0000 | [diff] [blame] | 329 | select BOOT_ENCRYPT_IMAGE |
Fabio Utzig | b6f014c | 2020-04-02 13:25:01 -0300 | [diff] [blame] | 330 | help |
| 331 | If y, images in the secondary slot can be encrypted and are decrypted |
| 332 | on the fly when upgrading to the primary slot, as well as encrypted |
| 333 | back when swapping from the primary slot to the secondary slot. The |
| 334 | encryption mechanism used in this case is ECIES using primitives |
| 335 | described under "ECIES-X25519 encryption" in docs/encrypted_images.md. |
David Vincze | 505fba2 | 2020-10-22 13:53:29 +0200 | [diff] [blame] | 336 | endif # !SINGLE_APPLICATION_SLOT |
Fabio Utzig | b6f014c | 2020-04-02 13:25:01 -0300 | [diff] [blame] | 337 | |
Wouter Cappelle | 953a761 | 2021-05-03 16:53:05 +0200 | [diff] [blame] | 338 | config BOOT_ENCRYPTION_KEY_FILE |
| 339 | string "encryption key file" |
| 340 | depends on BOOT_ENCRYPT_EC256 || BOOT_SERIAL_ENCRYPT_EC256 |
| 341 | default "enc-ec256-priv.pem" if BOOT_SIGNATURE_TYPE_ECDSA_P256 |
| 342 | default "" |
| 343 | help |
| 344 | You can use either absolute or relative path. |
| 345 | In case relative path is used, the build system assumes that it starts |
| 346 | from the directory where the MCUBoot KConfig configuration file is |
| 347 | located. If the key file is not there, the build system uses relative |
| 348 | path that starts from the MCUBoot repository root directory. |
| 349 | The key file will be parsed by imgtool's getpriv command and a .c source |
| 350 | with the public key information will be written in a format expected by |
| 351 | MCUboot. |
| 352 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 353 | config BOOT_MAX_IMG_SECTORS |
| 354 | int "Maximum number of sectors per image slot" |
| 355 | default 128 |
| 356 | help |
| 357 | This option controls the maximum number of sectors that each of |
| 358 | the two image areas can contain. Smaller values reduce MCUboot's |
| 359 | memory usage; larger values allow it to support larger images. |
| 360 | If unsure, leave at the default value. |
| 361 | |
David Vincze | 1cf11b5 | 2020-03-24 07:51:09 +0100 | [diff] [blame] | 362 | config MEASURED_BOOT |
| 363 | bool "Store the boot state/measurements in shared memory" |
| 364 | default n |
| 365 | help |
| 366 | If enabled, the bootloader will store certain boot measurements such as |
| 367 | the hash of the firmware image in a shared memory area. This data can |
| 368 | be used later by runtime services (e.g. by a device attestation service). |
| 369 | |
| 370 | config BOOT_SHARE_DATA |
| 371 | bool "Save application specific data in shared memory area" |
| 372 | default n |
| 373 | |
Håkon Øye Amundsen | 21f0376 | 2021-11-12 08:21:31 +0000 | [diff] [blame] | 374 | choice BOOT_FAULT_INJECTION_HARDENING_PROFILE |
Tamas Ban | fce8733 | 2020-07-10 12:40:11 +0100 | [diff] [blame] | 375 | prompt "Fault injection hardening profile" |
| 376 | default BOOT_FIH_PROFILE_OFF |
| 377 | |
| 378 | config BOOT_FIH_PROFILE_OFF |
| 379 | bool "No hardening against hardware level fault injection" |
| 380 | help |
| 381 | No hardening in SW against hardware level fault injection: power or |
| 382 | clock glitching, etc. |
| 383 | |
| 384 | config BOOT_FIH_PROFILE_LOW |
| 385 | bool "Moderate level hardening against hardware level fault injection" |
| 386 | help |
| 387 | Moderate level hardening: Long global fail loop to avoid break out, |
| 388 | control flow integrity check to discover discrepancy in expected code |
| 389 | flow. |
| 390 | |
| 391 | config BOOT_FIH_PROFILE_MEDIUM |
| 392 | bool "Medium level hardening against hardware level fault injection" |
| 393 | help |
| 394 | Medium level hardening: Long global fail loop to avoid break out, |
| 395 | control flow integrity check to discover discrepancy in expected code |
| 396 | flow, double variables to discover register or memory corruption. |
| 397 | |
| 398 | config BOOT_FIH_PROFILE_HIGH |
| 399 | bool "Maximum level hardening against hardware level fault injection" |
| 400 | select MBEDTLS |
| 401 | help |
| 402 | Maximum level hardening: Long global fail loop to avoid break out, |
| 403 | control flow integrity check to discover discrepancy in expected code |
| 404 | flow, double variables to discover register or memory corruption, random |
| 405 | delays to make code execution less predictable. Random delays requires an |
| 406 | entropy source. |
| 407 | |
| 408 | endchoice |
| 409 | |
Josh Gao | 837cf88 | 2020-11-13 18:51:27 -0800 | [diff] [blame] | 410 | choice BOOT_USB_DFU |
| 411 | prompt "USB DFU" |
| 412 | default BOOT_USB_DFU_NO |
| 413 | |
| 414 | config BOOT_USB_DFU_NO |
| 415 | prompt "Disabled" |
| 416 | |
| 417 | config BOOT_USB_DFU_WAIT |
Rajavardhan Gundi | 51c9d70 | 2019-02-20 14:08:52 +0530 | [diff] [blame] | 418 | bool "Wait for a prescribed duration to see if USB DFU is invoked" |
Johann Fischer | 2585297 | 2021-08-02 13:20:09 +0200 | [diff] [blame] | 419 | select USB_DEVICE_STACK |
Rajavardhan Gundi | 51c9d70 | 2019-02-20 14:08:52 +0530 | [diff] [blame] | 420 | select USB_DFU_CLASS |
| 421 | select IMG_MANAGER |
Dominik Ermel | 143485e | 2023-03-17 11:33:42 +0000 | [diff] [blame] | 422 | select STREAM_FLASH |
| 423 | select MULTITHREADING |
Rajavardhan Gundi | 51c9d70 | 2019-02-20 14:08:52 +0530 | [diff] [blame] | 424 | help |
| 425 | If y, MCUboot waits for a prescribed duration of time to allow |
| 426 | for USB DFU to be invoked. Please note DFU always updates the |
| 427 | slot1 image. |
| 428 | |
Josh Gao | 837cf88 | 2020-11-13 18:51:27 -0800 | [diff] [blame] | 429 | config BOOT_USB_DFU_GPIO |
| 430 | bool "Use GPIO to detect whether to trigger DFU mode" |
Johann Fischer | 2585297 | 2021-08-02 13:20:09 +0200 | [diff] [blame] | 431 | select USB_DEVICE_STACK |
Josh Gao | 837cf88 | 2020-11-13 18:51:27 -0800 | [diff] [blame] | 432 | select USB_DFU_CLASS |
| 433 | select IMG_MANAGER |
Dominik Ermel | 143485e | 2023-03-17 11:33:42 +0000 | [diff] [blame] | 434 | select STREAM_FLASH |
| 435 | select MULTITHREADING |
Josh Gao | 837cf88 | 2020-11-13 18:51:27 -0800 | [diff] [blame] | 436 | help |
| 437 | If y, MCUboot uses GPIO to detect whether to invoke USB DFU. |
| 438 | |
| 439 | endchoice |
| 440 | |
| 441 | config BOOT_USB_DFU_WAIT_DELAY_MS |
| 442 | int "USB DFU wait duration" |
| 443 | depends on BOOT_USB_DFU_WAIT |
| 444 | default 12000 |
| 445 | help |
| 446 | Milliseconds to wait for USB DFU to be invoked. |
| 447 | |
| 448 | if BOOT_USB_DFU_GPIO |
| 449 | |
Josh Gao | 837cf88 | 2020-11-13 18:51:27 -0800 | [diff] [blame] | 450 | config BOOT_USB_DFU_DETECT_DELAY |
| 451 | int "Serial detect pin detection delay time [ms]" |
| 452 | default 0 |
| 453 | help |
| 454 | Used to prevent the bootloader from loading on button press. |
| 455 | Useful for powering on when using the same button as |
| 456 | the one used to place the device in bootloader mode. |
| 457 | |
| 458 | endif # BOOT_USB_DFU_GPIO |
| 459 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 460 | config ZEPHYR_TRY_MASS_ERASE |
Jamie McCrae | 9315654 | 2023-01-11 09:33:45 +0000 | [diff] [blame] | 461 | bool "Try to mass erase flash when flashing MCUboot image (DEPRECATED)" |
| 462 | select DEPRECATED |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 463 | help |
| 464 | If y, attempt to configure the Zephyr build system's "flash" |
| 465 | target to mass-erase the flash device before flashing the |
| 466 | MCUboot image. This ensures the scratch and other partitions |
| 467 | are in a consistent state. |
| 468 | |
| 469 | This is not available for all targets. |
| 470 | |
Jamie McCrae | 9315654 | 2023-01-11 09:33:45 +0000 | [diff] [blame] | 471 | This option has been deprecated, to perform a mass erase when |
| 472 | flashing a board, `west flash --erase` should be used instead. |
| 473 | |
David Brown | f6d14c2 | 2019-12-10 15:36:36 -0700 | [diff] [blame] | 474 | config BOOT_USE_BENCH |
| 475 | bool "Enable benchmark code" |
| 476 | default n |
| 477 | help |
| 478 | If y, adds support for simple benchmarking that can record |
| 479 | time intervals between two calls. The time printed depends |
| 480 | on the particular Zephyr target, and is generally ticks of a |
| 481 | specific board-specific timer. |
| 482 | |
Michael Scott | 74ceae5 | 2019-02-01 14:01:09 -0800 | [diff] [blame] | 483 | module = MCUBOOT |
Piotr Mienkowski | 15aa6ef | 2019-04-08 22:48:15 +0200 | [diff] [blame] | 484 | module-str = MCUBoot bootloader |
Michael Scott | 74ceae5 | 2019-02-01 14:01:09 -0800 | [diff] [blame] | 485 | source "subsys/logging/Kconfig.template.log_config" |
Michael Scott | 74ceae5 | 2019-02-01 14:01:09 -0800 | [diff] [blame] | 486 | |
Andrzej Puzdrowski | af14853 | 2020-02-25 12:51:26 +0100 | [diff] [blame] | 487 | config MCUBOOT_LOG_THREAD_STACK_SIZE |
| 488 | int "Stack size for the MCUBoot log processing thread" |
| 489 | depends on LOG && !LOG_IMMEDIATE |
| 490 | default 2048 if COVERAGE_GCOV |
| 491 | default 1024 if NO_OPTIMIZATIONS |
| 492 | default 1024 if XTENSA |
| 493 | default 4096 if (X86 && X86_64) |
| 494 | default 4096 if ARM64 |
| 495 | default 768 |
| 496 | help |
| 497 | Set the internal stack size for MCUBoot log processing thread. |
| 498 | |
Andrzej Puzdrowski | 6c00b5e | 2022-04-01 16:51:27 +0200 | [diff] [blame] | 499 | config MCUBOOT_INDICATION_LED |
| 500 | bool "Turns on LED indication when device is in DFU" |
| 501 | default n |
| 502 | help |
| 503 | Device device activates the LED while in bootloader mode. |
| 504 | bootloader-led0 alias must be set in the device's .dts |
| 505 | definitions for this to work. |
| 506 | |
Andrzej Puzdrowski | 35f61d3 | 2022-04-01 17:00:08 +0200 | [diff] [blame] | 507 | rsource "Kconfig.serial_recovery" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 508 | |
Rafał Kuźnia | d854bb6 | 2020-06-17 15:06:47 +0200 | [diff] [blame] | 509 | config BOOT_INTR_VEC_RELOC |
| 510 | bool "Relocate the interrupt vector to the application" |
| 511 | default n |
| 512 | depends on SW_VECTOR_RELAY || CPU_CORTEX_M_HAS_VTOR |
| 513 | help |
| 514 | Relocate the interrupt vector to the application before it is started. |
| 515 | Select this option if application requires vector relocation, |
| 516 | but it doesn't relocate vector in its reset handler. |
| 517 | |
Andrzej Puzdrowski | 16b6d15 | 2020-06-01 14:16:54 +0200 | [diff] [blame] | 518 | config UPDATEABLE_IMAGE_NUMBER |
| 519 | int "Number of updateable images" |
| 520 | default 1 |
Andrzej Puzdrowski | fdff3e1 | 2020-09-15 08:23:25 +0200 | [diff] [blame] | 521 | range 1 1 if SINGLE_APPLICATION_SLOT |
Andrzej Puzdrowski | 16b6d15 | 2020-06-01 14:16:54 +0200 | [diff] [blame] | 522 | help |
| 523 | Enables support of multi image update. |
| 524 | |
Marek Pieta | a95a41b | 2023-04-21 14:03:19 +0200 | [diff] [blame^] | 525 | config BOOT_VERSION_CMP_USE_BUILD_NUMBER |
| 526 | bool "Use build number while comparing image version" |
| 527 | depends on (UPDATEABLE_IMAGE_NUMBER > 1) || BOOT_DIRECT_XIP || \ |
| 528 | BOOT_RAM_LOAD || MCUBOOT_DOWNGRADE_PREVENTION |
| 529 | help |
| 530 | By default, the image version comparison relies only on version major, |
| 531 | minor and revision. Enable this option to take into account the build |
| 532 | number as well. |
| 533 | |
Håkon Øye Amundsen | 21f0376 | 2021-11-12 08:21:31 +0000 | [diff] [blame] | 534 | choice BOOT_DOWNGRADE_PREVENTION_CHOICE |
Andrzej Puzdrowski | 16b6d15 | 2020-06-01 14:16:54 +0200 | [diff] [blame] | 535 | prompt "Downgrade prevention" |
| 536 | optional |
| 537 | |
| 538 | config MCUBOOT_DOWNGRADE_PREVENTION |
| 539 | bool "SW based downgrade prevention" |
Jerzy Kasenberg | b8801fc | 2022-06-29 15:54:37 +0200 | [diff] [blame] | 540 | depends on !BOOT_DIRECT_XIP |
Andrzej Puzdrowski | 16b6d15 | 2020-06-01 14:16:54 +0200 | [diff] [blame] | 541 | help |
| 542 | Prevent downgrades by enforcing incrementing version numbers. |
| 543 | When this option is set, any upgrade must have greater major version |
| 544 | or greater minor version with equal major version. This mechanism |
| 545 | only protects against some attacks against version downgrades (for |
| 546 | example, a JTAG could be used to write an older version). |
| 547 | |
Jerzy Kasenberg | b8801fc | 2022-06-29 15:54:37 +0200 | [diff] [blame] | 548 | config MCUBOOT_DOWNGRADE_PREVENTION_SECURITY_COUNTER |
| 549 | bool "Use image security counter instead of version number" |
| 550 | depends on MCUBOOT_DOWNGRADE_PREVENTION |
| 551 | depends on (BOOT_SWAP_USING_MOVE || BOOT_SWAP_USING_SCRATCH) |
| 552 | help |
| 553 | Security counter is used for version eligibility check instead of pure |
| 554 | version. When this option is set, any upgrade must have greater or |
| 555 | equal security counter value. |
| 556 | Because of the acceptance of equal values it allows for software |
| 557 | downgrades to some extent. |
| 558 | |
Andrzej Puzdrowski | 16b6d15 | 2020-06-01 14:16:54 +0200 | [diff] [blame] | 559 | config MCUBOOT_HW_DOWNGRADE_PREVENTION |
| 560 | bool "HW based downgrade prevention" |
| 561 | help |
| 562 | Prevent undesirable/malicious software downgrades. When this option is |
| 563 | set, any upgrade must have greater or equal security counter value. |
| 564 | Because of the acceptance of equal values it allows for software |
| 565 | downgrade to some extent. |
| 566 | |
| 567 | endchoice |
| 568 | |
Andrzej Puzdrowski | d21442a | 2020-10-12 16:47:28 +0200 | [diff] [blame] | 569 | config BOOT_WATCHDOG_FEED |
| 570 | bool "Feed the watchdog while doing swap" |
Andrzej Puzdrowski | b25ba4b | 2022-09-28 15:58:19 +0200 | [diff] [blame] | 571 | default y if WATCHDOG |
| 572 | default y if SOC_FAMILY_NRF |
| 573 | # for nRF nrfx based implementation is available |
Bartosz Bilas | a1c8c8e | 2022-08-30 21:50:28 +0200 | [diff] [blame] | 574 | imply NRFX_WDT if SOC_FAMILY_NRF |
| 575 | imply NRFX_WDT0 if SOC_FAMILY_NRF |
| 576 | imply NRFX_WDT1 if SOC_FAMILY_NRF |
Andrzej Puzdrowski | d21442a | 2020-10-12 16:47:28 +0200 | [diff] [blame] | 577 | help |
| 578 | Enables implementation of MCUBOOT_WATCHDOG_FEED() macro which is |
| 579 | used to feed watchdog while doing time consuming operations. |
| 580 | |
Andrzej Puzdrowski | 914204d | 2021-07-09 19:20:46 +0200 | [diff] [blame] | 581 | config BOOT_IMAGE_ACCESS_HOOKS |
| 582 | bool "Enable hooks for overriding MCUboot's native routines" |
| 583 | help |
| 584 | Allow to provide procedures for override or extend native |
| 585 | MCUboot's routines required for access the image data and the image |
Andrzej Puzdrowski | 1c150c6 | 2022-07-07 14:55:22 +0200 | [diff] [blame] | 586 | update. It is up to the project customization to add required source |
| 587 | files to the build. |
Andrzej Puzdrowski | 914204d | 2021-07-09 19:20:46 +0200 | [diff] [blame] | 588 | |
Jamie McCrae | 56cb610 | 2022-03-23 11:57:03 +0000 | [diff] [blame] | 589 | config MCUBOOT_ACTION_HOOKS |
| 590 | bool "Enable hooks for responding to MCUboot status changes" |
| 591 | help |
| 592 | This will call a handler when the MCUboot status changes which allows |
| 593 | for some level of user feedback, for instance to change LED status to |
| 594 | indicate a failure, using the callback: |
| 595 | 'void mcuboot_status_change(mcuboot_status_type_t status)' where |
| 596 | 'mcuboot_status_type_t' is listed in |
| 597 | boot/bootutil/include/bootutil/mcuboot_status.h |
| 598 | |
Andrzej Puzdrowski | 9754328 | 2018-04-12 15:16:56 +0200 | [diff] [blame] | 599 | endmenu |
| 600 | |
Carles Cufi | 84ede58 | 2018-01-29 15:12:00 +0100 | [diff] [blame] | 601 | config MCUBOOT_DEVICE_SETTINGS |
| 602 | # Hidden selector for device-specific settings |
| 603 | bool |
| 604 | default y |
| 605 | # CPU options |
| 606 | select MCUBOOT_DEVICE_CPU_CORTEX_M0 if CPU_CORTEX_M0 |
Carles Cufi | 67c792e | 2018-01-29 15:14:31 +0100 | [diff] [blame] | 607 | # Enable flash page layout if available |
| 608 | select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT |
Andrzej Puzdrowski | b788c71 | 2018-04-12 12:42:49 +0200 | [diff] [blame] | 609 | # Enable flash_map module as flash I/O back-end |
| 610 | select FLASH_MAP |
Carles Cufi | 84ede58 | 2018-01-29 15:12:00 +0100 | [diff] [blame] | 611 | |
| 612 | config MCUBOOT_DEVICE_CPU_CORTEX_M0 |
| 613 | # Hidden selector for Cortex-M0 settings |
| 614 | bool |
| 615 | default n |
| 616 | select SW_VECTOR_RELAY if !CPU_CORTEX_M0_HAS_VECTOR_TABLE_REMAP |
| 617 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 618 | comment "Zephyr configuration options" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 619 | |
Marti Bolivar | f84cc4b | 2019-08-20 16:06:56 -0700 | [diff] [blame] | 620 | # Disabling MULTITHREADING provides a code size advantage, but |
| 621 | # it requires peripheral drivers (particularly a flash driver) |
| 622 | # that works properly with the option enabled. |
| 623 | # |
| 624 | # If you know for sure that your hardware will work, you can default |
| 625 | # it to n here. Otherwise, having it on by default makes the most |
| 626 | # hardware work. |
| 627 | config MULTITHREADING |
Andrzej Puzdrowski | 9a4946c | 2020-02-20 12:39:12 +0100 | [diff] [blame] | 628 | default y if BOOT_SERIAL_CDC_ACM #usb driver requires MULTITHREADING |
Josh Gao | 837cf88 | 2020-11-13 18:51:27 -0800 | [diff] [blame] | 629 | default y if BOOT_USB_DFU_GPIO || BOOT_USB_DFU_WAIT |
Marti Bolivar | f84cc4b | 2019-08-20 16:06:56 -0700 | [diff] [blame] | 630 | default n if SOC_FAMILY_NRF |
| 631 | default y |
| 632 | |
Andrzej Puzdrowski | 3f092bd | 2020-02-17 13:25:32 +0100 | [diff] [blame] | 633 | config LOG_PROCESS_THREAD |
| 634 | default n # mcuboot has its own log processing thread |
| 635 | |
| 636 | # override USB device name |
| 637 | config USB_DEVICE_PRODUCT |
| 638 | default "MCUBOOT" |
Andrzej Puzdrowski | 9a4946c | 2020-02-20 12:39:12 +0100 | [diff] [blame] | 639 | |
Andrzej Puzdrowski | f573b39 | 2020-11-10 14:35:15 +0100 | [diff] [blame] | 640 | # use MCUboot's own log configuration |
| 641 | config MCUBOOT_BOOTUTIL_LIB_OWN_LOG |
| 642 | bool |
| 643 | default n |
| 644 | |
Håkon Øye Amundsen | e829e9d | 2021-11-12 14:01:01 +0000 | [diff] [blame] | 645 | config MCUBOOT_VERIFY_IMG_ADDRESS |
| 646 | bool "Verify reset address of image in secondary slot" |
| 647 | depends on UPDATEABLE_IMAGE_NUMBER > 1 |
| 648 | depends on !BOOT_ENCRYPT_IMAGE |
| 649 | depends on ARM |
| 650 | default y if BOOT_UPGRADE_ONLY |
| 651 | help |
| 652 | Verify that the reset address in the image located in the secondary slot |
| 653 | is contained within the corresponding primary slot. This is recommended |
| 654 | if swapping is not used (that is, BOOT_UPGRADE_ONLY is set). If a user |
| 655 | incorrectly uploads an update for image 1 to image 0's secondary slot |
| 656 | MCUboot will overwrite image 0's primary slot with this image even |
| 657 | though it will not boot. If swapping is enabled this will be handled |
| 658 | since the image will not confirm itself. If, however, swapping is not |
| 659 | enabled then the only mitigation is serial recovery. This feature can |
| 660 | also be useful when BOOT_DIRECT_XIP is enabled, to ensure that the image |
| 661 | linked at the correct address is loaded. |
| 662 | |
Robert Lubos | 1b19d2a | 2020-01-31 14:05:35 +0100 | [diff] [blame] | 663 | source "Kconfig.zephyr" |