Re: newbie doubt on USB device/peripheral

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> The board is a Compulab CM-X270L (PXA270). This board has USB master as
>> well as a slave port. It's currently running a patched 2.6.16 kernel
>> (the patch is from Compulab). It runs Compulab's Debian distribution
>>  - "Debian GNU/Linux 3.1".
>
> Wow, that's old and out of date, and very obsolete.

yes...I realized that! :)
>
>> We need to use the board as a USB slave to a machine which has a USB
>> master (root hub). This machine runs a proprietary OS and we do not
>> have access to it's source code and/or any other means to access it's
>> internals.
>
> What OS is it?

I think it's some variant of uCos...not sure though...
>
>> This proprietary OS supports the following USB classes:
>>
>> I plan to do the following:
>>
>> 1) CDC-ACM: Compile the USB gadget serial driver as a LKM for the board.
>>    If the module loads successfully, connecting the slave port to the
>>    host should make it (the slave), enumerate successfully as an ACM
>>    device.
>
> Did that work?

No, since I can't reflash the board with a newer kernel I'm forced to
use the existing pxa27x_udc module (built for 2.6.16 with the compulab
patch applied). When I loaded the serial module (g_serial), I get the following
error:
gs_module_init: cannot register gadget driver, ret=-16

I also got this once inserting the module:

gs_bind: cannot autoconfigure on pxa27x_udc
gs_module_init: cannot register gadget driver, ret=-19

>
>> 2) CDC-ECM: This one's a bit tricky! I understand that the ethernet is
>>    implemented in drivers/usb/gadget/ether.c. But, since the host side
>>    driver is written to work with a particular chipset, will it work
>>    "AS IS" with the ethernet gadget driver?
>
> It should.
>
>>    Also, in case it doesn't work, can I tweak the gadget driver to make
>>    it work/enumerate correctly with the host? Basically I'll be "faking"
>>    the chip in s/w.
>
> Sure, you could.
>
>> Also, how can I verify that the kernel has recognized the USB slave
>> device?
>
> Look at the log messages?

Ok. I got this:
# dmesg | grep -i udc
pxa27x_udc: version 08-Feb-2007
UDC Configuration Passed

>
>> During kernel configuration, we can choose gadget support as a module.
>> Is there a separate module that needs to be present for gadget support or
>> will individual gadget drivers themselves provide this functionality?
>
> Your gadget controller needs to be loaded as well.

I just found the config file for the running kernel (under /proc/config.gz)
and it shows that the udc's built-in into the kernel (unfortunately not as
a module which i can change).
>
>> The following link states that the USB device functionality is not
>> supported
>> in 2.6.16 kernels:
>>
>> http://www.compulab.co.il/mediawiki/index.php5?title=Linux_Kernel_for_CM-X270#USB_device
>>
>> But if I get the patches mentioned in the link and compile them as
>> modules,
>> then can I enable the USB device functionality?
>
> Probably upgrade to a newer kernel version.  YOu do realize how old
> 2.6.16 is, right?

Yes, I plan to do that as soon as I figure how to re-flash the board.
>
> Contact your manufacturer?

Can you suggest any good boards for USB peripheral driver development?

I need something thats well-supported under linux. Is the NetChip 2280 a
good option?

I've heard that the PXA27x's UDC has some issues (read it in some thread on
LKML)...also I don't want to cross-compile a module if it can be avoided! :)

If i use a netchip card, then I can compile my modules natively (x86) and
test things out...right?
>
> good luck,

Thanks,
-mandeep

>
> greg k-h
>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux