G'day,

Below is a patch for src/jtag/drivers/ft2232.c.  In openocd-0.7.0, the
VendorID and Product are displayed in decimal.  I'm accustomed to
seeing them in form 0xABCD:0xABCD.  The patch separates the two IDs and
prints them in hex.

--- src/jtag/drivers/ft2232.c.orig      2013-04-28 03:42:17.000000000
-0400 +++ src/jtag/drivers/ft2232.c     2013-05-16
20:00:24.000000000 -0400 @@ -402,6 +402,9 @@
 
 #define FT2232_BUFFER_SIZE 131072
 
+#define VID(v) ( v >> 16 ) & 0xFFFF
+#define PID(v) ( v       ) & 0xFFFF
+
 static uint8_t *ft2232_buffer;
 static int ft2232_buffer_size;
 static int ft2232_read_pointer;
@@ -2195,7 +2198,7 @@
                unsigned type_index = ((unsigned)ftdi_device <= \
no_of_known_types) ? ftdi_device : FT_DEVICE_UNKNOWN;
                LOG_INFO("device: %" PRIu32 " \"%s\"", \
(uint32_t)ftdi_device, type_str[type_index]);
-               LOG_INFO("deviceID: %" PRIu32, (uint32_t)deviceID);
+               LOG_INFO("deviceID: %04X:%04X", VID(deviceID), \
PID(deviceID) ); LOG_INFO("SerialNumber: %s", SerialNumber);
                LOG_INFO("Description: %s", Description);
        }
 
I've also noticed that this code displays the SerialNumber for my
OpenJTAG (from 100ASK.com) as garbage.  Other linux utilities show my
OpenJTAG's Serial Number as "0".  I'm guessing that there is _no_
serial number and libftdi (wich supplies the device info) doesn't
return a pointer to a NUL byte (as it should).

Regards,

David

P.S. Sorry for the truncated subject of the first email :-<

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to