blob: eabebfaa28b1d8adeac51d984cf622d96f9529e8 [file] [log] [blame]
Andrzej Puzdrowski35f61d32022-04-01 17:00:08 +02001# Copyright (c) 2017-2020 Linaro Limited
2# Copyright (c) 2020 Arm Limited
3# Copyright (c) 2017-2022 Nordic Semiconductor ASA
4#
5# SPDX-License-Identifier: Apache-2.0
6
7
8menuconfig MCUBOOT_SERIAL
9 bool "MCUboot serial recovery"
10 default n
11 select REBOOT
12 select GPIO
13 select SERIAL
14 select UART_INTERRUPT_DRIVEN
15 select BASE64
16 help
17 If y, enables a serial-port based update mode. This allows
18 MCUboot itself to load update images into flash over a UART.
19 If unsure, leave at the default value.
20
21if MCUBOOT_SERIAL
22
23choice BOOT_SERIAL_DEVICE
24 prompt "Serial device"
25 default BOOT_SERIAL_UART if !BOARD_NRF52840DONGLE_NRF52840
26 default BOOT_SERIAL_CDC_ACM if BOARD_NRF52840DONGLE_NRF52840
27
28config BOOT_SERIAL_UART
29 bool "UART"
30 # SERIAL and UART_INTERRUPT_DRIVEN already selected
31
32config BOOT_SERIAL_CDC_ACM
33 bool "CDC ACM"
34 select USB_DEVICE_STACK
35
36endchoice
37
38config MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD
39 bool "Allow to select image number for DFU"
40 help
41 With the option enabled, the mcuboot serial recovery will
42 respect the "image" field in mcumgr image update frame
43 header.
44 The mapping of image number to partition is as follows:
45 0 -> default behaviour, same as 1;
46 1 -> image-0 (primary slot of the first image);
47 2 -> image-1 (secondary slot of the first image);
48 3 -> image-2;
49 4 -> image-3.
50 Note that 0 is default upload target when no explicit
51 selection is done.
52
53config BOOT_MAX_LINE_INPUT_LEN
54 int "Maximum command line length"
55 default 512
56 help
57 Maximum length of commands transported over the serial port.
58
59config BOOT_SERIAL_DETECT_PORT
Andrzej Puzdrowskic5faf432022-04-09 13:34:23 +020060 string "GPIO device to trigger serial recovery mode (DEPRECATED)"
Andrzej Puzdrowski35f61d32022-04-01 17:00:08 +020061 default GPIO_0 if SOC_FAMILY_NRF
62 help
63 Zephyr GPIO device that contains the pin used to trigger
64 serial recovery mode.
65
66config BOOT_SERIAL_DETECT_PIN
Andrzej Puzdrowskic5faf432022-04-09 13:34:23 +020067 int "Pin to trigger serial recovery mode (DEPRECATED)"
Andrzej Puzdrowski35f61d32022-04-01 17:00:08 +020068 default 6 if BOARD_NRF9160DK_NRF9160
69 default 11 if BOARD_NRF52840DK_NRF52840
70 default 13 if BOARD_NRF52DK_NRF52832 || BOARD_NRF52833DK_NRF52833
71 default 23 if BOARD_NRF5340PDK_NRF5340_CPUAPP || BOARD_NRF5340PDK_NRF5340_CPUAPP_NS || \
72 BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS
Marek Pieta2fa11902022-09-13 11:31:30 +020073 default -1
Andrzej Puzdrowski35f61d32022-04-01 17:00:08 +020074 help
75 Pin on the serial detect port that triggers serial recovery mode.
76
77config BOOT_SERIAL_DETECT_PIN_VAL
Andrzej Puzdrowskic5faf432022-04-09 13:34:23 +020078 int "Serial detect pin trigger value (DEPRECATED)"
Andrzej Puzdrowski35f61d32022-04-01 17:00:08 +020079 default 0
80 range 0 1
81 help
82 Logic value of the detect pin that triggers serial recovery
83 mode.
84
85config BOOT_SERIAL_DETECT_DELAY
86 int "Serial detect pin detection delay time [ms]"
87 default 0
88 help
89 Used to prevent the bootloader from loading on button press.
90 Useful for powering on when using the same button as
91 the one used to place the device in bootloader mode.
92
93config BOOT_ERASE_PROGRESSIVELY
94 bool "Erase flash progressively when receiving new firmware"
95 default y if SOC_FAMILY_NRF
96 help
97 If enabled, flash is erased as necessary when receiving new firmware,
98 instead of erasing the whole image slot at once. This is necessary
99 on some hardware that has long erase times, to prevent long wait
100 times at the beginning of the DFU process.
101
102config BOOT_MGMT_ECHO
103 bool "Enable echo command"
104 help
105 if enabled, support for the mcumgr echo command is being added.
106
107menuconfig ENABLE_MGMT_PERUSER
108 bool "Enable system specific mcumgr commands"
109 help
110 The option enables processing of system specific mcumgr commands;
111 system specific commands are within group MGMT_GROUP_ID_PERUSER (64)
112 and above, as defined within mcumgr library.
113 These are system specific command and system specific implementation
114 function is required to process these commands.
115
116if ENABLE_MGMT_PERUSER
117config BOOT_MGMT_CUSTOM_STORAGE_ERASE
118 bool "Enable storage erase command"
119 help
120 The option enables mcumgr command that allows to erase storage
121 partition.
122 Note that the storage partition needs to be defined, in DTS, otherwise
123 enabling the option will cause a compilation to fail.
124
125config BOOT_MGMT_CUSTOM_IMG_LIST
126 bool "Enable custom image list command"
127 help
128 The option enables command which returns versions and installation
129 statuses (custom property) for all images.
130
131endif # ENABLE_MGMT_PERUSER
132
133config BOOT_SERIAL_ENCRYPT_EC256
134 bool "Support for encrypted upgrade images using ECIES-P256 in serial recovery upload"
135 default n
136 help
137 If y, uploaded images via serial recovery can be decrypted
138 on the fly when upgrading to the primary slot. The
139 encryption mechanism used in this case is ECIES using primitives
140 described under "ECIES-P256 encryption" in docs/encrypted_images.md.
141
142config BOOT_SERIAL_WAIT_FOR_DFU
143 bool "Wait for a prescribed duration to see if DFU is invoked by receiving a mcumgr comand"
144 depends on BOOT_SERIAL_UART
145 help
146 If y, MCUboot waits for a prescribed duration of time to allow
147 for DFU to be invoked. The serial recovery can be entered by receiving any
148 mcumgr command.
149
150config BOOT_SERIAL_WAIT_FOR_DFU_TIMEOUT
151 int "Duration to wait for the serial DFU timeout in ms"
152 default 500
153 depends on BOOT_SERIAL_WAIT_FOR_DFU
154 help
155 timeout in ms for MCUboot to wait to allow for DFU to be invoked.
156
157endif # MCUBOOT_SERIAL