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

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.
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...

Related

Identify Windows USB Sounddevice by physical USB port connection

When I connect several USB audio devices using the default drivers I usually end up with some kind of friendly device description like "nn- USB Audio codec" or something else, so I have currently no unique property which refers to a specific hardware the e.g. manufacturer ID. I would like to ensure that in case of re-enumerating or replugging the hardware to a different port that my software will automatically identify the changed windows audio device which maps to this hardware. I there a possibility to gather further windows audio device information which can be used to determine the physical hardware ?
Maybe a little clarification is needed:
I have two or more USB audio devices, not necessarily same product or manufacturer. The audio connections have different purposes, so I want to ensure that I my software uses constantly the same physical audio devices for different tasks. This sometimes fails when a re-enumeration occurs ( sometimes without changing the physical USB port connections, it's a windows thing...)
Ideally I would distinguish them by an individual serial number, which usually is only available with storage devices. But what I can retrieve is the "physical" USB topology when I'm looking at the device with a tool such as USBDeview from Nir Sofer. There I have a property like "Hub 3, Port1". If I could map this to a sound device I get from audio audio api like "nn- USB Audio codec" as seen in the sound control panel I would be perfectly happy.
Edit2:
May be this[1] post helps here, but I still have to figure out how to get a USB Port <-> Windwos Sounddevice mapping.
[1]: Can the physical USB port be identified programatically for a device in Windows? "

TDS NOMAD windows CE5.0 device connects more than two USB devices

I have a TDS Nomad running windows CE 5.0 system. It has a USB host port. I have connected to the manufacture and ask if nomad can connect to more than 1 USB devices via USB hub (can connect to 7 USB devices, designed for windows ), they said they haven't tested to connect more than one USB device. If more than one devices is connected to nomad, there mightbe resource conflict.
The nomad works well with one USB device connect to it individually.
But I have a console application debugging in nomad using visual studio2005 and active sync.
I need to talk to both USB devices. Therefore I have to use USB hub. But it doesn't work most of the time. I think the drivers of two USB devices are all correctly installed on nomad.
But what I want to ask, is that has anyone tried to connect more than one USB device to windows CE product via USB hub and both of them works well ?
I'm slightly confused. here. You say the device has USB host and you want to connect more than one client device through a hub. This is definitely supported by the OS, and I've done this with several devices from several manufacturers, though never with a Nomad. Not sure what the OEM is talking about with "resource conflicts" as the USB spec itself allows for multiple devices (kind of the whole point behind a "bus").
But you say that your second "device" is the debugger. That isn't a USB Host connection from the device perspective, that's a USB Client connection, and it typically uses completely different hardware and drivers for that connection. Can a device have both a host and a client connection? Again, yes I've done this with many devices (but not a Nomad) and the OS fully supports it.
Now maybe this is USB OTG hardware (though back in the 5.0 days I doubt it) and the OEM didn't do the design well to handle a client and a host at the same time. Maybe the physical hardware is laid out poorly or the OAL portion of their USB driver is poorly done and can't route properly through a hub properly (I've definitely seen that before). Hard to say.
A USB Analyzer would tell you a whole lot about what's actually happening and where the problem is, but it is definitely a supported scenario by both the USB spec and the OS. If it's failing, it's a manufacturer/device-specific problem.

USB composite Device instance IDs

I am developing a USB composite device. The composite device have 8 switches and one LED.
When I plugged the Composite device to PC,I could find five devices (each with same device ID but different instance IDs) in the HID section of Device Manager.
Why OS is showing multiple instances instead of One. Can anyone help me understand the concept?
As I recall 'composite device' is just a name in windows to mark that you have multiple devices on your USB line. There isn't a composite device class in the USB protocol. When you connect your USB device to your PC it communicates with all the devices contained in it and reports individually all their address and types. If you are missing some devices in your device manager it could be a driver issue or the device itself is broken. I don't know for sure but maybe there is a limit lower then it could be in theory in the windows hid host driver for the number of supported devices on a single line.

RNDIS gadget cannot start

I build video cameras with a Linux kernel on a TI Davinci dm365 board.
This board supports RNDIS drivers so my camera can be "plug and play" in windows. This is some kind of "Ethernet over USB" network adapter.
Windows load the RNDIS driver usb8023.sys to interact with my hardware.
When I have more than one camera plugged-in, Hell breaks loose and I get a lot of problems, sometimes all my USB ports stop working but most of the time, one of the two cameras stop working.
I've tried importing old drivers, copy usb8023.sys and load a separate driver for each cam with no luck. I've checked and double checked my ip settings.
I downloaded new version of the drivers from Texas Instruments and recompiled everything. I think that the problem was that the gadget pc had OTG (on the go) enabled, which allows it to switch between host and device mode.
It is likely the USB serial numbers for each of the video cameras is identical. Windows in general handles this situation very poorly.
You need to adjust the USB descriptors on each device to be a unique ID.

Windows PC as a USB slave to emulate a thumbdrive

I need to create a application that will allow a Windows PC (XP/Vista) to emulate a thumbdrive. That is, when the PC is plugged into either another Windows system, or in this case, a piece of hardware that allows for USB thumbdrives to be plugged in, a folder on the computer looks like a giant thumbdrive. Any thoughts on where a guy would start to investigate this?
Update (more specific description):
I need to connect my PC to one of the newer multifuction devices that support scanning to a USB thumbdrive that is inserted into the front of the device. These units do not support WIA or TWAIN via the rear USB connector that you'd typically use for connectivity to a PC.
Most USB controllers in regular pc's dont have the possibility to function as an USB slave. So I'd start with investigating what kind of hardware you're going to use.
Another way to go: there are USB Link cables to link up 2 pc's over USB, maybe that's usable for you?
You cannot do this in an application. At the lowest level, the USB ports on your computer are controlled by an Host Controller Interface. This chip will manage up to 127 slave USB devices. You would need to seriously reprogram this chip before it implements the slave side of the USB protocol. Of course, at that point any USB hub in your PC will break down - those 8 USB ports you probably have are usually implemented by 2 smart USB hubs connecting to both USB1 and USB2 host controllers. Next, your USB keyboard and mouse will stop working.
Take an MCU with two Slave USBs. Write a simple frimware which makes one USB act as a Special Device Class and wait until PC on this USB provides mandatory data (including Device Class, of course) for the other USB. Write a PC program which connects to the Special Device (your MCU), uploads Mass Storage Device Class and redirects I/O to a dedicated partition. The other USB on the MCU will become an emulated Mass Storage Device.
Some of those code can be taken from Linux.

Resources