1# Copyright (c) 2024 Nordic Semiconductor ASA
2# SPDX-License-Identifier: Apache-2.0
3
4menuconfig USBD_DFU
5	bool "USB DFU Class support"
6	help
7	  USB DFU Class support
8
9if USBD_DFU
10
11config USBD_DFU_NUMOF_IMAGES
12	int "Number of possible DFU images"
13	range 1 256
14	default 4
15	help
16	  Number of possible DFU images.
17
18config USBD_DFU_ENABLE_UPLOAD
19	bool "Allow images to be uploaded to the host"
20	default y
21	help
22	  This option sets the bitCanUpload flag in the DFU attributes and
23	  allows images to be uploaded to the host.
24
25config USBD_DFU_MANIFESTATION_TOLERANT
26	bool "Device is manifestation tolerant"
27	default y
28	help
29	  This option sets the bitManifestationTolerant flag in the DFU
30	  attributes and means that the device can communicate over USB after the
31	  manifestation phase.
32
33config USBD_DFU_TRANSFER_SIZE
34	int "Maximum number of bytes the device can accept per transfer"
35	default 512
36	range 64 1024
37	help
38	  This option sets the wTransferSize in the DFU functional descriptor.
39
40config USBD_DFU_POLLTIMEOUT
41	int "bwPollTimeout value (in ms)"
42	default 10
43	range 0 1000
44	help
45	  This option sets the bwPollTimeout field in DFU_GETSTATUS response.
46
47module = USBD_DFU
48module-str = usbd dfu
49source "subsys/logging/Kconfig.template.log_config"
50
51config USBD_DFU_FLASH
52	depends on FLASH && FLASH_MAP && STREAM_FLASH
53	depends on IMG_MANAGER && IMG_ERASE_PROGRESSIVELY
54	bool "Built-in flash backend"
55	help
56	  Enable the built-in flash backend, which can serve up to two image
57	  slots, which is the common configuration of in-tree boards.
58
59if USBD_DFU_FLASH
60
61config USBD_DFU_FLASH_SLOT0
62	bool "Flash backend for the slot-0 partition"
63	default y
64	help
65	  This option enables download or upload for the slot-0 partition, if
66	  one is defined.
67
68config USBD_DFU_FLASH_SLOT1
69	bool "Flash backend for the slot-1 partition"
70	help
71	  This option enables download or upload for the slot-1 partition, if
72	  one is defined.
73
74endif # USBD_DFU_FLASH
75
76endif
77