USB CDC-ACM device under FreeBSD and HPS stack

Xiaofan Chen xiaofanc at gmail.com
Sat Apr 26 07:51:22 UTC 2008


Today is my FreeBSD USB day. :-)
So I am attaching various USB device to FreeBSD and see if
they work or not.

I have two USB to serial converter (one based on FTDI and one
based on Prolific). I have also two demo boards who poses as
USB CDC-ACM device. One is the Olimex LPC-P2148 demo board
with the lpcusb open source stack. The other is a Infineon
U-Light stick based on Silicon Labs CP2101.

Somehow they are all recognized as ugen device and not
usb serial device.

[mcuee at freebsd7 ~]$ lsusb
Bus /dev/usb0 Device /dev/ugen3: ID ffff:0005
Bus /dev/usb1 Device /dev/ugen0: ID 0403:6001 Future Technology
Devices International, Ltd FT232 USB-Serial (UART) IC
Bus /dev/usb1 Device /dev/ugen1: ID 067b:2303 Prolific Technology,
Inc. PL2303 Serial Port
Bus /dev/usb1 Device /dev/ugen2: ID 10c4:ea60 Cygnal Integrated Products, Inc.
[mcuee at freebsd7 ~]$ sudo usbdevs
addr 1: OHCI root HUB, nVidia
 addr 2: USBSerial, LPCUSB
addr 1: OHCI root HUB, nVidia
 addr 2: usb serial converter, ftdi
 addr 3: USB-Serial Controller D, Prolific Technology Inc.
 addr 4: U-Light, Silicon Labs
addr 1: EHCI root HUB, nVidia

After loading ucom/uplcom/ufdti and unplug/plug the two real USB-Serial
converter, they seems to work fine.

[mcuee at freebsd7 ~]$ sudo kldload uftdi
[mcuee at freebsd7 ~]$ sudo kldload uplcom

[mcuee at freebsd7 ~]$ kldstat
Id Refs Address    Size     Name
 1   20 0xc0400000 9263b0   kernel
 2    1 0xc0d27000 6f88     snd_ich.ko
 3    2 0xc0d2e000 4a5ac    sound.ko
 4    1 0xc0d79000 6a32c    acpi.ko
 5    1 0xc4490000 22000    linux.ko
 6    1 0xc4704000 21000    radeon.ko
 7    1 0xc4725000 f000     drm.ko
 8    3 0xc4e70000 4000     ucom.ko
 9    1 0xc4f6b000 4000     uftdi.ko
10    1 0xc4f71000 4000     uplcom.ko

[mcuee at freebsd7 ~]$ dmesg
...
ugen0: at uhub1, port 1, addr 2 (disconnected)
ugen0: detached
ugen1: at uhub1, port 2, addr 3 (disconnected)
ugen1: detached
uplcom0: <Prolific Technology Inc. USB-Serial Controller D, class 0/0,
rev 1.10/4.00, addr 2> on usb1
uftdi0: <ftdi usb serial converter, class 0/0, rev 1.10/4.00, addr 3> on usb1

How do I automated this process?

But loading ucycom failed.
[mcuee at freebsd7 ~]$ ls -la /boot/kernel/uc*
-r-xr-xr-x  1 root  wheel  15649 Apr 26 10:58 /boot/kernel/ucom.ko
-r-xr-xr-x  1 root  wheel  50744 Apr 26 10:58 /boot/kernel/ucom.ko.symbols
-r-xr-xr-x  1 root  wheel  10646 Apr 26 10:58 /boot/kernel/ucycom.ko
-r-xr-xr-x  1 root  wheel  40343 Apr 26 10:58 /boot/kernel/ucycom.ko.symbols

[mcuee at freebsd7 ~]$ sudo kldload ucycom
kldload: can't load ucycom: No such file or directory

As for the generic CDC-ACM device (the Olimex LPC-P2148), I do not know
how to load the necessary kernel module to get it work as a usb-serial
device.

Under Linux, there is a generic cdc-acm device support.

Any tips? Thanks in advance.

Xiaofan


More information about the freebsd-usb mailing list