Author Topic: Predefined static COMX Serial Port for Win7 USB Connection  (Read 9986 times)

sparkup

  • Member
  • ***
  • Posts: 2
Predefined static COMX Serial Port for Win7 USB Connection
« on: March 03, 2013, 07:27:59 pm »
Hi everybody

I'm building an application for testing a line of devices.
My device is connected to the PC using a standard USB connection and it appears in the Win7 device manager as a serial port.
Each time I connect a device it takes about two seconds for it to be available as a serial port. I guess it is due to the windows process of the auto detection.
How can I tell windows "Whenever a usb is connected to this usb socket - be sure it is my device, don't search for anything, just set it up ASAP" ?
I don't mind even if the device will appear as connected while I plug it out and in again.

Thanks in advance. I'm looking forward to an answer, as it will be VERY helpful.
* If I missed a relevant thread - please refer me to it.
* I've posted this both under USB and Serial Port forums, as I wasn't sure where it belongs.

Thanks!
Yaniv.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Predefined static COMX Serial Port for Win7 USB Connection
« Reply #1 on: March 03, 2013, 09:26:33 pm »
I don't know of any way to do this.

On device attachment, the USB spec requires the host computer to enumerate the device by requesting descriptors from the device and selecting a compatible driver. 

Even an embedded system that supports only one device should read the descriptors and provide an error indication if it's an unsupported device.

Tsuneo

  • Frequent Contributor
  • ****
  • Posts: 145
Re: Predefined static COMX Serial Port for Win7 USB Connection
« Reply #2 on: March 05, 2013, 12:59:52 am »
Quote
sparkup:
I'm building an application for testing a line of devices.
Do the devices have USB serial number string?

If the devices would have no serial number (ie. iSerialNumber field of the device descriptor is 0), every device should appear on the same COM port number quickly, as long as they are plugged into the same USB port.

For production/testing of devices with serial number, IgnoreHWSerNum trick is available.

Using a registry editor (regedit, etc),
Add IgnoreHWSerNum entry under this key,
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\UsbFlags\

The entry name should have VID/PID of the device. For example of devices (VID/PID = 0xABCD / 0x1234)
IgnoreHWSerNumABCD1234

Set its value to 0x01 (REG_BINARY, length must be exactly one byte)

Now that Windows treat the target devices as if they have no serial number.

Tsuneo