2 Nov 2009 05:29
FT2232H bug: wrong maxpacket at full speed
David Brownell <david-b <at> pacbell.net>
2009-11-02 04:29:56 GMT
2009-11-02 04:29:56 GMT
When running an FT2232H at full speed, we saw a new failure mode that
turned out to be a bug in libftdi. Current git:
int ftdi_read_data(struct ftdi_context *ftdi, unsigned char *buf, int size)
{
int offset = 0, ret = 1, i, num_of_chunks, chunk_remains;
int packet_size;
// New hi-speed devices from FTDI use a packet size of 512 bytes
if (ftdi->type == TYPE_2232H || ftdi->type == TYPE_4232H)
packet_size = 512;
else
packet_size = 64;
....
So there's a clear and *INCORRECT* assumption that highspeed-capable
devices are never going to run at full speed, where packet_size != 512
but instead is the traditional 64 bytes (on these chips).
Failure mode: two-byte "modem" status codes bubbling up in the middle
of JTAG transactions. Rude...
I have no patch for this; just reporting the bug. It's clearly fixable
on Linux, which is our priority (OpenOCD, for JTAG) by asking sysfs for
the device's "speed" attribute (12 or 480 MHz), or (more awkwardly) the
endpoint's wMaxPacketSize. Other operating systems -- no comments.
- Dave
(Continue reading)
RSS Feed