Performing DFU on USB DFU device + Composite Device with CDC ACM using dfu-util tool on Windows Fails

I have configured a composite USB device on nRF5340 with DFU+CDC+Audio interfaces and enabled MCUBoot. Trying to perform DFU using dfu-util tool on Windows always fails. Following is my configuration:

#SUPPORT FOR USB DFU
CONFIG_USB=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr USB Sample"
CONFIG_USB_DFU_CLASS=y
CONFIG_FLASH=y
CONFIG_IMG_MANAGER=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
CONFIG_BOOTLOADER_MCUBOOT=y

#SUPPORT FOR USB CDC
CONFIG_USB_COMPOSITE_DEVICE=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_GPIO=y
CONFIG_USB_CDC_ACM=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_0_INTERRUPT_DRIVEN=n
CONFIG_UART_LINE_CTRL=y
CONFIG_UART_0_ASYNC=y
CONFIG_UART_0_NRF_HW_ASYNC=y
CONFIG_UART_0_NRF_HW_ASYNC_TIMER=1
CONFIG_NRFX_UARTE=y
CONFIG_NRFX_TIMER1=y
CONFIG_NRFX_PPI=y

#SUPPORT FOR USB AUDIO
CONFIG_USB_DEVICE_AUDIO=y
#net buf options
CONFIG_NET_BUF=y

I am using Windows 10 machine as the host. After plugging the nRF device, I use the Zadig tool to install libusbK driver on one of the three Zephyr interfaces that are visible on the tool. Without installing libusbK, the dfu-util reports that there are no DFU devices available, making this a required step for performing DFU. The output of the command "dfu-util --alt 1 --download app_update.bin -R" is:

Opening DFU capable USB device...
ID 2fe3:0100
Run-time device DFU version 0110
Claiming USB DFU Runtime Interface...
Determining device status: state = appIDLE, status = 0
Device really in Runtime Mode, send DFU detach request...
Resetting USB...
dfu-util: Lost device after RESET?

Following are the observations of some experiments I performed:

This configuration (with all 3 interfaces) works perfectly on Linux OS

  1. Performing DFU on DFU+Audio interface works on Windows
  2. Performing DFU on only DFU interface works on Windows
  3. Performing DFU on DFU+CDC does NOT work on Windows
  4. Performing DFU on DFU+CDC+Audio also does NOT work on Windows.
  5. Following note is present in ncs/zephyr/samples/subsys/usb/cdc_acm/overlay-composite-cdc-dfu.conf:

# Overlay file for composite configuration
# CDC ACM + USB DFU
#
# This composite configuration may not work for Windows OS Host.
# Windows OS does not send reset after DFU_DETACH request
# (does not re-enumerates) and thus make it unable for the device
# to restart in DFU mode.

CONFIG_USB_COMPOSITE_DEVICE=y

CONFIG_USB_DFU_CLASS=y
CONFIG_FLASH=y
CONFIG_IMG_MANAGER=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_BOOTLOADER_MCUBOOT=y

It looks like this is a known issue. Is there a solution to this?

Thanks,

Rashmi

Related