Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

USB to RS232 converter problem (prolific chip)

168 views
Skip to first unread message

Andrei Kolu

unread,
Apr 5, 2008, 4:02:19 PM4/5/08
to
Hello.

I have problems using USB to RS232 converter under FreeBSD 6.3-STABLE when
connecting to any Cisco gear over serial link. I connect my adapter to
notebook and dmesg output looks like this one:

ucom0: Prolific Technology Inc. USB-Serial Controller D, rev 1.10/4.00, addr 2

I have also following modules loaded:

8 1 0xc0c17000 3540 umodem.ko# cu -l /dev/ttyU0
Connected

9 4 0xc0c1b000 3208 ucom.ko
10 1 0xc0c1f000 2f54 uplcom.ko
13 1 0xc0c2f000 3384 ubsa.ko

Now I try to connect to Cisco box:

# cu -l /dev/ttyU0
Connected

And terminal stalls- nothing happens- it ignores keyboard completely-
sometimes it works but then suddenly lost keyboard interactivity. I tried
from KDE Konsole, from plain tcsh command line, sometimes I am able to gain
Cisco command line but 90% of times it just hangs. I got two usb2serial
adapters: Trendnet TU-S9 and Manhattan 205146. Same converters works just
fine under Windows and Linux (drivers cd even got RedHat 7, 8 and 9 versions
source code drivers-
http://www.manhattan-products.com/driver-usb-rs232.shtml).

_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stabl...@freebsd.org"

Andrei Kolu

unread,
Apr 5, 2008, 5:27:05 PM4/5/08
to
On Saturday 05 April 2008 23:48:59 you wrote:

> On Sat, 5 Apr 2008, Andrei Kolu wrote:
> > I have problems using USB to RS232 converter under FreeBSD 6.3-STABLE
> > when connecting to any Cisco gear over serial link. I connect my adapter
> > to notebook and dmesg output looks like this one:
> >
> > ucom0: Prolific Technology Inc. USB-Serial Controller D, rev 1.10/4.00,
> > addr 2
> >
> > I have also following modules loaded:
> >
> > 8 1 0xc0c17000 3540 umodem.ko# cu -l /dev/ttyU0
> > Connected
> >
> > 9 4 0xc0c1b000 3208 ucom.ko
> > 10 1 0xc0c1f000 2f54 uplcom.ko
> > 13 1 0xc0c2f000 3384 ubsa.ko
> >
> > Now I try to connect to Cisco box:
> >
> > # cu -l /dev/ttyU0
> > Connected
>
> Use /dev/cuaU0 instead.
>
> -Warren Block * Rapid City, South Dakota USA

There is no difference if I connect through /dev/ttyU0 or /dev/cuaU0 and even
through ttyU1 or cuaU1 (when second serial converter is connected)- same
problem. I tried on other computer with FreeBSD 6.1 and 7.0-STABLE snapshot
from march- same results.

Something is broken on FreeBSD side- strange thing is that when I turn power
down on cisco box and turn in on again then I see scrolling text from cisco
gear but there is no feedback to keyboard activity. How to debug this issue?


Andrei

Warren Block

unread,
Apr 5, 2008, 5:28:46 PM4/5/08
to
On Sat, 5 Apr 2008, Andrei Kolu wrote:

> I have problems using USB to RS232 converter under FreeBSD 6.3-STABLE when
> connecting to any Cisco gear over serial link. I connect my adapter to
> notebook and dmesg output looks like this one:
>
> ucom0: Prolific Technology Inc. USB-Serial Controller D, rev 1.10/4.00, addr 2
>
> I have also following modules loaded:
>
> 8 1 0xc0c17000 3540 umodem.ko# cu -l /dev/ttyU0
> Connected
>
> 9 4 0xc0c1b000 3208 ucom.ko
> 10 1 0xc0c1f000 2f54 uplcom.ko
> 13 1 0xc0c2f000 3384 ubsa.ko
>
> Now I try to connect to Cisco box:
>
> # cu -l /dev/ttyU0
> Connected

Use /dev/cuaU0 instead.

-Warren Block * Rapid City, South Dakota USA

Andrei Kolu

unread,
Apr 5, 2008, 5:36:06 PM4/5/08
to
On Sunday 06 April 2008 00:24:38 Andrei Kolu wrote:
> On Saturday 05 April 2008 23:48:59 you wrote:
> > On Sat, 5 Apr 2008, Andrei Kolu wrote:
> > > I have problems using USB to RS232 converter under FreeBSD 6.3-STABLE
> > > when connecting to any Cisco gear over serial link. I connect my
> > > adapter to notebook and dmesg output looks like this one:
> > >
> > > ucom0: Prolific Technology Inc. USB-Serial Controller D, rev 1.10/4.00,
> > > addr 2
> > >
> > > I have also following modules loaded:
> > >
> > > 8 1 0xc0c17000 3540 umodem.ko# cu -l /dev/ttyU0
> > > Connected
> > >
> > > 9 4 0xc0c1b000 3208 ucom.ko
> > > 10 1 0xc0c1f000 2f54 uplcom.ko
> > > 13 1 0xc0c2f000 3384 ubsa.ko
> > >
> > > Now I try to connect to Cisco box:
> > >
> > > # cu -l /dev/ttyU0
> > > Connected
> >
> > Use /dev/cuaU0 instead.
> >
> > -Warren Block * Rapid City, South Dakota USA
>
> There is no difference if I connect through /dev/ttyU0 or /dev/cuaU0 and
> even through ttyU1 or cuaU1 (when second serial converter is connected)-
> same problem. I tried on other computer with FreeBSD 6.1 and 7.0-STABLE
> snapshot from march- same results.
>
> Something is broken on FreeBSD side- strange thing is that when I turn
> power down on cisco box and turn in on again then I see scrolling text from
> cisco gear but there is no feedback to keyboard activity. How to debug this
> issue?
>
Some progress on debugging! Just kiddin...

I removed converter from USB and FreeBSD 7.0 kernel dumped following
information:

ucom0: ucomreadcb: IOERROR
ucom0: at uhub1 port 1 (addr 2) disconnected
ucom0: uplcom_set_line_status: STALLED


Fatal trap 12: page fault while in kernel mode
cpuid = 1; apic id = 01
fault virtual address = 0xb0
fault code = supervisor read data, page not present
instruction pointer = 0x8:0xffffffff80446f72
stack pointer = 0x10:0xffffffffae796a00
frame pointer = 0x10:0xffffff000172b400
code segment = base 0x0, limit 0xfffff, type 0x1b
= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags = interrupt enabled, resume, IOPL = 0
current process = 876 (cu)
trap number = 12
panic: page fault
cpuid: 1
Uptime: 8m41s
Physical memory: 2802 MB
Dumping 126 MB: 111 95 79 63 47 31 15
Dump complete

Jeremy Chadwick

unread,
Apr 5, 2008, 6:00:18 PM4/5/08
to

This is a known problem, and even more so if you still had tip or cu
connected to the tty. Others have reported similar, with other USB
drivers.

Bottom line: the current FreeBSD USB stack is very fragile and
unreliable. You may want to try the usb4bsd kernel patches (I think
that's what it's called), some have had better luck with those. Search
the web.

--
| Jeremy Chadwick jdc at parodius.com |
| Parodius Networking http://www.parodius.com/ |
| UNIX Systems Administrator Mountain View, CA, USA |
| Making life hard for others since 1977. PGP: 4BD6C0CB |

Alec Kloss

unread,
Apr 5, 2008, 6:01:01 PM4/5/08
to

--idY8LE8SD6/8DnRI
Content-Type: multipart/mixed; boundary="TybLhxa8M7aNoW+V"
Content-Disposition: inline


--TybLhxa8M7aNoW+V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

The the attached patch, also available at

http://setfilepointer.com/pub/src:sys:dev:usb:uplcom.c.patch

might help. I've needed it to make uplcom stuff work.

--=20
Alec Kloss al...@SetFilePointer.com IM: angrysp...@yahoo.com
PGP key at http://pgp.mit.edu:11371/pks/lookup?op=3Dget&search=3D0xA241980E
"No Bunny!" -- Simon, from Frisky Dingo

--TybLhxa8M7aNoW+V
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="src:sys:dev:usb:uplcom.c.patch"
Content-Transfer-Encoding: quoted-printable

--- src/sys/dev/usb/uplcom.c.orig Thu Nov 2 13:20:51 2006
+++ src/sys/dev/usb/uplcom.c Thu Nov 2 14:21:19 2006
@@ -154,6 +154,7 @@
=20
#define TYPE_PL2303 0
#define TYPE_PL2303X 1
+#define TYPE_PL2303HX 2
=20
struct uplcom_softc {
struct ucom_softc sc_ucom;
@@ -233,6 +234,9 @@
{ USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_RSAQ3, -1, TYPE_PL2303X },
/* PLANEX USB-RS232 URS-03 */
{ USB_VENDOR_ATEN, USB_PRODUCT_ATEN_UC232A, -1, TYPE_PL2303 },
+ /* AJK */
+ { USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2303,
+ 0x400, TYPE_PL2303HX },
/* ST Lab USB-SERIAL-4 */
{ USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2303,
0x300, TYPE_PL2303X },
@@ -381,10 +385,17 @@
=20
#ifdef USB_DEBUG
/* print the chip type */
- if (sc->sc_chiptype =3D=3D TYPE_PL2303X) {
+ switch (sc->sc_chiptype)
+ {
+ case TYPE_PL2303HX:
+ DPRINTF(("uplcom_attach: chiptype 2303HX\n"));
+ break;
+ case TYPE_PL2303X:
DPRINTF(("uplcom_attach: chiptype 2303X\n"));
- } else {
+ break;
+ default:
DPRINTF(("uplcom_attach: chiptype 2303\n"));
+ break;
}
#endif
=20
@@ -609,7 +620,9 @@
{ UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8383, 0, 0 },
{ UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0, 1, 0 },
{ UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 1, 0, 0 },
- { UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 2, 0x44, 0 }
+ { UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 2, 0x44, 0 },
+ { UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 8, 0, 0 },
+ { UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 9, 0, 0 },
};
#define N_PL2302X_INIT (sizeof(pl2303x)/sizeof(pl2303x[0]))
=20
@@ -735,10 +748,18 @@
req.bmRequestType =3D UT_WRITE_VENDOR_DEVICE;
req.bRequest =3D UPLCOM_SET_REQUEST;
USETW(req.wValue, 0);
- if (sc->sc_chiptype =3D=3D TYPE_PL2303X)
+ switch (sc->sc_chiptype)
+ {
+ case TYPE_PL2303HX:
USETW(req.wIndex, UPLCOM_SET_CRTSCTS_PL2303X);
- else
+ break;
+ case TYPE_PL2303X:
+ USETW(req.wIndex, UPLCOM_SET_CRTSCTS_PL2303X);
+ break;
+ default:
USETW(req.wIndex, UPLCOM_SET_CRTSCTS);
+ break;
+ }
USETW(req.wLength, 0);
=20
err =3D usbd_do_request(sc->sc_ucom.sc_udev, &req, 0);
@@ -886,7 +907,8 @@
}
}
=20
- if (sc->sc_chiptype =3D=3D TYPE_PL2303X)
+ if (sc->sc_chiptype =3D=3D TYPE_PL2303X ||
+ sc->sc_chiptype =3D=3D TYPE_PL2303HX)
return (uplcom_pl2303x_init(sc));
=20
return (0);

--TybLhxa8M7aNoW+V--

--idY8LE8SD6/8DnRI
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFH9+/h2s33paJBmA4RApppAJwP6jkiQY7sUIsneNX7Vx2G75uqCQCfajNY
D/KDIKcE4L6JZ77IhlGJSp8=
=VGh+
-----END PGP SIGNATURE-----

--idY8LE8SD6/8DnRI--

M. Warner Losh

unread,
Apr 5, 2008, 6:12:59 PM4/5/08
to
In message: <20080405215...@eos.sc1.parodius.com>
Jeremy Chadwick <koi...@freebsd.org> writes:
: Bottom line: the current FreeBSD USB stack is very fragile and

: unreliable. You may want to try the usb4bsd kernel patches (I think
: that's what it's called), some have had better luck with those. Search
: the web.

This crash has nothing to do with the usb stack. The root cause is
the device deletion code nulls out a pointer. There's a routine that
is sleeping which is woken up and the null pointer gets dereferenced
leading to the crash.

The current usb stack isn't as fragile as it was in the 5.x days.
While there are problems, this one isn't due to that. The same thing
happens when you eject a PC Card 16550 COM device, due to the same
bug.

Warner

Andrei Kolu

unread,
Apr 5, 2008, 6:14:57 PM4/5/08
to
On Sunday 06 April 2008 00:32:17 Alec Kloss wrote:
> The the attached patch, also available at
>
> http://setfilepointer.com/pub/src:sys:dev:usb:uplcom.c.patch
>
> might help. I've needed it to make uplcom stuff work.

This patch works just fine (tested on 6.3). Thank you!
Why it is not submitted into base tree for more than a year?


Andrei

Dorian Büttner

unread,
Apr 5, 2008, 6:21:26 PM4/5/08
to

>>>> # cu -l /dev/ttyU0
>>>>
>>
propably you need to adjust the line speed, i.e. cu -l <line> -s 19200,
also some devices like if you hit enter to get a login prompt.

> Some progress on debugging! Just kiddin...
>
> I removed converter from USB and FreeBSD 7.0 kernel dumped following
> information:
>
>

That's actually been discussed here:
http://www.freebsd.org/cgi/query-pr.cgi?pr=122287

While we're at it: can everybody tell me the magic keystroke to end a cu
session? man says ~^Z or something, i think this is a combination of
keys to pressed?

Kind regards,
Dorian

M. Warner Losh

unread,
Apr 5, 2008, 6:44:00 PM4/5/08
to
In message: <200804060121...@bsd.ee>
Andrei Kolu <an...@bsd.ee> writes:
: On Sunday 06 April 2008 01:12:53 Andrei Kolu wrote:

: > On Sunday 06 April 2008 00:32:17 Alec Kloss wrote:
: > > The the attached patch, also available at
: > >
: > > http://setfilepointer.com/pub/src:sys:dev:usb:uplcom.c.patch
: > >
: > > might help. I've needed it to make uplcom stuff work.
: >
: > This patch works just fine (tested on 6.3). Thank you!
: > Why it is not submitted into base tree for more than a year?

Maybe because it wasn't in the PR database when I did my massive
cleanup last summer? Would you like to volunteer to help move patches
posted to random places into FreeBSD or the PR database? There's
plenty of opportunity for advancement into the project for people
willing to do these sorts of things.

: Another interesting patch:
: http://leaf.dragonflybsd.org/mailarchive/submit/2007-07/msg00021.html

This is indeed an interesting patch. Thank you.

Warner

Kostik Belousov

unread,
Apr 5, 2008, 7:16:19 PM4/5/08
to

--E0GpUEom8qu4+vDz

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Apr 05, 2008 at 04:10:10PM -0600, M. Warner Losh wrote:
> In message: <20080405215...@eos.sc1.parodius.com>
> Jeremy Chadwick <koi...@freebsd.org> writes:
> : Bottom line: the current FreeBSD USB stack is very fragile and
> : unreliable. You may want to try the usb4bsd kernel patches (I think
> : that's what it's called), some have had better luck with those. Search
> : the web.

>=20


> This crash has nothing to do with the usb stack. The root cause is
> the device deletion code nulls out a pointer. There's a routine that
> is sleeping which is woken up and the null pointer gets dereferenced
> leading to the crash.

I believe that I fixed this in the HEAD and RELENG_7.

MFC to the RELENG_6 is possible, but I have no facilities to test.

>=20


> The current usb stack isn't as fragile as it was in the 5.x days.
> While there are problems, this one isn't due to that. The same thing
> happens when you eject a PC Card 16550 COM device, due to the same
> bug.

>=20


> Warner
> _______________________________________________
> freebsd...@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "freebsd-stabl...@freebsd.org"

--E0GpUEom8qu4+vDz
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (FreeBSD)

iEYEARECAAYFAkf4B5QACgkQC3+MBN1Mb4iWUgCfeUEE6g4lETGkkSiZKU6I/AXn
raYAoMOJfyQtKjoCUS9UoNwa0myahFbZ
=uSSW
-----END PGP SIGNATURE-----

--E0GpUEom8qu4+vDz--

Jeremy Chadwick

unread,
Apr 5, 2008, 8:31:04 PM4/5/08
to
On Sat, Apr 05, 2008 at 11:53:00PM +0200, Dorian Büttner wrote:
>
>>>>> # cu -l /dev/ttyU0
>>>>>
>>>
> propably you need to adjust the line speed, i.e. cu -l <line> -s 19200,
> also some devices like if you hit enter to get a login prompt.
>
>> Some progress on debugging! Just kiddin...
>>
>> I removed converter from USB and FreeBSD 7.0 kernel dumped following
>> information:
>>
>>
>
> That's actually been discussed here:
> http://www.freebsd.org/cgi/query-pr.cgi?pr=122287
>
> While we're at it: can everybody tell me the magic keystroke to end a cu
> session? man says ~^Z or something, i think this is a combination of keys
> to pressed?

<Enter><Tilde><Period><Enter> will end a cu session.

--
| Jeremy Chadwick jdc at parodius.com |
| Parodius Networking http://www.parodius.com/ |
| UNIX Systems Administrator Mountain View, CA, USA |
| Making life hard for others since 1977. PGP: 4BD6C0CB |

_______________________________________________

Alec Kloss

unread,
Apr 5, 2008, 8:47:22 PM4/5/08
to

--GV0iVqYguTV4Q9ER

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2008-04-06 01:12, Andrei Kolu wrote:
> On Sunday 06 April 2008 00:32:17 Alec Kloss wrote:
> > The the attached patch, also available at
> >
> > http://setfilepointer.com/pub/src:sys:dev:usb:uplcom.c.patch
> >
> > might help. I've needed it to make uplcom stuff work.

>=20
> This patch works just fine (tested on 6.3). Thank you!=20


> Why it is not submitted into base tree for more than a year?

>=20

It's been on my todo list forever, but so are a lot of other
things. I have a hard enough time keeping up with Arla. :)

--=20
Alec Kloss al...@SetFilePointer.com IM: angrysp...@yahoo.com
PGP key at http://pgp.mit.edu:11371/pks/lookup?op=3Dget&search=3D0xA241980E
"No Bunny!" -- Simon, from Frisky Dingo

--GV0iVqYguTV4Q9ER
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFH+B0+2s33paJBmA4RAhb+AJ9K9aI0qdNB/i4yUE24GMkOD5uQBQCfdDRQ
mtOCudu6Ea8Vmou9vSJmXq4=
=hO9T
-----END PGP SIGNATURE-----

--GV0iVqYguTV4Q9ER--

0 new messages