-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
usb: dfu: add permanent download and automatic reboot
This commit adds the USB_DFU_PERMANENT_DOWNLOAD and USB_DFU_REBOOT and symbols.When the permanent download symbol is enabled, slot 1 will be marked as confirmed. With the reboot symbol enabled, the devices automatically reboots after the download is completed. The functionality is split into two symbols to allow the automatic reboot without confirming the image. This enables image confirmation via another channel. For example via the shell’s Mcuboot commands. This functionality allows downloading an image to the device without the user having to interact with the device. It is useful in cases where ease of use is more important then safety. For example when using USB download for daily development. This is especially applicable for devices with a closed case. The changes were tested on an nrf52840dk. The following line can be used to build the USB DFU example with the symbols enabled. west build -b nrf52840dk_nrf52840 zephyr/samples/subsys/usb/dfu \ -d build-dfu -- -DCONFIG_BOOTLOADER_MCUBOOT=y \ -DOVERLAY_CONFIG=overlay-reboot-permanent.conf \ -DCONFIG_MCUBOOT_SIGNATURE_KEY_FILE\ =\"bootloader/mcuboot/root-rsa-2048.pem\" Fixes #41921 Signed-off-by: Martijn Stommels <[email protected]>
- Loading branch information
1 parent
94e50a7
commit 49cb653
Showing
4 changed files
with
87 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CONFIG_USB_DFU_REBOOT=y | ||
|
||
CONFIG_USB_DFU_PERMANENT_DOWNLOAD=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
sample: | ||
name: USB DFU sample | ||
|
||
common: | ||
build_only: True | ||
platform_exclude: native_posix native_posix_64 mimxrt1010_evk | ||
mimxrt1050_evk_qspi mimxrt1020_evk mimxrt1015_evk mimxrt1060_evk sam4l_ek | ||
mimxrt1050_evk mimxrt1060_evk_hyperflash nucleo_f207zg teensy40 teensy41 | ||
b_u585i_iot02a | ||
depends_on: usb_device | ||
filter: dt_label_with_parent_compat_enabled("slot0_partition", "fixed-partitions") and | ||
dt_label_with_parent_compat_enabled("slot1_partition", "fixed-partitions") and | ||
dt_chosen_enabled("zephyr,flash-controller") and | ||
CONFIG_FLASH_HAS_DRIVER_ENABLED | ||
integration_platforms: | ||
- nrf52840dk_nrf52840 | ||
- frdm_k64f | ||
tests: | ||
sample.usb.dfu: | ||
build_only: True | ||
platform_exclude: native_posix native_posix_64 mimxrt1010_evk | ||
mimxrt1050_evk_qspi mimxrt1020_evk mimxrt1015_evk mimxrt1060_evk sam4l_ek | ||
mimxrt1050_evk mimxrt1060_evk_hyperflash nucleo_f207zg teensy40 teensy41 | ||
b_u585i_iot02a | ||
depends_on: usb_device | ||
filter: dt_label_with_parent_compat_enabled("slot0_partition", "fixed-partitions") and | ||
dt_label_with_parent_compat_enabled("slot1_partition", "fixed-partitions") and | ||
dt_chosen_enabled("zephyr,flash-controller") and | ||
CONFIG_FLASH_HAS_DRIVER_ENABLED | ||
tags: usb | ||
integration_platforms: | ||
- nrf52840dk_nrf52840 | ||
- frdm_k64f | ||
sample.usb.dfu.permanent.download: | ||
tags: usb | ||
extra_args: OVERLAY_CONFIG=overlay-permanent-download.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters