-
Notifications
You must be signed in to change notification settings - Fork 757
boot: zephyr: serial_recovery: Add boot mode enter ability #1629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9e34c03
a97190f
74c02c2
bda8566
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
# Copyright (c) 2017-2020 Linaro Limited | ||
# Copyright (c) 2020 Arm Limited | ||
# Copyright (c) 2017-2022 Nordic Semiconductor ASA | ||
# Copyright (c) 2017-2023 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
||
menuconfig MCUBOOT_SERIAL | ||
bool "MCUboot serial recovery" | ||
default n | ||
select REBOOT | ||
select GPIO | ||
select SERIAL | ||
select UART_INTERRUPT_DRIVEN | ||
select BASE64 | ||
|
@@ -85,14 +83,6 @@ config BOOT_SERIAL_MAX_RECEIVE_SIZE | |
by the number of receive buffers, BOOT_LINE_BUFS to allow for | ||
optimal data transfer speeds). | ||
|
||
config BOOT_SERIAL_DETECT_DELAY | ||
int "Serial detect pin detection delay time [ms]" | ||
default 0 | ||
help | ||
Used to prevent the bootloader from loading on button press. | ||
Useful for powering on when using the same button as | ||
the one used to place the device in bootloader mode. | ||
|
||
config BOOT_ERASE_PROGRESSIVELY | ||
bool "Erase flash progressively when receiving new firmware" | ||
default y if SOC_FAMILY_NRF | ||
|
@@ -117,6 +107,7 @@ menuconfig ENABLE_MGMT_PERUSER | |
function is required to process these commands. | ||
|
||
if ENABLE_MGMT_PERUSER | ||
|
||
config BOOT_MGMT_CUSTOM_STORAGE_ERASE | ||
bool "Enable storage erase command" | ||
help | ||
|
@@ -142,8 +133,26 @@ config BOOT_SERIAL_ENCRYPT_EC256 | |
encryption mechanism used in this case is ECIES using primitives | ||
described under "ECIES-P256 encryption" in docs/encrypted_images.md. | ||
|
||
config BOOT_SERIAL_WAIT_FOR_DFU | ||
bool "Wait for a prescribed duration to see if DFU is invoked by receiving a mcumgr comand" | ||
menu "Entrance methods" | ||
|
||
menuconfig BOOT_SERIAL_ENTRANCE_GPIO | ||
bool "GPIO" | ||
default y | ||
depends on GPIO | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously Kconfig selects There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the board selects it by default or has a driver that enables it by default, yes, which should be all boards as per the zephyr porting guide. |
||
help | ||
Use a GPIO to enter serial recovery mode. | ||
|
||
config BOOT_SERIAL_DETECT_DELAY | ||
int "Serial detect pin detection delay time [ms]" | ||
default 0 | ||
depends on BOOT_SERIAL_ENTRANCE_GPIO | ||
help | ||
Used to prevent the bootloader from loading on button press. | ||
Useful for powering on when using the same button as | ||
the one used to place the device in bootloader mode. | ||
|
||
menuconfig BOOT_SERIAL_WAIT_FOR_DFU | ||
bool "Wait a prescribed duration to see if DFU is invoked by receiving a MCUmgr comand" | ||
depends on BOOT_SERIAL_UART || BOOT_SERIAL_CDC_ACM | ||
help | ||
If y, MCUboot waits for a prescribed duration of time to allow | ||
|
@@ -155,6 +164,29 @@ config BOOT_SERIAL_WAIT_FOR_DFU_TIMEOUT | |
default 500 | ||
depends on BOOT_SERIAL_WAIT_FOR_DFU | ||
help | ||
timeout in ms for MCUboot to wait to allow for DFU to be invoked. | ||
Timeout in ms for MCUboot to wait to allow for DFU to be invoked. | ||
|
||
config BOOT_SERIAL_BOOT_MODE | ||
bool "Check boot mode via retention subsystem" | ||
depends on RETENTION_BOOT_MODE | ||
help | ||
Allows for entering serial recovery mode by using Zephyr's boot mode | ||
retention system (i.e. an application must set the boot mode to stay | ||
in serial recovery mode and reboot the module). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is module? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As in what is the retention system? Or another question? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was referring to I find module a bit ambiguous. |
||
|
||
config BOOT_SERIAL_NO_APPLICATION | ||
bool "Stay in bootloader if no application" | ||
help | ||
Allows for entering serial recovery mode if there is no bootable | ||
application that the bootloader can jump to. | ||
|
||
config BOOT_SERIAL_PIN_RESET | ||
bool "Check for device reset by pin" | ||
select HWINFO | ||
help | ||
Checks if the module reset was caused by the reset pin and will | ||
remain in bootloader serial recovery mode if it was. | ||
|
||
endmenu | ||
|
||
endif # MCUBOOT_SERIAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be a 'choice' in kconfig, or is the intention that you can enable multiple of the modes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple modes can be enabled, e.g. GPIO will be enabled by default but would also probably make sense to enable GPIO and "if application does not exist" - could even then change it so GPIO is only enabled by default if the line is present in the dts but these would all be future plans
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@d3zd3z Are you fine with merging this as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if more than one can be enabled.