-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USB DFU never enters DFU mode, when composite device is enabled and mcuboot is used #14882
Comments
Hi @pileghoff, I just wanted to open a similar issue. I tried to perform DFU in a composite device (HID class + DFU class) and this fails on Ubuntu, waiting for USB reset:
Logs on the device during the update:
|
Update: USB composite device is not found properly after reset requested by dfu-util. Reset is performed by the USB device, but it will not be recognized by host afterwards. During this reset, HID in HID class is disabled and is not reenabled again. Logs on dfu-util side with triple verbosity:
Tests done on Ubuntu 16.04 with libusb-1.0-0:amd64 version 1.0.20. |
Add status callback for composite configuration. Status callback is used to set the DFU state to dfuIDLE, if the callback is not called the device remains in appDETACH state and the dfu-util aborts. fixes: zephyrproject-rtos#14882 Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Merge cb_usb_status_composite and cb_usb_status and use common forward_status_cb for both composite and normal devices. Fixes zephyrproject-rtos#14882 Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Reopening since this doesn't seem fully fixed |
|
When the device enters DFU mode, the descriptor set is switched to DFU-specific. Device descriptor must match the previous one, otherwise dfu-util will report an error. DFU descriptor was missing a variant for composite device mode (currently composite device mode has a special implementation in ifdefs - to be refactored in future) causing a mismatch - composite before DFU_DETACH and non-composite after. Fixes zephyrproject-rtos#14882 Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
I was able to reproduce it. |
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
CONFIG_USB_COMPOSITE_DEVICE=y
to config of the USB DFU sample.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:
Zephyr output:
Environment (please complete the following information):
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.The text was updated successfully, but these errors were encountered: