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 <martijn@martijnpc.nl>
24 lines
825 B
YAML
24 lines
825 B
YAML
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:
|
|
tags: usb
|
|
sample.usb.dfu.permanent.download:
|
|
tags: usb
|
|
extra_args: OVERLAY_CONFIG=overlay-permanent-download.conf
|