blob: 4b8801ed5a871d343beb9dd610c570047f98b189 [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
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040010config BOOT_USE_MBEDTLS
11 bool
12 # Hidden option
13 default n
14 help
15 Use mbedTLS for crypto primitives.
16
17config BOOT_USE_TINYCRYPT
18 bool
19 # Hidden option
20 default n
21 help
22 Use TinyCrypt for crypto primitives.
23
Andrzej Puzdrowski97543282018-04-12 15:16:56 +020024menu "MCUBoot settings"
25
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040026choice
27 prompt "Signature type"
28 default BOOT_SIGNATURE_TYPE_RSA
29
30config BOOT_SIGNATURE_TYPE_RSA
31 bool "RSA signatures"
32 select BOOT_USE_MBEDTLS
Marti Bolivara4818a52018-04-12 13:02:38 -040033 select MBEDTLS
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040034
35config BOOT_SIGNATURE_TYPE_ECDSA_P256
36 bool "Elliptic curve digital signatures with curve P-256"
37 select BOOT_USE_TINYCRYPT
38
39endchoice
40
Fabio Utzigc690c762018-04-26 10:51:09 -030041config BOOT_SIGNATURE_KEY_FILE
42 string "PEM key file"
43 default ""
44 help
45 The key file will be parsed by imgtool's getpub command and a .c source
46 with the public key information will be written in a format expected by
47 MCUboot.
48
Marti Bolivara4818a52018-04-12 13:02:38 -040049config MBEDTLS_CFG_FILE
50 default "mcuboot-mbedtls-cfg.h"
51
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040052config BOOT_VALIDATE_SLOT0
53 bool "Validate image slot 0 on every boot"
54 default y
55 help
56 If y, the bootloader attempts to validate the signature of
57 slot0 every boot. This adds the signature check time to
58 every boot, but can mitigate against some changes that are
59 able to modify the flash image itself.
60
61config BOOT_UPGRADE_ONLY
62 bool "Overwrite image updates instead of swapping"
63 default n
64 help
65 If y, overwrite slot0 with the upgrade image instead of
66 swapping them. This prevents the fallback recovery, but
67 uses a much simpler code path.
68
Fabio Utzig5fe874c2018-08-31 07:41:50 -030069config BOOT_ENCRYPT_RSA
70 bool "Support for encrypted upgrade images"
71 default n
72 help
73 If y, images in slot 1 can be encrypted and are decrypted
74 on the fly when upgrading to slot 0, as well as encrypted
75 back when swapping from slot 0 to slot 1.
76
Marti Bolivar0e091c92018-04-12 11:23:16 -040077config BOOT_MAX_IMG_SECTORS
78 int "Maximum number of sectors per image slot"
79 default 128
80 help
81 This option controls the maximum number of sectors that each of
82 the two image areas can contain. Smaller values reduce MCUboot's
83 memory usage; larger values allow it to support larger images.
84 If unsure, leave at the default value.
85
Emanuele Di Santo205c8c62018-07-20 11:42:31 +020086config BOOT_ERASE_PROGRESSIVELY
87 bool "Erase flash progressively when receiving new firmware"
88 default y if SOC_NRF52840
89 help
90 If enabled, flash is erased as necessary when receiving new firmware,
91 instead of erasing the whole image slot at once. This is necessary
92 on some hardware that has long erase times, to prevent long wait
93 times at the beginning of the DFU process.
94
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040095config ZEPHYR_TRY_MASS_ERASE
96 bool "Try to mass erase flash when flashing MCUboot image"
97 default y
98 help
99 If y, attempt to configure the Zephyr build system's "flash"
100 target to mass-erase the flash device before flashing the
101 MCUboot image. This ensures the scratch and other partitions
102 are in a consistent state.
103
104 This is not available for all targets.
105
Fabio Utzig9a4b9ba2018-05-07 08:31:27 -0300106config BOOT_HAVE_LOGGING
107 bool "MCUboot have logging enabled"
108 default y
109 select SYS_LOG
110 help
111 If y, enables logging on the serial port. The log level can
112 be defined by setting `SYS_LOG_DEFAULT_LEVEL`.
113 If unsure, leave at the default value.
114
Marti Bolivar0e091c92018-04-12 11:23:16 -0400115menuconfig MCUBOOT_SERIAL
116 bool "MCUboot serial recovery"
117 default n
118 select REBOOT
119 select UART_INTERRUPT_DRIVEN
120 select SERIAL
121 select BASE64
122 select TINYCBOR
123 help
124 If y, enables a serial-port based update mode. This allows
125 MCUboot itself to load update images into flash over a UART.
126 If unsure, leave at the default value.
127
128if MCUBOOT_SERIAL
129
Emanuele Di Santoc4bf7802018-07-20 11:39:57 +0200130choice
131 prompt "Serial device"
132 default BOOT_SERIAL_UART if !BOARD_NRF52840_PCA10059
133 default BOOT_SERIAL_CDC_ACM if BOARD_NRF52840_PCA10059
134
135config BOOT_SERIAL_UART
136 bool "UART"
137 # SERIAL and UART_INTERRUPT_DRIVEN already selected
138
139config BOOT_SERIAL_CDC_ACM
140 bool "CDC ACM"
141 select USB
142 select USB_DEVICE_STACK
143 select USB_CDC_ACM
144
145endchoice
146
Marti Bolivar0e091c92018-04-12 11:23:16 -0400147config BOOT_MAX_LINE_INPUT_LEN
148 int "Maximum command line length"
149 default 512
150 help
151 Maximum length of commands transported over the serial port.
152
153config BOOT_SERIAL_DETECT_PORT
154 string "GPIO device to trigger serial recovery mode"
155 default GPIO_0 if SOC_FAMILY_NRF
156 help
157 Zephyr GPIO device which contains the pin used to trigger
158 serial recovery mode.
159
160config BOOT_SERIAL_DETECT_PIN
161 int "Pin to trigger serial recovery mode"
162 default 11 if BOARD_NRF52840_PCA10056
163 default 13 if BOARD_NRF52_PCA10040
164 help
165 Pin on the serial detect port which triggers serial recovery mode.
166
167config BOOT_SERIAL_DETECT_PIN_VAL
168 int "Serial detect pin trigger value"
169 default 0
170 range 0 1
171 help
172 Logic value of the detect pin which triggers serial recovery
173 mode.
174
175endif # MCUBOOT_SERIAL
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200176
Andrzej Puzdrowski97543282018-04-12 15:16:56 +0200177endmenu
178
Carles Cufi84ede582018-01-29 15:12:00 +0100179config MCUBOOT_DEVICE_SETTINGS
180 # Hidden selector for device-specific settings
181 bool
182 default y
183 # CPU options
184 select MCUBOOT_DEVICE_CPU_CORTEX_M0 if CPU_CORTEX_M0
Carles Cufi67c792e2018-01-29 15:14:31 +0100185 # Enable flash page layout if available
186 select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT
Andrzej Puzdrowskib788c712018-04-12 12:42:49 +0200187 # Enable flash_map module as flash I/O back-end
188 select FLASH_MAP
Carles Cufi84ede582018-01-29 15:12:00 +0100189
190config MCUBOOT_DEVICE_CPU_CORTEX_M0
191 # Hidden selector for Cortex-M0 settings
192 bool
193 default n
194 select SW_VECTOR_RELAY if !CPU_CORTEX_M0_HAS_VECTOR_TABLE_REMAP
195
Marti Bolivar0e091c92018-04-12 11:23:16 -0400196comment "Zephyr configuration options"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200197
Marti Bolivar0e091c92018-04-12 11:23:16 -0400198config ZEPHYR_BASE
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200199 string
Marti Bolivar0e091c92018-04-12 11:23:16 -0400200 option env="ZEPHYR_BASE"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200201
Marti Bolivar0e091c92018-04-12 11:23:16 -0400202source "$ZEPHYR_BASE/Kconfig.zephyr"