blob: 49627e00101a2397c2641a2931cac5bd42c3d645 [file] [log] [blame]
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +02001# Copyright (c) 2017 Linaro Limited
2#
3# SPDX-License-Identifier: Apache-2.0
4#
5
Marti Bolivar0e091c92018-04-12 11:23:16 -04006mainmenu "MCUboot configuration"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +02007
Marti Bolivar0e091c92018-04-12 11:23:16 -04008comment "MCUboot-specific configuration options"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +02009
Emanuele Di Santo865777d2018-11-08 11:28:15 +010010# Hidden option to mark a project as MCUboot
11config MCUBOOT
12 default y
13 bool
14
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040015config BOOT_USE_MBEDTLS
16 bool
17 # Hidden option
18 default n
19 help
20 Use mbedTLS for crypto primitives.
21
22config BOOT_USE_TINYCRYPT
23 bool
24 # Hidden option
25 default n
26 help
27 Use TinyCrypt for crypto primitives.
28
Andrzej Puzdrowski97543282018-04-12 15:16:56 +020029menu "MCUBoot settings"
30
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040031choice
32 prompt "Signature type"
33 default BOOT_SIGNATURE_TYPE_RSA
34
35config BOOT_SIGNATURE_TYPE_RSA
36 bool "RSA signatures"
37 select BOOT_USE_MBEDTLS
Marti Bolivara4818a52018-04-12 13:02:38 -040038 select MBEDTLS
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040039
40config BOOT_SIGNATURE_TYPE_ECDSA_P256
41 bool "Elliptic curve digital signatures with curve P-256"
42 select BOOT_USE_TINYCRYPT
43
44endchoice
45
Fabio Utzigc690c762018-04-26 10:51:09 -030046config BOOT_SIGNATURE_KEY_FILE
47 string "PEM key file"
48 default ""
49 help
50 The key file will be parsed by imgtool's getpub command and a .c source
51 with the public key information will be written in a format expected by
52 MCUboot.
53
Marti Bolivara4818a52018-04-12 13:02:38 -040054config MBEDTLS_CFG_FILE
55 default "mcuboot-mbedtls-cfg.h"
56
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040057config BOOT_VALIDATE_SLOT0
58 bool "Validate image slot 0 on every boot"
59 default y
60 help
61 If y, the bootloader attempts to validate the signature of
62 slot0 every boot. This adds the signature check time to
63 every boot, but can mitigate against some changes that are
64 able to modify the flash image itself.
65
66config BOOT_UPGRADE_ONLY
67 bool "Overwrite image updates instead of swapping"
68 default n
69 help
70 If y, overwrite slot0 with the upgrade image instead of
71 swapping them. This prevents the fallback recovery, but
72 uses a much simpler code path.
73
Fabio Utzig5fe874c2018-08-31 07:41:50 -030074config BOOT_ENCRYPT_RSA
75 bool "Support for encrypted upgrade images"
76 default n
77 help
78 If y, images in slot 1 can be encrypted and are decrypted
79 on the fly when upgrading to slot 0, as well as encrypted
80 back when swapping from slot 0 to slot 1.
81
Marti Bolivar0e091c92018-04-12 11:23:16 -040082config BOOT_MAX_IMG_SECTORS
83 int "Maximum number of sectors per image slot"
84 default 128
85 help
86 This option controls the maximum number of sectors that each of
87 the two image areas can contain. Smaller values reduce MCUboot's
88 memory usage; larger values allow it to support larger images.
89 If unsure, leave at the default value.
90
Emanuele Di Santo205c8c62018-07-20 11:42:31 +020091config BOOT_ERASE_PROGRESSIVELY
92 bool "Erase flash progressively when receiving new firmware"
93 default y if SOC_NRF52840
94 help
95 If enabled, flash is erased as necessary when receiving new firmware,
96 instead of erasing the whole image slot at once. This is necessary
97 on some hardware that has long erase times, to prevent long wait
98 times at the beginning of the DFU process.
99
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400100config ZEPHYR_TRY_MASS_ERASE
101 bool "Try to mass erase flash when flashing MCUboot image"
102 default y
103 help
104 If y, attempt to configure the Zephyr build system's "flash"
105 target to mass-erase the flash device before flashing the
106 MCUboot image. This ensures the scratch and other partitions
107 are in a consistent state.
108
109 This is not available for all targets.
110
Fabio Utzig9a4b9ba2018-05-07 08:31:27 -0300111config BOOT_HAVE_LOGGING
112 bool "MCUboot have logging enabled"
113 default y
114 select SYS_LOG
115 help
116 If y, enables logging on the serial port. The log level can
117 be defined by setting `SYS_LOG_DEFAULT_LEVEL`.
118 If unsure, leave at the default value.
119
Marti Bolivar0e091c92018-04-12 11:23:16 -0400120menuconfig MCUBOOT_SERIAL
121 bool "MCUboot serial recovery"
122 default n
123 select REBOOT
124 select UART_INTERRUPT_DRIVEN
125 select SERIAL
126 select BASE64
127 select TINYCBOR
128 help
129 If y, enables a serial-port based update mode. This allows
130 MCUboot itself to load update images into flash over a UART.
131 If unsure, leave at the default value.
132
133if MCUBOOT_SERIAL
134
Emanuele Di Santoc4bf7802018-07-20 11:39:57 +0200135choice
136 prompt "Serial device"
137 default BOOT_SERIAL_UART if !BOARD_NRF52840_PCA10059
138 default BOOT_SERIAL_CDC_ACM if BOARD_NRF52840_PCA10059
139
140config BOOT_SERIAL_UART
141 bool "UART"
142 # SERIAL and UART_INTERRUPT_DRIVEN already selected
143
144config BOOT_SERIAL_CDC_ACM
145 bool "CDC ACM"
146 select USB
147 select USB_DEVICE_STACK
148 select USB_CDC_ACM
149
150endchoice
151
Marti Bolivar0e091c92018-04-12 11:23:16 -0400152config BOOT_MAX_LINE_INPUT_LEN
153 int "Maximum command line length"
154 default 512
155 help
156 Maximum length of commands transported over the serial port.
157
158config BOOT_SERIAL_DETECT_PORT
159 string "GPIO device to trigger serial recovery mode"
160 default GPIO_0 if SOC_FAMILY_NRF
161 help
162 Zephyr GPIO device which contains the pin used to trigger
163 serial recovery mode.
164
165config BOOT_SERIAL_DETECT_PIN
166 int "Pin to trigger serial recovery mode"
167 default 11 if BOARD_NRF52840_PCA10056
168 default 13 if BOARD_NRF52_PCA10040
169 help
170 Pin on the serial detect port which triggers serial recovery mode.
171
172config BOOT_SERIAL_DETECT_PIN_VAL
173 int "Serial detect pin trigger value"
174 default 0
175 range 0 1
176 help
177 Logic value of the detect pin which triggers serial recovery
178 mode.
179
180endif # MCUBOOT_SERIAL
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200181
Andrzej Puzdrowski97543282018-04-12 15:16:56 +0200182endmenu
183
Carles Cufi84ede582018-01-29 15:12:00 +0100184config MCUBOOT_DEVICE_SETTINGS
185 # Hidden selector for device-specific settings
186 bool
187 default y
188 # CPU options
189 select MCUBOOT_DEVICE_CPU_CORTEX_M0 if CPU_CORTEX_M0
Carles Cufi67c792e2018-01-29 15:14:31 +0100190 # Enable flash page layout if available
191 select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT
Andrzej Puzdrowskib788c712018-04-12 12:42:49 +0200192 # Enable flash_map module as flash I/O back-end
193 select FLASH_MAP
Carles Cufi84ede582018-01-29 15:12:00 +0100194
195config MCUBOOT_DEVICE_CPU_CORTEX_M0
196 # Hidden selector for Cortex-M0 settings
197 bool
198 default n
199 select SW_VECTOR_RELAY if !CPU_CORTEX_M0_HAS_VECTOR_TABLE_REMAP
200
Marti Bolivar0e091c92018-04-12 11:23:16 -0400201comment "Zephyr configuration options"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200202
Marti Bolivar0e091c92018-04-12 11:23:16 -0400203config ZEPHYR_BASE
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200204 string
Marti Bolivar0e091c92018-04-12 11:23:16 -0400205 option env="ZEPHYR_BASE"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200206
Marti Bolivar0e091c92018-04-12 11:23:16 -0400207source "$ZEPHYR_BASE/Kconfig.zephyr"