Skip to content

Commit a9bfe0a

Browse files
tmon-nordicstephanosio
authored andcommitted
usb: dfu: Reduce default bwPollTimeout value
The bwPollTimeout name is somewhat confusing as it refers to minimum polling period. The bwPollTImeout is essentially a mechanism allowing device to ratelimit DFU_GETSTATUS requests from host. Setting bwPollTimeout to relatively high values effectively slows down DFU download process. The slowdown is not observed if the time between DFU_DNLOAD and DFU_GETSTATUS is enough for the device to process the write. That is, the bwPollTimeout does not effect DFU download if the first DFU_GETSTATUS after DFU_DNLOAD reports dfuDNLOAD-IDLE state. Otherwise the host must wait bwPollTimeout ms before issuing next DFU_GETSTATUS, which slows the communicaiton to not more than 1 download block (CONFIG_USB_REQUEST_BUFFER_SIZE) every bwPollTimeout ms. The bwPollTimeout ideally should report an estimate how much longer the download operation will take. Zephyr does not have such estimate and therefore defaults to using fixed value. Reduce default bwPollTimeout from 256 to 8 ms to allow significantly faster DFU downloads on devices where the time between DFU_DNLOAD and DFU_GETSTATUS is too short to process download block at the expense of unnecessary bus traffic if processing download block takes longer than 8 ms. Signed-off-by: Tomasz Moń <[email protected]>
1 parent 1fde62e commit a9bfe0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/usb/device/class/dfu/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ config USB_DFU_DETACH_TIMEOUT
3434

3535
config USB_DFU_DEFAULT_POLLTIMEOUT
3636
int "Default value for bwPollTimeout"
37-
default 256
37+
default 8
3838
range 0 1000
3939
help
4040
Default value for bwPollTimeout (in ms)

0 commit comments

Comments
 (0)