libftdi Archives

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

From: Pelle Windestam <pelle@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 24 Oct 2012 11:26:17 +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

I am using Linux 3.2.0 and 3.5.0 on two separate machines, running debian testing. I looked at the strace output but nothing really pops out. No systems calls that are failing. I compared the strace output from when I run libftdi first (not working) and when I use conventional tty access first, but they look the same.

I did some more testing and it appears that it doesn't work with the unmodified FTDI eeprom either as I stated in my first e-mail. In both cases I need to use /dev/ttyUSBx access first to get libftdi-access working.

//Pelle

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