-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FTDI USB Serial Hangs #88
Comments
I can confirm that at least some FTDI chips work, because I have successfully used the one built into an Arduino Nano for a serial connection, although I don't know if this is a different chip or just a different circuit that it is connected to. I have had latency problems with it however if I try to use it at above 9600 baud. |
Yes, The large interrupt requirement slows down the processor Work is progressing Gordon On 09/09/2012, Austin S. Hemmelgarn [email protected] wrote:
Sent from my mobile device |
I try to use it at 9600 baud, and it hangs immediately. |
No, I've got one here and am working on it... Gordon On 12/09/2012, Jean-Francois Romang [email protected] wrote:
Sent from my mobile device |
The NAK holdoff fix added to kernel a few days ago may fix this. Please update and test. |
I'm running Linux raspberrypi 3.2.27+ #171 PREEMPT I got a FT232BM (embedded in a card reader), the device is discovered correctly, but when accessing /dev/ttyUSB0 the RPi just hangs. When forcing usb to full speed in cmdline.txt as described here; http://www.raspberrypi.org/phpBB3/viewtopic.php?p=164633#p164633 the device works as expected, but performance of usb full speed in not acceptable. |
We have a tried all mentioned boot command line and sysctl changes from here and the forums with an FT232BM. No luck for us so far. Has someone tried the capacitors mentioned in the FTDI knowledgebase with success? Is FTDI aware of the problems with RPi? |
Jbravo2 found that forcing usb to full speed fixed the problem for him, (this suggests it is an interrupt overhead issue) can you make sure that this is working properly? You should see a severe reduction in the ethernet throughput if you've set the cmdline parameter correctly. Gordon |
With dwc_otg.speed=1 the RPi hangs on boot for me. (Newest firmware and dist-upgrade.) |
Even if its not plugged in? Gordon From: Markus Becker [mailto:[email protected]] With dwc_otg.speed=1 the RPi hangs on boot for me. (Newest firmware and dist-upgrade.) — |
Even then. It waits quite some time on "configuring network" and does not take input from the USB keyboard when the login finally shows up. Without dwc_otg.speed=1 it boots fine, but hangs on using the FT232BM. Markus |
I used the ftdi_sio driver before. Now I followed the step on the official web site and use the d2xx driver. I downloaded the d2xx package (Link) and followed the steps on the readme file (Link). However the library doesn't work. After finding the correct library online I tried to run the C program in the d2xx package. I ran the read program (release/examples/EEPROM/read/read). It provided me the information below: Signature1 = 0 232R:
Returning 0 Then I looped the program in a bash script (while true; do ./read; sleep 2; done). After 5 minutes the system crashed with the same DMA error ("handle_hc_chhltd_intr_dma"). The DMA error is described here: |
I have also checked against kernel 3.6.1+ and it hangs there as well. |
I just discovered this issue while trying to get the Raspberry Pi to program an ATMEGA328 via a USB serial cable. Is it working on the 512MB Raspberry Pi's? |
Looks like my issue is fixed in the latest raspberry pi firmware (3.6.11+ #414 PREEMPT). Thanks guys, now I can program it without it freezing. |
Can anyone else still suffering from this issue try latest (rpi-update) firmware? |
No reports of it still failing, so closing. Reopen if the problem still exists with latest kernel. |
It seems like the hangs are back. There's no lockup of the Pi, but the serial interface stops responding after some time. To remove most of error sources I made this simple test setup differentt arduinos <-> different USB to serial FTDI Adapters <-> minicom on RPI3 as terminal It has been tried with different serial adapters, different arduinos and different raspis. The results are:
Also I tried it with another RPI1 B. It responds immediately and doesn't seem to have that issues, but it has an out-dated firmware running. |
Can you identify the kernel version of the working Pi? |
I think it was "4.1.12 Oct 28 2016", but I can check back on monday, when I'm back at work. If I can provide other information that helps narrowing it down, let me know. |
Find the exact kernel version that worked to begin with. |
I could help with testing, as I started using FTDI USB-to-serial adapters on a Raspberry Pi 2B recently. Usually I am running it with either 9600 Baud (8-N-1) or 57600 Baud. I am not using any handshaking. Readout is done using the nice python library PySerial. With my limited experience I did not encounter any issues yet. |
Good to here that it might not be a problem in general. |
So the issue occurred between 4.1.13 and 4.1.19? Can you identify the exact update which caused this. See: If you click on each commit the end of the url contains a git hash. Run |
Weird thing. I downgraded the RPI 1 B+ to 4.1.13 and the lags were still showing. Side-note: |
This still happens. Rpi 3, latet jessie as of today. |
I think I'm seeing this. I'm trying to communicate between a RPi3 and an Arduino Uno using Pyserial. My baud is 57600, and if I only transmit a couple bytes a minute, it works fine, but when I try to send a few KB, it hangs after a couple minutes. My Arduino toggles an LED every second, which keeps toggling even after the Pi reports a serial hang, so I know it's not the Arduino crashing or getting hung up with buffer overflows. However, Pyserial's reporting that all writes and reads timeout. If I programmatically reset the serial connection by toggling DTR, that temporarily fixes it, but the hang soon happens again. |
Since this problem is still occurring, can someone please re-open this? |
It's quite possible this is a problem with Pyserial. Is it possible to test this using another library, or perhaps directly with Linux and/or C code? Also, which kernel version are you using? |
I'm getting this with basic open()/tcgetattr()/cfmakeraw()/tcsetattr() control. |
An odd thing I've noticed is that after a fresh reboot, my Pi and Arduino can communicate just fine. I let it run for 12 hours, and the serial port didn't hang at all. Then I stopped by Pyserial script, disconnected the Arduino, connected it to my development laptop, re-uploaded the identical code (no firmware was changed), then reconnected it to my Pi and re-ran the Pyserial code...and it started having connection problems almost immediately. It still worked for a couple minutes, but my Pyserial script reported a lot more intermittent timeouts and corrupted checksums until finally the port completely froze. I then rebooted my Pi, and although the code was unchanged, it again worked. My pyserial code runs fine for hours...until I disconnect and then reconnect the Arduino. I stumbled across this behavior while testing various tweaks to /boot/cmdline.txt. I noticed that every time I tested a new configuration, it always seemed to work fine, but when I disconnected and reconnected the Arduino, it then suddenly started to fail, even if I didn't change any firmware on the Arduino. Is there some OS daemon (udev maybe?) running on the Pi that needs to be restarted after a USB device is removed? |
The hang-after-reconnect problem seems to go away when I add
I tried virtually every other option before I tried |
Problem detail : http://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=8010
I, like a few others, have been having various problems using USB/Serial adapters with RPi. One of them is the FTDI adapter and so far my search for an answer has been unsuccessful.
The problem is the device is recognised by RPi and lists correctly from dmesg
usb 1-1.2.3: new full speed USB device number 5 using dwc_otg
usb 1-1.2.3: New USB device found, idVendor=0403, idProduct=6001
usb 1-1.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.2.3: Product: USB <-> Serial
usb 1-1.2.3: Manufacturer: FTDI
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for FTDI USB Serial Device
ftdi_sio 1-1.2.3:1.0: FTDI USB Serial Device converter detected
usb 1-1.2.3: Detected FT232BM
usb 1-1.2.3: Number of endpoints 2
usb 1-1.2.3: Endpoint 1 MaxPacketSize 64
usb 1-1.2.3: Endpoint 2 MaxPacketSize 64
usb 1-1.2.3: Setting MaxPacketSize 64
usb 1-1.2.3: FTDI USB Serial Device converter now attached to ttyUSB0
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
But as soon as you try to access the device it hangs the RPi requiring a reset.
I do not know what the problem is, the FTDI driver has been part of the kernel for some time, the avenue I am pursuing now is that the driver is not ARM compatible, the FTDI web site doesn't list an ARM linux driver (cant say if that's even relevant).
There is this http://www.ftdichip.com/Support/Documen ... ndroid.pdf regarding cross compiling to ARM (for Android).
So my train of thought is that the current driver is not ARM compatible and requires compiling for ARM, with all that entails and the pitfalls associated.
However I may be barking up completely the wrong tree so any more experienced kernel/driver peeps with a thought?
The text was updated successfully, but these errors were encountered: