FTDI USB Serial Port Enumeration on Windows

FTDI is one of the two major manufacturers of USB UART chips, and they provide regularly updated and reliable drivers. Most devices I’ve used don’t bother to implement a custom VID/PID, so you can just use the drivers directly from FTDI.

When you connect a large number of USB serial ports, it is often difficult to determine which port belongs to which physical connector, so FTDI has implemented a mechanism that persists COM port enumeration on Windows. The mechanism works by uniquely identifying a port based on the serial number stored in an eeprom associated with the device. Unfortunately, it turns out to be really persistent and I spent half a day trying to unpersist the mapping after I plugged in a second device to test it. The result was my COM port which I wante to be COM3 – COM11 became COM21-COM29. While there’s nothing really wrong with this, I wanted the lower ports back.

FTDI Workaround for a Single Device

FTDI presents a workaround in the App Note Advanced Driver Options for using a single device. The Ignore Hardware Serial Number flag will force all devices to be treated as the same device and enumerate from the lowest available COM port. This is only an option if you want to connect just one device.

Removing Persistent Enumeration Entirely

Since I found no documentation on how to wipe out all persistent enumeration (ftclean doesn’t do it), I started searching the registry. The persistent enumeration appears to be stored by both the serenum driver and the ftdibus driver.

  1. Run FTClean to remove the driver and existing COM ports
  2. Delete the FTDI enumeration registry settings
    1. Remove HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\FTDIBUS
    2. Remove HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FTDIBUS
    3. Remove HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FTSER2K
  3. Delete serenum enumeration only for the ports you wish to remove
    1. Under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\serenum\Enum, remove each REG_SZ entry for sequential COM ports you want to remove. Then, adjust the Count REG_DWORD and NextInstance REG_DWORD to point to the next available COM port.

I don’t know if all of these steps are strictly necessary, as I haven’t yet tried to reduce the procedure. However, this should eliminate all persistent mapping and the next time you install an FTDI device, the serial ports should start enumerating again from the number specified in the NextInstance value.

  • Share/Bookmark
This entry was posted in troubleshooting and tagged , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>