alex87
Posts: 3
Joined: Tue Aug 07, 2012 5:12 pm

Re: FTDI USB Serial Hangs

Tue Sep 25, 2012 4:29 pm

Hi, after 3 hours of test the system is now stable and don't hangs anymore after accessing the device "USB to RS485" with the chip FT232RL.
After a clean installation, I have updated the system with the last firmware with the command:

Code: Select all

sudo rpi-update
sudo apt-get update
sudo apt-get dist-upgrade
Then I have added only this to the end of the line of the file /boot/cmdline.txt:

Code: Select all

dwc_otg.speed=1
[Optional] I have overclocked the system to 800Mhz with the simple procedure in:

Code: Select all

sudo raspi-config
That's all. Now Raspberry Pi with 123Aurora 1.5.0 works perfectly. ;)
For now the patch is sufficent, but I still waiting a final release that resolve the problem with the usb permanently.

dennyfmn
Posts: 27
Joined: Thu Aug 16, 2012 1:36 pm

Re: FTDI USB Serial Hangs

Thu Sep 27, 2012 1:03 pm

Following suggestions at

http://www.raspberrypi.org/phpBB3/view ... &p=164658
USB/serial converters very broken on Pi

I added these parameters to the beginning of my cmdline.txt

dwc_otg.speed=1 dwc_otg.microframe_schedule=1 dwc_otg.fiq_fix_enable=1 sdhci-bcm2708.sync_after_dma=0

I am running kernel dated Mon Sep 17, from the Raspberry Pi foundation that supports overclocking without voiding your warranty. My unit runs fine at 950 MHz.

Checked the nak_holdoff_enable parameter

/sys/module/dwc_otg/parameters/nak_holdoff_enable = Y

My looping test with a Smarthome Insteon PLM (Power Line Modem) with embedded Future Technology Devices International, Ltd FT232 USB-Serial (UART) hung after 4.72 hr. The test cycles an ApplicanceLinc on/off every 3 seconds. This is an improvement, but did not solve the problem.

The dwc_otg.speed=1 parameter really clobbered the network throughput. Testing with iperf it went from 93.5 Mbits/sec before the change to 7.84 Mbits/sec after adding dwc_otg.speed=1.

Jbravo
Posts: 3
Joined: Fri Sep 21, 2012 8:13 am

Re: FTDI USB Serial Hangs

Thu Sep 27, 2012 8:18 pm

dwc_otg.speed=1 forces usb full-speed (12 Mbit/s), otherwise the usb is running at hi-speed (480 Mbit/s). And since the nic is connected internally via usb there will be a BIG performance penalty with this workaround.

/j

meknow0
Posts: 2
Joined: Mon Sep 17, 2012 10:13 am

Re: FTDI USB Serial Hangs

Fri Sep 28, 2012 9:02 am

Jbravo wrote:dwc_otg.speed=1 forces usb full-speed (12 Mbit/s), otherwise the usb is running at hi-speed (480 Mbit/s). And since the nic is connected internally via usb there will be a BIG performance penalty with this workaround.

/j
I quite agree. I tried the "dwc_otg.speed=1" suggestion, but I was then lucky if the pi booted up at all. It usually just spewed out errors about faulty devices or cables, so wasn't talking to my USB hub or keyboard or mouse. I had to plug the SD card into another PC so I could remove the dwc_otg bit again.

On a good note. My system is now working after installing the 18th September Raspian Wheezy. I'm using a USB FT232R adapter (might be FT232RL but the specs don't say so.) My early post about trying to install drivers from FTDI is now irrelevant and unnecessary. The built in support is enough. No extra drivers required. (Unfortunately, I had sent a question direct to FTDI about their installation instructions, especially failing to run the ./read.py example, but the unimpressive reply I got was just a copy of the same set of installation instructions! So I'm glad these drivers were not required.)

I've only been running a day and have had issues with ssh sessions failing so needing a power cycle. This could have been provoked by my cron job having issues. I'm not sure, only time will show if it's stable.

For anyone interested, my adapter actually talks RS485 out of an RJ45 socket. Internally the 232 chip talks to 2xMAX485 chips for bidirectional comms. I had a hard job getting this to talk to my inverter, since the pin-outs given were wrong. (It was £8 from china so what did I expect!) I actually fried the adapter initially, but got a very useful friend to replace the blown bits, hence when dismantling, it became apparent the pin-out was wrong. So this is just a suggestion to others with problems - don't assume the Pi is faulty, it could be the wiring. I actually checked everything from a Windows XP laptop!

Anyway, I've written some python to talk to a Fronius IG36TL inverter to log data from my solar panels to local files and to the PVoutput.org website. No additional expensive modules from Fronius were needed as the inverter has an RS485 socket (perhaps RS422?). I'm happy to share the details on request until I find somewhere to post it. The Pi automatically connects to my router wirelessly with an Ralink RT5370 USB adapter. Just like the serial adapter this worked with Raspbian with no extra drivers required.
The only installs I've done were a generic update/upgrade (what's the difference?) and the python-serial module. I hope this is useful to others.

hajj_3
Posts: 58
Joined: Mon Aug 22, 2011 7:42 pm

Re: FTDI USB Serial Hangs

Sat Sep 29, 2012 11:39 am

There is a newer PL2303HX Rev D out btw, hardly any devices use this chi, most use the revision A. This new version works on windows 8 too, maybe you should give it a try: http://www.ebay.co.uk/itm/Prolific-PL-2 ... 43b3dd5540

pretty expensive at £10 delivered but maybe 1 of you could give it a try.

gonesurfing
Posts: 7
Joined: Wed Aug 22, 2012 1:13 am

Re: FTDI USB Serial Hangs

Thu Oct 04, 2012 12:44 am

All,

I had things running fine... and then I updated.

Sunday night I ran apt-get upgrade, apt-get update and since then, the pi hangs while reading serial data through a perl script. I previously had this same script running for several weeks without issue.

Each time the pi crashes, i can't ping or ssh into it and since I'm headless there isn't much to do but cycle the power. Once it's back up, my message log is full of the following error:

Code: Select all

Oct  2 03:03:05 raspberrypi kernel: [14306.427877] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114
So something in the latest update broke my system. Unfortunately I don't know what version I had last updated to which was working so well. ANY suggestions on where to start would be helpful.

Code: Select all

me@raspberrypi /var/log $ uname -a
Linux raspberrypi 3.2.27+ #160 PREEMPT Mon Sep 17 23:18:42 BST 2012 armv6l GNU/Linux[/code
]
[code]Oct  1 00:20:41 raspberrypi kernel: [    3.188432] usb 1-1.3: new full-speed USB device number 4 using dwc_otg
Oct  1 00:20:41 raspberrypi kernel: [    3.324940] usb 1-1.3: New USB device found, idVendor=0403, idProduct=6001
Oct  1 00:20:41 raspberrypi kernel: [    3.348221] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Oct  1 00:20:41 raspberrypi kernel: [    3.357987] usb 1-1.3: Product: FT232R USB UART
Oct  1 00:20:41 raspberrypi kernel: [    3.378243] usb 1-1.3: Manufacturer: FTDI
Oct  1 00:20:41 raspberrypi kernel: [    3.384594] usb 1-1.3: SerialNumber: A4013F6G
Oct  1 00:20:41 raspberrypi kernel: [    4.681235] usbcore: registered new interface driver usbserial
Oct  1 00:20:41 raspberrypi kernel: [    4.773330] USB Serial support registered for generic
Oct  1 00:20:41 raspberrypi kernel: [    4.898172] usbcore: registered new interface driver usbserial_generic
Oct  1 00:20:41 raspberrypi kernel: [    4.907204] usbserial: USB Serial Driver core
Oct  1 00:20:41 raspberrypi kernel: [    5.273709] USB Serial support registered for FTDI USB Serial Device
Oct  1 00:20:41 raspberrypi kernel: [    5.587957] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected
Oct  1 00:20:41 raspberrypi kernel: [    5.701983] usb 1-1.3: Detected FT232RL
Oct  1 00:20:41 raspberrypi kernel: [    5.759287] usb 1-1.3: Number of endpoints 2
Oct  1 00:20:41 raspberrypi kernel: [    5.766043] usb 1-1.3: Endpoint 1 MaxPacketSize 64
Oct  1 00:20:41 raspberrypi kernel: [    5.915245] usb 1-1.3: Endpoint 2 MaxPacketSize 64
Oct  1 00:20:41 raspberrypi kernel: [    6.018255] usb 1-1.3: Setting MaxPacketSize 64
Oct  1 00:20:41 raspberrypi kernel: [    6.098562] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0
Oct  1 00:20:41 raspberrypi kernel: [    6.177596] usbcore: registered new interface driver ftdi_sio
Oct  1 00:20:41 raspberrypi kernel: [    6.227585] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver

iant1945
Posts: 18
Joined: Fri Oct 05, 2012 9:14 am

Re: FTDI USB Serial Hangs

Wed Oct 10, 2012 7:38 am

< meknow0 » Fri Sep 28, 2012 10:02 am
I tried the "dwc_otg.speed=1" suggestion, but I was then lucky if the pi booted up at all. It usually just spewed out errors about faulty devices or cables, so wasn't talking to my USB hub or keyboard or mouse. I had to plug the SD card into another PC so I could remove the dwc_otg bit again.
On a good note. My system is now working after installing the 18th September Raspian Wheezy. >

I come from Delphi under Windows, so I'm a complete newbie to Python and Raspian. I've written a Python program to talk to my burglar alarm system via a USB cable. I've had a similar experience to meknow0 - my program worked with the "dwc_otg.speed=1" patch (but not otherwise), but then it locked up totally (USB cable unplugged and no keyboard response) on a reboot (using the 18th September Raspbian which came with the package). I posted to the "elephant" thread, but I'm re-posting here in case anyone can help me.

Is it possible to switch on the "dwc_otg.speed=1" setting at run-time from within my Python program, talk to the alarm board, then re-set it to =0 (presumably within try .. finally block) ?

Also, I assume that the RPi people are aware of the bug, but is there a way of promoting the bug report so that it gets fixed as soon as possible ?

gonesurfing
Posts: 7
Joined: Wed Aug 22, 2012 1:13 am

Re: FTDI USB Serial Hangs

Fri Oct 12, 2012 1:54 am

gonesurfing wrote:All,

I had things running fine... and then I updated.

Sunday night I ran apt-get upgrade, apt-get update and since then, the pi hangs while reading serial data through a perl script. I previously had this same script running for several weeks without issue.

Each time the pi crashes, i can't ping or ssh into it and since I'm headless there isn't much to do but cycle the power. Once it's back up, my message log is full of the following error:

Code: Select all

Oct  2 03:03:05 raspberrypi kernel: [14306.427877] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114
So something in the latest update broke my system. Unfortunately I don't know what version I had last updated to which was working so well. ANY suggestions on where to start would be helpful.

Code: Select all

me@raspberrypi /var/log $ uname -a
Linux raspberrypi 3.2.27+ #160 PREEMPT Mon Sep 17 23:18:42 BST 2012 armv6l GNU/Linux[/code
]
[code]Oct  1 00:20:41 raspberrypi kernel: [    3.188432] usb 1-1.3: new full-speed USB device number 4 using dwc_otg
Oct  1 00:20:41 raspberrypi kernel: [    3.324940] usb 1-1.3: New USB device found, idVendor=0403, idProduct=6001
Oct  1 00:20:41 raspberrypi kernel: [    3.348221] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Oct  1 00:20:41 raspberrypi kernel: [    3.357987] usb 1-1.3: Product: FT232R USB UART
Oct  1 00:20:41 raspberrypi kernel: [    3.378243] usb 1-1.3: Manufacturer: FTDI
Oct  1 00:20:41 raspberrypi kernel: [    3.384594] usb 1-1.3: SerialNumber: A4013F6G
Oct  1 00:20:41 raspberrypi kernel: [    4.681235] usbcore: registered new interface driver usbserial
Oct  1 00:20:41 raspberrypi kernel: [    4.773330] USB Serial support registered for generic
Oct  1 00:20:41 raspberrypi kernel: [    4.898172] usbcore: registered new interface driver usbserial_generic
Oct  1 00:20:41 raspberrypi kernel: [    4.907204] usbserial: USB Serial Driver core
Oct  1 00:20:41 raspberrypi kernel: [    5.273709] USB Serial support registered for FTDI USB Serial Device
Oct  1 00:20:41 raspberrypi kernel: [    5.587957] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected
Oct  1 00:20:41 raspberrypi kernel: [    5.701983] usb 1-1.3: Detected FT232RL
Oct  1 00:20:41 raspberrypi kernel: [    5.759287] usb 1-1.3: Number of endpoints 2
Oct  1 00:20:41 raspberrypi kernel: [    5.766043] usb 1-1.3: Endpoint 1 MaxPacketSize 64
Oct  1 00:20:41 raspberrypi kernel: [    5.915245] usb 1-1.3: Endpoint 2 MaxPacketSize 64
Oct  1 00:20:41 raspberrypi kernel: [    6.018255] usb 1-1.3: Setting MaxPacketSize 64
Oct  1 00:20:41 raspberrypi kernel: [    6.098562] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0
Oct  1 00:20:41 raspberrypi kernel: [    6.177596] usbcore: registered new interface driver ftdi_sio
Oct  1 00:20:41 raspberrypi kernel: [    6.227585] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
Setting dwc_otg.fiq_fix_enable=0 in /boot/cmdline.txt seems to have helped. It's been 24 hours without a crash.

winstonma
Posts: 11
Joined: Tue Jun 05, 2012 10:01 am

Re: FTDI USB Serial Hangs

Mon Oct 29, 2012 4:49 am

According to the press release from FTDI, RPi was supported officially.

Also they created 2 products
1. USB to Serial Cable, using FT232R
2. USB to Serial Module, using FT2232H

I assume that FT232R is supported in RPi.

Press Release:
http://www.ftdichip.com/Corporate/FTPress.htm (Check June 2012)

winstonma
Posts: 11
Joined: Tue Jun 05, 2012 10:01 am

Re: FTDI USB Serial Hangs

Tue Nov 06, 2012 9:39 am

Hi all,

I posted a kernel request on github.
https://github.com/raspberrypi/linux/issues/40

And the fix is being submitted and compiled. I updated the kernel (to version #257) and the dma issue is gone.

Please use rpi-update to update your kernel. And see if it works for you guys. Good luck.

rickthenick
Posts: 3
Joined: Sun Nov 04, 2012 7:50 pm

Re: FTDI USB Serial Hangs

Thu Nov 08, 2012 11:49 pm

I am still having problems after updated with rpi-update.

Code: Select all

root@raspberrypi:~# uname -a
Linux raspberrypi 3.2.27+ #260 PREEMPT Thu Nov 8 00:34:12 GMT 2012 armv6l GNU/Linux
To easy reproduce the error I do the following:
  • Connect the USB-serial device (tested two different both using "FT232 USB-Serial (UART) IC")
  • Run "watch -n1 stty -F /dev/ttyUSB0"
The system hangs often within 30 minutes, but always within a few hours. I get the same result when doing interaction with the serial port from my c-program, but it is easier with just "stty".

Anyone else that can reproduce this error?

kilroy1205
Posts: 7
Joined: Wed Sep 12, 2012 3:21 pm

Re: FTDI USB Serial Hangs

Fri Nov 09, 2012 11:44 pm

Anyone else that can reproduce this error?
Hi,

yes same problem here it is working 15 or 20 minutes then the pi is hanging again.
I use two Serial Converter,
FT232RL and FT232BM

Code: Select all

Linux raspberrypi 3.2.27+ #260 PREEMPT Thu Nov 8 00:34:12 GMT 2012 armv6l GNU/Linux
Regards
Sven

Naza
Posts: 2
Joined: Mon Sep 24, 2012 7:01 pm

Re: FTDI USB Serial Hangs

Sat Nov 10, 2012 9:46 pm

I too had it working (well sort off) all be it hanging occasionally every few days with the:

dwc_otg.speed=1 in cmdline.txt

but since latest rpi-update Pi is now hanging immediately after boot as soon as my application (heyu) accesses the FTDI serial converter.

Gone back to my safe SD card image for the moment until i can spare some time to further investigate.

rickthenick
Posts: 3
Joined: Sun Nov 04, 2012 7:50 pm

Re: FTDI USB Serial Hangs

Thu Nov 15, 2012 1:01 am

I found a work-around that works for my application....
Perhaps this could work for some of you other people with similar problem.

I am using libmodbus and I have now rewritten the c program so it just open the USB once (see code below) and is then reading values from the modbus in a loop without ever open och closing the USB again.

Code: Select all

ctx = modbus_new_rtu("/dev/ttyUSB0", 9600, 'N', 8, 1);
I have now read values from the bus every 100 millisecond for a couple of days without any problems. Before this it hang about every 20 - 200 minute when I try to read every 60 sec.

So it seems like the serial hangs problem is just coming when doing "stty" (see earlier reply) or open the device, not while doing intensive data reading.

Astrall
Posts: 1
Joined: Fri Nov 16, 2012 1:08 pm

Re: FTDI USB Serial Hangs

Fri Nov 16, 2012 1:18 pm

Hello,
I use raspberry and KMtronic USB 1 Relay and this command works for me very well:

stty -F /dev/ttyUSB0 cs8 9600
echo -e "\xFF\x01\x01" > /dev/ttyUSB0
echo -e "\xFF\x01\x00" > /dev/ttyUSB0

Regards

geoffnet
Posts: 1
Joined: Sat Nov 17, 2012 1:16 pm

Re: FTDI USB Serial Hangs

Sat Nov 17, 2012 1:25 pm

I've had the same problems with an FT2DI chip (older model FT232BM) anyhow I found a workaround on another thread kindly supplied by obcd.By dropping the USB speed to v1.1 this stopped the Pi hanging when the USB device was accessed.

http://www.raspberrypi.org/phpBB3/viewt ... 28&t=17009
You could try the softfloat wheezy download and see if it makes a difference.
Another thing you can try is setting the usb speed to 1.1 in /boot/cmdline.txt.
I have ftdi devices that simply make the Pi hang if you access them. On usb 1.1 speed, they work fine.
Adding dwc_otg.speed=1 to /boot/cmdline.txt and rebooting should do the trick. It's no solution but it would be interesting to see if it fixes your problem.

HerpaMoTeH
Posts: 26
Joined: Tue Apr 17, 2012 7:14 am

Re: FTDI USB Serial Hangs

Mon Nov 19, 2012 7:13 am

Hey guys,
Can someone who has compiled a kernel, that doesn't freeze whenever the USB converter is accessed, share it trough a link, dropbox or something like that ? Thanks :)

P.S. I tried compiling the kernel and after it was compiled it continued freezing when I access the USB converter.

kumme74
Posts: 6
Joined: Thu Sep 27, 2012 6:40 pm

Re: FTDI USB Serial Hangs

Mon Nov 19, 2012 9:04 am

Yes, a compiled kernel would be very helpfull for testing. This DMA issue drives me nuts.

@HerpaMo: Did you use the patch from MP33 from 9th of November?
http://www.raspberrypi.org/phpBB3/viewt ... 0&start=25

Klaus

sanders
Posts: 6
Joined: Sun Mar 11, 2012 7:38 am

Re: FTDI USB Serial Hangs

Thu Nov 29, 2012 7:23 am

Just an average python user. Way not technical enough to solve this.
But I really hope someone can solve this.

This issue makes my raspberry way less useable.... unfortunately.

Sander.

yxoman
Posts: 6
Joined: Tue Dec 04, 2012 9:16 am

Re: FTDI USB Serial Hangs

Wed Dec 05, 2012 6:04 am

Raspberry is of NO USE due to this problem!
Why is this problem not solved in a new image??

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 18369
Joined: Sat Jul 30, 2011 7:41 pm

Re: FTDI USB Serial Hangs

Wed Dec 05, 2012 9:46 am

yxoman wrote:Raspberry is of NO USE due to this problem!
Why is this problem not solved in a new image??
Let me rephrase that for you

"Raspberry Pi is is no use TO ME due to this problem"

And the reason it's not fixed in the latest image, is because we don't yet have a fix for it. When it is fixed there will be a new image with the fix in, and you should see some information here.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

jms
Posts: 2
Joined: Mon Jul 09, 2012 5:51 pm

Re: FTDI USB Serial Hangs

Fri Dec 07, 2012 6:17 pm

If it's not already blatantly obvious though the Pi is great for driving a telly I wouldn't touch it with a shitty stick for other applications especially those that require decent network or USB.

scoot
Posts: 1
Joined: Tue Dec 11, 2012 4:37 am

Re: FTDI USB Serial Hangs

Tue Dec 11, 2012 4:44 am

I am having the same issues as a few people have mentioned. I am using a USB Insteon PLM and am trying to use plmtools.

Everything works fine on my PC with Debian installed, however not so much with the Pi. The unit is detected by the kernel, but plmtools hangs whenever I send a command to it.

I found a program called HomAidPi made by Smartenit (http://simplehomenet.com/solutions.asp?page_id=HomAidPi). I successfully installed zbpserver, and have connected through their web interface (really not a fan of it. I want to run something locally). Everything works fine through the Pi and my PLM with this program.

Just thought I would give a heads up, and maybe people could make some progress with this.

Now to figure out how this program constantly monitors all of my devices and updates everything realtime... Argh.

YannickF
Posts: 5
Joined: Mon Dec 03, 2012 10:34 pm

Re: FTDI USB Serial Hangs

Sat Dec 15, 2012 10:08 am

I have this famous problem with a FT232RL chip.
I solved (is it reasonable to call that "a solution" ?) it with the boot option which force USB 1.1.
But I have a second Raspberry Pi, with ArchLinux instead off Raspian Wheezy.

Everything seem perfect : it doesn't hang when I use USB serial adapter.

Can someone confirm the problem only exists on Raspian ?


--
Yannick

iant1945
Posts: 18
Joined: Fri Oct 05, 2012 9:14 am

Re: FTDI USB Serial Hangs

Wed Dec 19, 2012 5:04 pm

Wheezy of 16 December doesn't seem to have fixed the problem.

Is it possible to set dwc_otg.speed=1 from within a Python program just before accessing the USB, then revert it afterwards ?

Like others, if I do it from the command line, it hangs the boot.

Return to “Interfacing (DSI, CSI, I2C, etc.)”

Who is online

Users browsing this forum: No registered users and 7 guests