libftdi Archives

Subject: Re: libftdi only works if /dev/ttyUSBx is accessed by other method first

From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Wed, 24 Oct 2012 11:11:32 +0200
>>>>> "Pelle" == Pelle Windestam <pelle@xxxxxxxxx> writes:

    Pelle> Hello, I am using libftdi to access a FTDI 2232D chip. I have two
    Pelle> configurations of the 2232D, in one case it is completely
    Pelle> unmodified, and in the other case it is configured to be used as
    Pelle> a JTAG debug board
    Pelle> (http://wiki.openmoko.org/wiki/Debug_Board_v2). In both of these
    Pelle> cases one of the FTDI UARTs is connected to a RS-485 transceiver.

    Pelle> I am experiencing problems with the second case, the debug
    Pelle> board. If I connect the FTDI-device and try to communicate using
    Pelle> libftdi, it does not work. I can successfully open the device,
    Pelle> but I cannot communicate with my external device (over
    Pelle> RS-485). If I print out what I read back from the serial port I
    Pelle> am flooded with data containing only zeroes (nothing from the
    Pelle> external device). After my application is finished, the ttyUSBx
    Pelle> device has been removed from /dev.

    Pelle> While troubleshooting this I discovered that if I communicate
    Pelle> using /dev/ttyUSBx (open(), write(), close()) it works
    Pelle> perfectly. I also discovered that if I use this method first, I
    Pelle> can use the libftdi afterwards. Upon reconnection it fails again
    Pelle> if I try to use libftdi first.

    Pelle> I have tried this using libftdi-0.2 and libftdi from the git
    Pelle> repo. Any ideas?

What OS are you using. Perhaps you can find with "strace" the failing system
call? I suspect that some prerequisite for libusb is missibg in one case.

Bye
-- 
Uwe Bonnes                bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

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

Current Thread