Default USB PID differs for different devices. 0x6001 is valid only for FT245BM.
authorVladimir Yakovlev <nagos@inbox.ru>
Wed, 19 Jan 2011 15:38:25 +0000 (16:38 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 19 Jan 2011 15:38:25 +0000 (16:38 +0100)
FT2232HQ uses 0x6010. Now you can define a default fallback PID.

In configuration file add this line:
        default_pid=0x6110

ftdi_eeprom/main.c

index 25a3a5a..ad8eb8d 100644 (file)
@@ -114,6 +114,7 @@ int main(int argc, char *argv[])
         CFG_BOOL("use_serial", cfg_false, 0),
         CFG_BOOL("change_usb_version", cfg_false, 0),
         CFG_INT("usb_version", 0, 0),
+        CFG_INT("default_pid", 0x6001, 0),
         CFG_INT("max_power", 0, 0),
         CFG_STR("manufacturer", "Acme Inc.", 0),
         CFG_STR("product", "USB Serial Converter", 0),
@@ -266,11 +267,12 @@ int main(int argc, char *argv[])
         }
         else
         {
+            int default_pid = cfg_getint(cfg, "default_pid");
             printf("Unable to find FTDI devices under given vendor/product id: 0x%X/0x%X\n", vendor_id, product_id);
             printf("Error code: %d (%s)\n", i, ftdi_get_error_string(ftdi));
-            printf("Retrying with default FTDI id.\n");
+            printf("Retrying with default FTDI pid=%#04x.\n", default_pid);
 
-            i = ftdi_usb_open(ftdi, 0x0403, 0x6001);
+            i = ftdi_usb_open(ftdi, 0x0403, default_pid);
             if (i != 0)
             {
                 printf("Error: %s\n", ftdi->error_str);