-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Description
Describe the bug
When trying to use USB DFU in a composite device, the device never enters DFU mode. When you try to download new firmware using dfu-util, it fails with the message Device still in Runtime Mode
To Reproduce
- Add
CONFIG_USB_COMPOSITE_DEVICE=yto config of the USB DFU sample. - Flash mcuboot and the sample to the device
- Attempt a DFU using
sudo dfu-util --alt 1 --download signed-zephyr.bin --i 0
Impact
We are unable to use USB DFU in our product the relies on USB communication.
Screenshots or console output
dfu-util output:
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2019 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
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...
Opening DFU USB Device...
Claiming USB DFU Interface...
Setting Alternate Setting #1 ...
Determining device status: state = appDETACH, status = 0
dfu-util: Device still in Runtime Mode!
Zephyr output:
***** Booting Zephyr OS v1.14.0-rc1-1394-g972221423cde *****
[00:00:00.000,396] <inf> main: This device supports USB DFU class.
[00:00:03.748,168] <dbg> usb_dfu.dfu_custom_handle_req: DFU alternate setting 0
[00:00:03.748,352] <dbg> usb_dfu.dfu_class_handle_req: DFU_GETSTATUS: status 0, state 0
[00:00:04.004,852] <dbg> usb_dfu.dfu_class_handle_req: DFU_DETACH timeout 1000, state 0
[00:00:04.563,629] <dbg> usb_dfu.dfu_status_cb: USB device configured
[00:00:09.286,804] <dbg> usb_dfu.dfu_custom_handle_req: DFU alternate setting 1
[00:00:09.287,384] <dbg> usb_dfu.dfu_class_handle_req: DFU_GETSTATUS: status 0, state 1
[00:00:09.543,975] <dbg> usb_dfu.dfu_custom_handle_req: DFU alternate setting 0
Environment (please complete the following information):
- OS: Linux (Ubuntu)
- Toolchain: Zephyr SDK
- Commit SHA: 9722214
Additional context
I'm am unsure wheter or not this is related to this issue, but if also enable CDC ACM in the config, the DFU usb interface is listed as 2 instead of 0, and dfu-util fails with dfu-util: Lost device after RESET? instead. After the first failed attempt, the interface number is 0 again and the issue is the same as above.