Page 1 of 1

USB/Serial occasionally hangs or freezes in Linux guest

Posted: 5. Sep 2013, 01:29
by jimfred
I see a hang/freeze problem using USB/serial RS485 converter with an FTDI chip. The hang occurs in a write() call to the port. Only the application hangs - the system is ok. Running the app in gdb, I can pause gdb and see the hang in write() with a return value indicating that not all bytes were written. If I resume gdb the app will return from write(), call close() for the port (which will hang for about 30 seconds) and proceed normally. Running without gdb on VB, the app will hang apparently forever (10's of minutes). It's interesting that gdb changes the behavior of the problem - a pause & resume sequence in gdb allows the app to run rather than hang forever.

The problem does not occur on Linux running outside of VB which implies that the problem might be related to VB.

Searching the forums, I found problems related to discovery of the port in a Linux Guest. I don't see these problems. I also saw forum posts related to system hangs but in my case only the app hangs.

I'm using VB 4.2.16, with a Linux Mint 64-bit guest on a Win7-64 host.

Re: USB/Serial occasionally hangs or freezes in Linux guest

Posted: 5. Sep 2013, 11:17
by mpack
This sounds like something you should raise a BugTracker ticket for, however you may not get a response unless it's reproducable elsewhere.

Re: USB/Serial occasionally hangs or freezes in Linux guest

Posted: 29. Jan 2014, 19:18
by phamuc
USB/Serial hangs or freezes in Windows guest

I am experiencing the same problem as jimfred.
My system is a Win7Prox64 Host with a Win7Prox86 in the VB.
My development system is Visual Studios 12 C++. My program using the USB/serial RS485 converter with an FTDI chip, runs fine on the host. But in VB, the program hangs (not VB, only the program) when the write() is called. The program is waiting for write() to come back after sending the chars or timeout.
On the VB client Win7Prox86, I used Putty to 'talk' to com3 (USB/serial RS485 converter with an FTDI chip) with no problems.
It seems in VB the FTDI driver in VCP (virtual com port) mode works fine, but in direct (D2XX) mode does NOT.

In VB the USB Device Filters are set to give the client fully control over the USB device.
I have tried it with the Option: Enable USB 2.0(EHCI) Controller, ON and OFF, which made no difference.

UPDATE: switching Client from 1 CPU to 2 CPU. The FTDI drive in direct (D2XX) mode works!
When I switch from 1 to 2CPUs the Enable I/O APIC was automatically switched ON.
I went back and tested with 1 CPU and with the Enable I/O APIC option ON, this did NOT work! So I am sticking with 2 CPUs!