I downloaded the development files for libftdi and found some example code that I made trivial hack on to get the serial numbers. With serial numbers OpenOCD does allow two instances to run, Of course you need different port numbers.
Here’s part of my two config files:
config #1
telnet_port 4444
gdb_port 3333
daemon_startup reset
JTAG Interface Configuration
interface ft2232
ft2232_device_desc “Amontec JTAGkey”
ft2232_layout jtagkey
ft2232_vid_pid 0x0403 0xcff8
ft2232_serial “T1P3S2ST”
config #2
telnet_port 5555
gdb_port 2222
daemon_startup reset
JTAG Interface Configuration
interface ft2232
ft2232_device_desc “Amontec JTAGkey”
ft2232_layout jtagkey
ft2232_vid_pid 0x0403 0xcff8
ft2232_serial “T1Q9O61Z”
----------------------- here is the source file -------------------------
/* find_all.c
Example for ftdi_usb_find_all()
This program is distributed under the GPL, version 2
I found this in /usr/share/doc/libftdi-dev/examples
on my Ubuntu system and modified it to print the serial number.
This worked to generate the executable:
gcc find_all.c -lftdi -o find_all
</Smead says:>
*/
#include <stdio.h>
#include <ftdi.h>
int main(int argc, char **argv)
{
int ret, i;
struct ftdi_context ftdic;
struct ftdi_device_list *devlist, *curdev;
char manufacturer[128], description[128];
char serial[128];
ftdi_init(&ftdic);
if((ret = ftdi_usb_find_all(&ftdic, &devlist, 0x0403, 0xcff8)) < 0) {
fprintf(stderr, “ftdi_usb_find_all failed: %d (%s)\n”, ret, ftdi_get_error_string(&ftdic));
return EXIT_FAILURE;
}
printf(“Number of FTDI devices found: %d\n”, ret);
i = 0;
for (curdev = devlist; curdev != NULL; i++) {
printf(“Checking device: %d\n”, i);
if((ret = ftdi_usb_get_strings(&ftdic, curdev->dev, manufacturer, 128, description, 128, serial, 128)) < 0) {
fprintf(stderr, “ftdi_usb_get_strings failed: %d (%s)\n”, ret, ftdi_get_error_string(&ftdic));
return EXIT_FAILURE;
}
printf(“Manufacturer: %s, Description: %s, Serial %s\n\n”, manufacturer, description, serial);
curdev = curdev->next;
}
ftdi_list_free(&devlist);
ftdi_deinit(&ftdic);
return EXIT_SUCCESS;
}