Why USB must be so hard to use ?

Bernd Walter ticso at cicely12.cicely.de
Sat Sep 22 02:50:03 PDT 2007


On Fri, Sep 21, 2007 at 10:38:29AM -0700, Luigi Rizzo wrote:
> i recently tried to attach one of the Openbeacon USB devices
> 
> 	http://wiki.openbeacon.org/wiki/OpenBeacon_USB
> 
> to a -stable box, and "of course" attach failed, even though the
> same thing is claimed to work right away on Linux and XP without
> any special driver.
> 
> It wasn't too hard to convince umodem.c to attach to the device,
> but i had to put the <vendor,product> ids in the list of devices
> explicitly recognised, and further disable the extra check for
> capabilities at the end of umodem.c::USB_MATCH (or umodem_match in
> -current).  The device itself returns a class UICLASS_CDC, but
> subclass and protocol are 0, i.e. this is a very basic serial device
> as probably many gadget we are going to see in the future.

Since it's using an Atmel ARM.
I had to create the following umodem patch to get a pseudo serial
port for accessing the sam-ba CDC for flashing the controller:
Index: umodem.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/usb/umodem.c,v
retrieving revision 1.57
diff -u -r1.57 umodem.c
--- umodem.c	31 Jan 2005 13:58:10 -0000	1.57
+++ umodem.c	20 Aug 2006 17:05:34 -0000
@@ -256,6 +260,15 @@
 	    id->bInterfaceProtocol == UIPROTO_CDC_AT)
 		ret = UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO;
 
+#if 1
+	if (ret == UMATCH_NONE &&
+	    id->bInterfaceClass == UICLASS_CDC_DATA &&
+	    id->bInterfaceSubClass == UISUBCLASS_DATA &&
+	    id->bInterfaceProtocol == 0x00)
+		ret = UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO;
+		return ret;
+#endif
+
 	if (ret == UMATCH_NONE)
 		return (ret);

I was told that it just works under Linux and Windows has such
a generic driver as well.
But the sam-ba firmware in the AT91SAM7X256 wasn't able to build
a tty under Mac OS X as well.
We should really have a generic CDC tty driver, since it is used
very often for simple USB projects.
 
-- 
B.Walter                http://www.bwct.de      http://www.fizon.de
bernd at bwct.de           info at bwct.de            support at fizon.de


More information about the freebsd-current mailing list