libftdi Archives

Subject: Re: usb bulk read failed

From: Anders Larsen <al@xxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 14 Feb 2017 13:41:39 +0100
On Saturday, 2017-02-11 07:21 Eric Schott wrote:
> On Fri Feb 10, 2017, John Hein wrote:
> 
> > Yep, the ftdio_sio driver was loaded.  'sudo rmmod ftdio_sio' before
> > running my program to bang the bits resolved the 'usb bulk write
> > failed' failure.
> >
> > I have some follow on question(s) for the list in light of this:
> >
> > I have a regular uart serial port that I do want to use (need
> > ftdio_sio / usbserial modules loaded).
> >
> > What is the desired way to ...
> >
> > (a) ... allow ftdi_sio and libftdi to coexist peacefully?  ... that
> >     is, without having to unload the driver to do libftdi stuff, and
> >     reload the driver to do usbserial (uart) stuff.
> 
> To the best of my understanding, this is not possible if the serial port
> and the bitbang port are on the same FT4243H chip.

It is not as simple as unloading the ftdi_sio driver, but it is not too
difficult either.

In our scenario we use MPSSI on one port of an FT4232H, bitbanging on
another and plain ftdi_sio on the last two ports.
We accomplish this by "unbinding" ftdi_sio from the first two ports
using the udev rule below:

 /etc/udev/rules.d/42-ftdi-serial.rules:
 ACTION!="add", GOTO="serial_end"
 ATTRS{bInterfaceNumber}=="00", RUN+="/usr/local/sbin/unbind-ftdi.sh %k"
 ATTRS{bInterfaceNumber}=="01", RUN+="/usr/local/sbin/unbind-ftdi.sh %k"
 LABEL="serial_end"

 /usr/local/sbin/unbind-ftdi.sh:
 #!/bin/sh --
 echo $1 > /sys/bus/usb/drivers/ftdi_sio/unbind

(you cannot redirect stdout or use pipes in the udev RUN value)

HTH,
cheers
Anders


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

Current Thread