Andrzej Puzdrowski | 35f61d3 | 2022-04-01 17:00:08 +0200 | [diff] [blame] | 1 | # 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 | |
| 8 | menuconfig 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 | |
| 21 | if MCUBOOT_SERIAL |
| 22 | |
| 23 | choice 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 | |
| 28 | config BOOT_SERIAL_UART |
| 29 | bool "UART" |
| 30 | # SERIAL and UART_INTERRUPT_DRIVEN already selected |
| 31 | |
| 32 | config BOOT_SERIAL_CDC_ACM |
| 33 | bool "CDC ACM" |
| 34 | select USB_DEVICE_STACK |
| 35 | |
| 36 | endchoice |
| 37 | |
| 38 | config 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 | |
| 53 | config 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 | |
| 59 | config BOOT_SERIAL_DETECT_PORT |
Andrzej Puzdrowski | c5faf43 | 2022-04-09 13:34:23 +0200 | [diff] [blame^] | 60 | string "GPIO device to trigger serial recovery mode (DEPRECATED)" |
Andrzej Puzdrowski | 35f61d3 | 2022-04-01 17:00:08 +0200 | [diff] [blame] | 61 | 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 | |
| 66 | config BOOT_SERIAL_DETECT_PIN |
Andrzej Puzdrowski | c5faf43 | 2022-04-09 13:34:23 +0200 | [diff] [blame^] | 67 | int "Pin to trigger serial recovery mode (DEPRECATED)" |
Andrzej Puzdrowski | 35f61d3 | 2022-04-01 17:00:08 +0200 | [diff] [blame] | 68 | 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 |
| 73 | help |
| 74 | Pin on the serial detect port that triggers serial recovery mode. |
| 75 | |
| 76 | config BOOT_SERIAL_DETECT_PIN_VAL |
Andrzej Puzdrowski | c5faf43 | 2022-04-09 13:34:23 +0200 | [diff] [blame^] | 77 | int "Serial detect pin trigger value (DEPRECATED)" |
Andrzej Puzdrowski | 35f61d3 | 2022-04-01 17:00:08 +0200 | [diff] [blame] | 78 | default 0 |
| 79 | range 0 1 |
| 80 | help |
| 81 | Logic value of the detect pin that triggers serial recovery |
| 82 | mode. |
| 83 | |
| 84 | config BOOT_SERIAL_DETECT_DELAY |
| 85 | int "Serial detect pin detection delay time [ms]" |
| 86 | default 0 |
| 87 | help |
| 88 | Used to prevent the bootloader from loading on button press. |
| 89 | Useful for powering on when using the same button as |
| 90 | the one used to place the device in bootloader mode. |
| 91 | |
| 92 | config BOOT_ERASE_PROGRESSIVELY |
| 93 | bool "Erase flash progressively when receiving new firmware" |
| 94 | default y if SOC_FAMILY_NRF |
| 95 | help |
| 96 | If enabled, flash is erased as necessary when receiving new firmware, |
| 97 | instead of erasing the whole image slot at once. This is necessary |
| 98 | on some hardware that has long erase times, to prevent long wait |
| 99 | times at the beginning of the DFU process. |
| 100 | |
| 101 | config BOOT_MGMT_ECHO |
| 102 | bool "Enable echo command" |
| 103 | help |
| 104 | if enabled, support for the mcumgr echo command is being added. |
| 105 | |
| 106 | menuconfig ENABLE_MGMT_PERUSER |
| 107 | bool "Enable system specific mcumgr commands" |
| 108 | help |
| 109 | The option enables processing of system specific mcumgr commands; |
| 110 | system specific commands are within group MGMT_GROUP_ID_PERUSER (64) |
| 111 | and above, as defined within mcumgr library. |
| 112 | These are system specific command and system specific implementation |
| 113 | function is required to process these commands. |
| 114 | |
| 115 | if ENABLE_MGMT_PERUSER |
| 116 | config BOOT_MGMT_CUSTOM_STORAGE_ERASE |
| 117 | bool "Enable storage erase command" |
| 118 | help |
| 119 | The option enables mcumgr command that allows to erase storage |
| 120 | partition. |
| 121 | Note that the storage partition needs to be defined, in DTS, otherwise |
| 122 | enabling the option will cause a compilation to fail. |
| 123 | |
| 124 | config BOOT_MGMT_CUSTOM_IMG_LIST |
| 125 | bool "Enable custom image list command" |
| 126 | help |
| 127 | The option enables command which returns versions and installation |
| 128 | statuses (custom property) for all images. |
| 129 | |
| 130 | endif # ENABLE_MGMT_PERUSER |
| 131 | |
| 132 | config BOOT_SERIAL_ENCRYPT_EC256 |
| 133 | bool "Support for encrypted upgrade images using ECIES-P256 in serial recovery upload" |
| 134 | default n |
| 135 | help |
| 136 | If y, uploaded images via serial recovery can be decrypted |
| 137 | on the fly when upgrading to the primary slot. The |
| 138 | encryption mechanism used in this case is ECIES using primitives |
| 139 | described under "ECIES-P256 encryption" in docs/encrypted_images.md. |
| 140 | |
| 141 | config BOOT_SERIAL_WAIT_FOR_DFU |
| 142 | bool "Wait for a prescribed duration to see if DFU is invoked by receiving a mcumgr comand" |
| 143 | depends on BOOT_SERIAL_UART |
| 144 | help |
| 145 | If y, MCUboot waits for a prescribed duration of time to allow |
| 146 | for DFU to be invoked. The serial recovery can be entered by receiving any |
| 147 | mcumgr command. |
| 148 | |
| 149 | config BOOT_SERIAL_WAIT_FOR_DFU_TIMEOUT |
| 150 | int "Duration to wait for the serial DFU timeout in ms" |
| 151 | default 500 |
| 152 | depends on BOOT_SERIAL_WAIT_FOR_DFU |
| 153 | help |
| 154 | timeout in ms for MCUboot to wait to allow for DFU to be invoked. |
| 155 | |
| 156 | endif # MCUBOOT_SERIAL |