libftdi Archives

Subject: Re: usb bulk write fails

From: Newell Jensen <Newell.Jensen@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Wed, 17 Nov 2010 23:47:10 -0800

Thanks for the reply. �So I researched it some more, both with Python and C programs which give the same response. �I have posted my Python script here��and for the C program I just used the libftdispi at��and I have several things that I would like to point out:

1. If I only try to claim INTERFACE_A, then I get usb_bulk_write fails (no new message shown with dmesg) and program execution does not complete.
2. If I try to claim other interfaces besides INTERFACE_A, usb_bulk_write works and the program completes execution but I get a message in dmesg that says this:

[ 1129.201072] usb 2-6: usbfs: process 13739 (spitest) did not claim interface 1 before use

3. If I try to claim interfaces A-D (I have the FT4232), then the same thing happens as in 2 above where I get program to complete execution and a new message in dmesg is shown. �This leads me to believe that INTERFACE_A is claimed here?

So here is my question ...�Does the dmesg message as talked about in 2 above a concern? �Or is this normal behavior?

I haven't gotten far enough yet to test whether I do actually have control over all the interfaces and that is my next step but if you see anything of concern, let me know.


On Wed, Nov 17, 2010 at 11:49 AM, Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx> wrote:
Hello Newell,

On 11/08/2010 04:27 AM, Newell Jensen wrote:
>>>> buf0 = chr(ftdi.TCK_DIVISOR) # command "set divisor"
>>>> buf1 = chr(div & 0xFF) �# NOTE: I have also tried using chr((div >> 0) & 0xFF) as well
>>>> buf2 = chr(((div >> 8) & 0xFF))
>>>> buf = buf0 + buf1 + buf2
>>>> ftdi.ftdi_write_data(ftdic, buf, 3)
> -110
> So that is one issue I run into. �That is, where the disabling of the 5X works but the other clock divisor setting doesn't. �Something interesting is if I do the above without disabling the 5X, then it works. �Any ideas on this?

Hmm. No idea right now. Could you come up
with a small C example code to demonstrate the issue?

> 2. The second issue I run into is setting the loopback after setting the clock divisor above (so I am not disabling the 5X so that I proceed on in my script to the loopback setting). �When I go to disable or enable the loopback I get usb bulk write fail from the command below:
>>>> ftdi.ftdi_write_data(ftdic, chr(ftdi.LOOPBACK_START), 1)
> Any help would be greatly appreciated as at this point I am just scratching my head.

Never used that either. Though I'm not sure
if the ftdi.ftdi_write_data is the correct function
when using the python wrapper: ftdi_write_data() calls
usb_bulk_write(). Configuration changes inside
libftdi are normally communicated via usb_control_msg()
and also feature different "requests". Not sure
how you emulated that via the python wrapper??


libftdi - see for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx

libftdi - see for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx

Current Thread