2013-01-02 03:00 AM
Hi All,
is this normal ? Using 103F along with ST USB CDC Libs on my board and it seems that the USB driver on the PC negotiates a new COM port for every new board i connect to the PC.Normally this is not a problem but when the units are been tested, they are tested on one PC, thus that PC ends up with 100s of used COM ports.Having worked with Microchip USB CDC all board would use the first instance of COM port that was negotiated.Is there somthing i need to change in the libs to ensure the PC driver does not create a new COM port every time a new board is plugged in ?2013-01-02 07:16 AM
Is there somthing i need to change in the libs to ensure the PC driver does not create a new COM port every time a new board is plugged in ?
Have them report the same, non-zero, serial number. As I recall a zero serial, will be assigned a USB port specific COM#, and unique one will be assigned a unique COM# regardless of which USB port it is attached too. If the devices need unique serial numbers you'll need to clear out the device enumeration in the registry.2013-01-02 08:58 AM
Hi Clive,
How does one achieve this ?2013-01-02 11:45 AM
Well the serial number is in one of the descriptors passed back by your device.
Having a fixed serial number for all devices might been seen as undesirable by the end user. You might want to control test behaviour by using a pin to identify when it is in a test fixture. You might also want to review how your Microchip products were enumerated by the system to understand how they worked. Back when I worked on Windows stuff, there was a Device Manager API to fix/update the enumeration. I was also possible to delete/remove appropriate parts of the registry related to device enumeration. Finally you could use Filter drivers to intercept the data to/from the USB devices to alter their behaviour. So for example you could write one for your test system to mollify the problem you describe, whilst the shipped product would enumerate appropriately.2013-01-04 05:18 AM
We just went through this with a board. The solution was to uninstall the driver then add a registry value to the test machine. This value tells the machine to ignore the serial number for a given vendor/product ID combination.
The registry key is HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\UsbFlagsand you will want to add an entry with the name ''IgnoreHWSerNumVVVVPPPP'' and a binary value of 01 (VVVV is your vendor ID and PPPP is your product ID)Note that you need to clean out your old drivers completely before doing this. I used a program called usbdview (http://www.nirsoft.net/utils/usb_devices_view.html)So the procedure went like this: 1) uninstall all drivers referencing the VID and PID of your device2) add the registery entries for your VID and PID3) install your device againNow it should use the same com port each time. Hope that helps. Also, this was done on windows XP, I'm not sure if it works under 7.