libftdi Archives

Subject: ftdi_usb_get_strings failed

From: "rix.li" <i@xxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Fri, 20 Jan 2017 06:10:48 +0000
I was running the "find_all" example program on MSYS2 MinGW32 with FT232H board from  Adafruit [1]. I've replaced the OEM FTDI driver with libusb-win32, but the program ran into error:

$ ./find_all.exe
Number of FTDI devices found: 1
Checking device: 0
ftdi_usb_get_strings failed: -7 (libusb_get_string_descriptor_ascii() failed)

Since libusb_open() was successful it seems like the driver is actually functioning. So I used USBPcap to probe the connection with my FTDI board.

Here's what happened when the error occurs.

First the host machine sends the following packet to the device for the string descriptor of identifier 0x03.

USB URB
    [Source: host]
    [Destination: 3.28.0]
    USBPcap pseudoheader length: 28
    IRP ID: 0xffffd58002889010
    IRP USBD_STATUS: USBD_STATUS_SUCCESS (0x00000000)
    URB Function: URB_FUNCTION_CONTROL_TRANSFER (0x0008)
    IRP information: 0x00, Direction: FDO -> PDO
    URB bus id: 3
    Device address: 28
    Endpoint: 0x80, Direction: IN
    URB transfer type: URB_CONTROL (0x02)
    Packet Data Length: 8
    [Response in: 442]
    Control transfer stage: Setup (0)
URB setup
    bmRequestType: 0x80
    bRequest: GET DESCRIPTOR (6)
    Descriptor Index: 0x01
    bDescriptorType: 0x03
    Language Id: English (United States) (0x0409)
    wLength: 255

0000   1c 00 10 90 88 02 80 d5 ff ff 00 00 00 00 08 00  ................
0010   00 03 00 1c 00 80 02 08 00 00 00 00 80 06 01 03  ................
0020   09 04 ff 00                                      ....

Then the device replied with a strangely malformed packet:

USB URB
    [Source: 3.28.0]
    [Destination: host]
    USBPcap pseudoheader length: 28
    IRP ID: 0xffffd58002889010
    IRP USBD_STATUS: USBD_STATUS_SUCCESS (0x00000000)
    URB Function: URB_FUNCTION_CONTROL_TRANSFER (0x0008)
    IRP information: 0x01, Direction: PDO -> FDO
    URB bus id: 3
    Device address: 28
    Endpoint: 0x80, Direction: IN
    URB transfer type: URB_CONTROL (0x02)
    Packet Data Length: 18
    [Request in: 441]
    [Time from request: 0.000961000 seconds]
    Control transfer stage: Data (1)
STRING DESCRIPTOR
    bLength: 255
    bDescriptorType: 0xff
[Malformed Packet: USB]
    [Expert Info (Error/Malformed): Malformed Packet (Exception occurred)]

0000   1c 00 10 90 88 02 80 d5 ff ff 00 00 00 00 08 00  ................
0010   01 03 00 1c 00 80 02 12 00 00 00 01 ff ff ff ff  ................
0020   ff ff ff ff ff ff ff ff ff ff ff ff ff ff        ..............

I also compiled and ran the same program on MacOS and the same thing happened.

Comparing to the OEM FTDI driver that I also probed on. When they list the devices with their description strings, the driver never asks the device for string descriptors.

It seems to me that they hard coded those information in their driver thus they just return those data according to the product ID, instead of fetching from the device.

I would also assume that, at least for my device, it doesn't support returning string descriptors to libusb (neither WinUSB).




libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx


Current Thread