This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Configuring USB gadgets

Other Parts Discussed in Thread: TWL6030

Dear all,

I'm having problems configuring an USB gadget on an OMAP4460 with Android 4.0.3 (GIT revision for kernel: 4efe9994e0731a113b19bf42003ccb8f672e5ccb).
- My goal is to use Ethernet over USB between the above system and an embedded Linux device (which acts as the host). However, if I configure any other USB gadget than the default Android Composite Gadget, there is no communication whatsoever with the host (checked with usbmon on the host system).
This is the case when using gadget drivers for RNDIS and ECM (g_ether.ko), NCM (ncm.ko) and mass storage (g_mass_storage.ko).
- For the kernel compilation & system configuration I followed the instructions from the TI wiki to the letter:
http://processors.wiki.ti.com/index.php/TI-Android-ICS-4.0.3-DevKit-3.0.0_DevelopersGuide#adb_over_USB_Ethernet_.28Ethernet_over_USB.29
- The result is that after IP configuration and plugging in the USB device, only the message 'PC detected' is shown on the android device. This is a message from the twl6030 power management code indicating that a type of charging device has been seen.
Further debugging showed that there is activity in the omap2430 glue code and the musb layer, but for some reason not a single USB gadget configuration (other than the Android Composite Gadget) works.
- I got the impression that Ethernet over USB has not recently been tested/used, because in the file kernel/drivers/usb/gadget/ether.c on line 250 the call to rndis_bind_config() has too few arguments, which prevents compilation for that kernel module.
I've fixed the call, but you can imagine it raises doubts about the related code.


- My question:how to get a working Ethernet over USB gadget on the Android/OMAP44 system? The NCM interface is our goal, but EEM or ECM are also valid options.

Any help will be greatly appreciated..

  • About USB storage there is one post that matches this

    http://e2e.ti.com/support/omap/f/849/p/198653/708483.aspx#708483

    it contains next link that may help too

    http://omapedia.org/wiki/USB_on_Blaze_Tablet_with_ICS

    For Ethernet, have you configured the network adapter setting the IP-NETWORKMASK-Gateway-DNS and probably the proxy if yo are looking for access to Internet?

    In ICS the proxy settings were moved to the secure part of database settings then it is not possible to set the proxy in the way that was made in GB.

    for information about setting the other settings,

    http://omapedia.org/wiki/OMAP_Pandroid_Main#Ethernet

    http://omapedia.org/wiki/Android_enabling_codecs

    if you are not using DHCP by adding ip=dhcp to bootargs of using netcfg command for that, then you need to specify the IP address before getting up the interface, this for both sides of the connection.

  • Hi Manuel,

    yes, the network was configured as per this guide: http://processors.wiki.ti.com/index.php/TI-Android-ICS-4.0.3-DevKit-3.0.0_DevelopersGuide#adb_over_USB_Ethernet_.28Ethernet_over_USB.29

    I tried it with a kernel compiled with RNDIS, once with ECM and once with NCM. In all cases the network was configured at both sides and the feedback during configuration looked fine (no error messages). However, upon connection of the USB cable not a single transaction could be seen with usbmon. When connecting a memory stick or the Android system configured as the standard Android gadget, I can see the proper configuration transactions going over the USB connection.

    So the problem is not so much using Ethernet over USB, but getting the gadget detected/recognised in the first place. It's as if the Android Gadget code has something special that makes it work, but I cannot figure out what..

    Note that getting Mass Storage to work is not a goal, I just experimented with it to get an idea of at what level the problem might be.

    As for the Ethernet over USB functionality (meaning ECM/EEM/NCM): can you confirm that it should be possible to use it? As I've stated before I have my doubts since the code from the repository does not compile without fixing an error after checkout.

    Best regards,

    Edwin.

  • Edwin,

    I have used a USB 2.0 to Gig-E adapter for network connectivity with the OMAP 4AI.1.7 release (and other releases as well).  You can find the release details here: http://www.omappedia.com/wiki/4AI.1.7_OMAP4_Icecream_Sandwich_Release_Notes  I also needed to enable CONFIG_USB_USBNET in the kernel menuconfig.  You can contact your TI representative for access to an application note that describes in detail how to setup and perform benchmarking with a USB-Ethernet adapter.

    Regards,
    Gina 

  • Hi Gina, thanks for the quick reply.

    Unfortunately our hardware design does not allow that solution: our host device has a combined power supply/usb cable that cannot be modified and no ethernet port. Our android device only has one ethernet port that is destined for other things..

    I'll take your suggestion as a sign that the Ethernet over USB kernel drivers cannot be used and consider this path a dead end. We'll have a go at modifying the Android Composite Gadget driver code to include NCM instead of RNDIS.

    Thanks,

    Edwin.

  • Edwin,

    I also tested in this way, and it worked fine with the OMAP Android software releases:

    Blaze Tablet -> USB hub -> USB-GigE adaptor -> ethernet crossover cable -> USB-GigE adaptor -> PC

    Would this meet your needs?

    Regards,
    Gina 

  • Gina,

    doubtful, our system uses a proprietary power supply/usb cable for the host device and the whole system is designed to be built into cars with a minimum of cables and connections. Your suggestion would require a hardware redesign for us. I can already hear the cries of our hardware guys, but I'll pass on the suggestion nonetheless ;)

    Thanks,

    Edwin.