OpenWrt Forum Archive

Topic: How to use usb-chipidea and usb-gadget

The content of this topic has been archived on 28 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,Every one:

I want to use openwrt[ar9331 tp703n] as a PC device,PC will visit openwrt through USB.
I guess that usb-chipidea and usb-gadget should be used.
I use usb-chipidea and usb-gadget [ BARRIER BREAKER ],but no success!




Pls tell me how to use usb-chipidea and usb-gadget ?

When I input "insmod g_ether" ,it echo : "failed to insert /lib/modules/3.10.49/g_ether.ko"

As a beginner,I dont know if this is a bug of BB version.

There is non answer.

You sure about how you are going about this?  When I used g_ether on a Linux computer it was to create a USB Device that supported Ethenet over USB.  The USB ports on most routers are setup to be USB Host.  That is, setup to host a USB Device like a USB Thumb Drive.  I might be wrong, but I'm thinking that is a problem.  The physical port on the Linux computer I was running g_ether on was an OTG USB port.  That may have been why it worked.  OTG USB ports can be configured as either Host or Device. Does anyone know for sure?

(Last edited by st2000 on 5 Dec 2014, 21:29)

Thanks st2000 for reply.

0.
The ar9331 datasheet writes its usb  mode can be host or device mode.

1.
In BARRIER BREAKER (14.07),we can find the option :kernel->usb support->usb chipidea.
Maybe The module of usb chipidea is related to setting the ar9331 usb device mode.

What is usb chipidea? how to use the module? Hope  information about usb chipidea.

2.In BARRIER BREAKER (14.07),the option of usb-gadget is hidden ,can't be selectable.
Searching internet, usb-gadget is driver for usb device mode.
but In BARRIER BREAKER,we can't active it.

3.I have changed th usb.mk file, the option of usb-gadget appeared and executed 'make' successfully.but insmod g_ether ,it show ‘fail to insert g_ether.ko'.

but now I execute 'make',it shows errors about usb-gadget ,such as:miss depend udc-core.ko  configfs.ko   ...etc.So strange!

A full implementation of OTG uses a hardware pin to select host or device mode.  The special OTG socket found on smartphones detects which kind of cable the user has plugged in and signals the SoC accordingly.  It is likely that in a router the pin is permanently tied to ground to make it always run as host.

So the first hurdle to overcome is to bypass this mechanism and convince dwg-otg to want to be a device instead of a host.

Then you need udc-core because it is an essential software layer between the hardware and higher level device functions like ether.

PunBB bbcode test

1         Thecorresponding pin had been tied to the device mode.
2         The above image is for the probelm: 'fail to insert g_ether'.

Trace the code,I find the 'udc_list' is empty.No udc.
Why the driver 'ci_hdrc' does not execute its 'probe' function ?

The discussion might have continued from here.