4

When producing devices that use a FTDI USB to serial chip to communicate with a Windows host, we get hundreds of COM-ports, since Windows seems to just increase the port number each time a new FTDI vid+pid+serial is connected to the PC.

I have looked into HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\FTDIBUS and tried deleting the new entries that appear, but the only effect is that the COM port number is increased even for devices with the same vid+pid+serial (i.e. devices that have already been connected once).

The question: is it possible to reset this counter some way so that the enumeration starts from the first free COM port number?

Edit: Is this question better suited for superuser.com? Edit2: It has been answered on superuser

icecream
  • 143
  • 1
  • 1
  • 5

3 Answers3

1

Note: Copied from SuperUser

I'm not at work so I don't have any hardware in front of me, but the FTDI application note AN_107 - Advanced Driver Options looks to have some promising options.

In particular, I think the "Ignore Hardware Serial Number" (section 7.1, page 20) option would do what you want.

7.1 Ignore Hardware Serial Number

If devices have the same vendor ID and product ID but different serial numbers, the system will normally treat them as different devices. This causes the drivers to be installed for each device and create registry entries for each device.

It is possible to override this behaviour to make the system ignore a device's serial number and treat all devices with matching VID and PID connected to the same USB port as if they were the same device. This is achieved by adding a REG_BINARY value called IgnoreHWSerNum to the registry and setting it to 01.

The AN_123 How COM Ports Are Allocated On Driver Installation app note is also very informative.

OT, devices these days are getting so complex that most of the documentation is being moved out of the datasheet and into App Notes. Don't forget to always read the app notes!

Fake Name
  • 587
  • 1
  • 6
  • 16
1

Here are instructions to prevent a Windows computer from assigning a new COM port number each time a new device with a FT232RL IC is plugged into a USB port: http://liionbms.com/pdf/DisableFTDI_Enumeration.pdf Feel free to use

0

Microsoft has a command line utility called DevCon which may do what you need.

Examples:

List present and non-present USB devices:

devcon findall =usb

List present and non-present ports:

devcon findall =ports

Remove all USB devices:

devcon remove @usb\*

Remove all ports:

devcon remove @ports\*

Proceed with caution. You might need to do a devcon rescan or even a devcon reboot afterwards.

Dennis Williamson
  • 60,515
  • 14
  • 113
  • 148
  • Thanks for the tip about devcon. It did not reset the port counter, though. After I remove the device using devcon and then re-insert the cable, the com port number just continues counting up. – icecream Mar 02 '10 at 07:13