none
Device Firmware Upload (DFU), device reset, and WinUSB -- how can I reset the device? RRS feed

  • Question

  • The DFU specification at http://www.usb.org/developers/docs/devclass_docs/DFU_1.1.pdf has this statement:

    Once the device reports to the host that it has completed the reprogramming operations, the host issues a USB reset to the device. The device re-enumerates and executes the upgraded firmware.

    Working through WinUSB, how can I issue that USB reset?

    I've come all this way, please don't tell me that WinUSB and DFU are incompatible.

    Currently, I'm looking at IOCTL_USB_HUB_CYCLE_PORT, but the documentation I've found says that this requires admin privileges for Windows 8 and above, and doesn't work at all on Windows 7 or Vista.

    I can't be the first person ever to write a firmware uploader under Windows. How do other people do it?

    Friday, March 3, 2017 3:47 AM

Answers

  • "The host issues USB reset to the device" means just this. Your firmware uploader sends a special request to the device. The device performs internal warm reset, falls off the bus and re-enumerates. If the device developer has not implemented such internal reset - too bad.

    Note that exactly because IOCTL_USB_HUB_CYCLE_PORT is not to be used (or does not work) , the device keeps receiving Vcc from the port, so non-volatile storage for the new firmware is not required.

    -- pa




    Friday, March 3, 2017 4:09 AM

All replies

  • "The host issues USB reset to the device" means just this. Your firmware uploader sends a special request to the device. The device performs internal warm reset, falls off the bus and re-enumerates. If the device developer has not implemented such internal reset - too bad.

    Note that exactly because IOCTL_USB_HUB_CYCLE_PORT is not to be used (or does not work) , the device keeps receiving Vcc from the port, so non-volatile storage for the new firmware is not required.

    -- pa




    Friday, March 3, 2017 4:09 AM
  • "The host issues USB reset to the device" means just this. Your firmware uploader sends a special request to the device. The device performs internal warm reset, falls off the bus and re-enumerates. If the device developer has not implemented such internal reset - too bad.

    Are you sure? The previous WDM driver I'm replacing reset the device by issuing the IOCTL_INTERNAL_USB_RESET_PORT ioctl.
    Wednesday, March 8, 2017 10:08 PM
  • I am not sure about IOCTL_USB_HUB_CYCLE_PORT. It looks like it still exists in Win8 and later, but in Win7 its status unclear. So I only say that there is a way to do the update without power cycling the port. Some devices support this, some do not, and make driver developer's life interesting.

    -- pa

    Friday, March 10, 2017 5:49 PM