Re-enumeration of USB device which is upgraded from old to new firmware with changes in the descriptor
Asked Answered
A

1

6

If I connect a USB device to the host and then upgraded the USB device with a new firmware with changes in the Descriptor of the device. The host will use the old descriptor.

I know that I can force the device to re-enumerate itself by deleting Windows initialized driver for the device etc. or I can bump the ProductId in the descriptor and the device will re-enumerate.

Windows cash the information about the device etc. and thereby windows never ask the device to provide the information again on reconnecting about interfaces, configuration, endpoints, HID descriptor etc.

enter image description here

idProduct - changing this will re-enumerate the device because windows will think its a different device.

iSerialNumber - changing this will re-enumerate because windows need to differentiate between two same idProducts (two of same products connected)

bcdDevice - should do the trick of re-enumeration but it's not working as specified in USB specification.

My question is how can I force Re-enumeration of the USB device without deleting drivers etc. or changing idProduct or iSerialNumber?

Any help will be appreciated...

Abrahamabrahams answered 23/10, 2018 at 10:30 Comment(8)
Have you checked the wdfusbtargetdeviceresetportsynchronously method ? It will allow you to reset a port, it might answer your issue without re-enumerating everything.Pneumatic
Do you have the option of editing the firmware? Disabling the USB pullup for a few hundred milliseconds should do the trick.Steffens
@LéoD. Well I am pretty sure that it wouldn't make the device re-enumeration "After a successful reset operation, the bus driver reselects the configuration and any alternate interface settings that the device had before the reset operation occurred."Abrahamabrahams
@DavidGrayson I can try that but in accordance with USB specification I am not sure that this will fix the problem. Have you tried it yourself?Abrahamabrahams
Yes, I have tried it. The USB host will see the device as being disconnected if you disable that pullup, so it will have to reenumerate it afterwards, for the same reason it would enumerate the device if you unplugged it and plugged it or some other device back in.Steffens
@DavidGrayson I want windows to re-enumerate the device without windows uses the cached information about the device pnpDeviceid etc. I want the device to be installed like a new USB device. The above-mentioned trick wouldn't do the trick for me in my case.Abrahamabrahams
@RamHS: did you find a way to force windows to force re-enumeration using the device descriptors?Palmapalmaceous
@Palmapalmaceous refer to the answer :)Abrahamabrahams
A
2

The solution is to append to iSerial when re-enumeration is required. That is the only solution if changing the PID is a no go.

When the iSerial is appended e.g., from 000000xx -> 000000yy then windows will treat the USB device as a new device and re-initiate the drivers etc.

Abrahamabrahams answered 12/5, 2023 at 13:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.