No ADB Interface in USB Descriptors

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

No ADB Interface in USB Descriptors

7,474 Views
t_heyligen
Contributor I

Dear all,

I have some problems to get the ADB Interface on the host using target FSL iMX51 BABBAGE 3.0 and BSP R10.3.

My PC drivers are fine. My GUI settings are fine (Settings > Applications > Development > USB debugging). The ADB Interface is just missing in the USB Descriptors (verified with "lsusb" on Linux, and "usbview" on Windows).

In kernel .config, the Android gadget drivers are enabled:
   CONFIG_USB_ANDROID=y
   CONFIG_USB_ANDROID_ADB=y
   CONFIG_USB_ANDROID_MASS_STORAGE=y
   CONFIG_USB_ANDROID_RNDIS=y
   CONFIG_USB_ANDROID_RNDIS_WCEIS=y

In kernel_imx/arch/arm/mach-mx5/mx51_babbage.c, the Android gadget functions are configured. Here, USB ProductID 0x0c01 is set as default, which corresponds with the "usb_mass_storage" function.

Normally, USB ProductID 0x0c02 appears immediately, which has both "USB Mass Storage" and "ADB Interface".

During kernel boot, below messages are printed.
(Extra prints were added to kernel_imx/drivers/usb/gadget/)
   CPU is i.MX51 Revision 3.0
   mx51_babbage.c mxc_board_init(): ready to mxc_register_device(android_usb_device) with following android_usb_platform_data: vendorID 5538, productID 3073, productname MX51 BBG Android
   ...
   Android usb driver initialize
   android_usb gadget: composite.c adding config #1 'android'/80900164
   android_usb gadget: composite.c cfg 1/80900164 speeds:
   android.c product_matches_functions(): product 3073 matches
   android.c get_product_id() returning 3073
   android_usb gadget: android_usb ready
   fsl-usb2-udc: bind to driver android_usb
   android_usb gadget: composite.c suspend
   android gadget: register function adb
   android gadget: register function usb_mass_storage
   android gadget: register function rndis
   rndis_function_bind_config MAC: 00:00:00:00:00:00
   android_usb gadget: using random self ethernet address
   android_usb gadget: using random host ethernet address
   usb0: MAC 3a:e4:91:cd:ff:47
   usb0: HOST MAC a2:55:77:31:d3:e8
   android_usb gadget: composite.c adding 'rndis'/990c8780 to config 'android'/80900164
   android_usb gadget: usb_mass_storage, version: 2009/09/11
   android_usb gadget: Number of LUNs=3
    lun0: LUN: removable file: (no medium)
    lun1: LUN: removable file: (no medium)
    lun2: LUN: removable file: (no medium)
   android_usb gadget: composite.c adding 'usb_mass_storage'/99293240 to config 'android'/80900164
   android_usb gadget: composite.c adding 'adb'/990c89c0 to config 'android'/80900164
   android_usb gadget: f_adb.c adb_function_bind dev: 990c89c0
   android_usb gadget: f_adb.c create_bulk_endpoints dev: 990c89c0
   android_usb gadget: f_adb.c usb_ep_autoconfig for ep_in got ep4in
   android_usb gadget: f_adb.c usb_ep_autoconfig for adb ep_out got ep3out
   android_usb gadget: f_adb.c dual speed adb: IN/ep4in, OUT/ep3out
   android_usb gadget: composite.c resume
   ...
   android_usb gadget: composite.c HNP inactive
   android_usb gadget: high speed config #1: android

On the iMX51 target, process /sbin/adbd is running.


When explicitly and dynamically enabling adb on the shell:
   echo 1 > /sys/devices/virtual/usb_composite/adb/enable

USB ProductID 0x0c01 (3073) is replaced by 0x0c02 (3074). On the PC, ADB Interface appears, usbview shows:
   bInterfaceClass:      0xFF
   bInterfaceSubClass:   0x42
   bInterfaceProtocol:   0x01
These values are ADB_CLASS, ADB_SUBCLASS and ADB_PROTOCOL from system/core/adb/adb.h

Looks good, but...ADB Interface is offline ("adb devices"):
   List of devices attached
   0123456789ABCDEF        offline

When you reboot the iMX51, it has again USB ProductID 0x0c01 (3073) and no ADB Interface.

When enabling adb on the shell, the kernel prints:

(Extra prints were added to kernel_imx/drivers/usb/gadget/)
   composite.c usb_function_set_enabled(): set function adb to 1
   android.c product_has_function(): product 3073 has NO function rndis
   android.c product_has_function(): product 3073 has function usb_mass_storage
   android.c product_has_function(): product 3073 has NO function adb
   android.c product_matches_functions(): product 3073 does NOT match
   android.c product_has_function(): product 3074 has NO function rndis
   android.c product_has_function(): product 3074 has function usb_mass_storage
   android.c product_has_function(): product 3074 has function adb
   android.c product_matches_functions(): product 3074 matches
   android.c get_product_id() returning 3074
   android_usb gadget: composite.c reset config
   android_usb gadget: f_adb.c adb_function_disable
   android_usb gadget: f_adb.c adb disabled
   android_usb gadget: composite.c suspend


Any clue why the ADB Interface is not enabled automatically/dynamically?

Note that the prebuilt image by Freescale (from image_imx-android-r10.3_51bbg) is OK:
USB ProductID 0x0c02 (3074) appears immediately (no switch from 0x0c01) with both USB Mass Storage and ADB Interface:
ADB Interface is ready ("adb devices"):
   List of devices attached
   0123456789ABCDEF        device
  
  
Thanks a lot,
 Tom.

Labels (1)
0 Kudos
8 Replies

3,545 Views
G_rio
Contributor III

5.9 How to setup PC (Windows) to support ADB/RNDIS

Before this release, we used HTC's vendor id and product id for all the android gadget functions. It's bad case, so we changed the default android USB gadget functions's VendorID to freescale's 0x15a2, and ProductID to fake ones(after acquiring the offical product id, we will replace them). Due to this change, we must update the PC's USB driver and ADB configuration to enable the android gadget functions:

For Windows PC:

  • ADB function
    • Download the Android SDK.
    • Update the adb configuration to scan for freescale's pid:
      • Run the SDK's tools to generate a configure file:
android-sdk-windows\tools\android.bat update adb
  • Modify the files:
X:\Profile\<your account>\.android\adb_usb.ini, to add freescale vendor id:
  • Unpack the freescale Android USB win driver in the release package tool\android_usb_fsl.zip.
  • Connect the Android Device into PC, uninstall your old driver named "Android Phone" in the device manager, then reinstall driver by scanning .inf file under the directory you unpack the android_usb_fsl.zip.
  • Restart the adb server
    • adb kill-server
    • adb start-server

  • RNDIS function (USB Tethering)
  • Connect your device to PC
  • Enable USB tethering in the Android UI
    • Settings-> Wireless settings -> Tethering -> USB Tethering
  • Install the PC driver by scanning the freescale Android USB driver .inf file in the adb driver directory mentioned above.
  • If the Android RNDIS Network driver is ready, you can start to use tether by 3G or WIFI.

For Linux PC:

  • ADB function
    • Download the Android SDK.
    • Update the adb configuration to scan for freescale's pid:
      • Run the SDK's tools to generate a configure file:
android-sdk-linux_86/tools/android update adb
  • Modify the files:~/.android/adb_usb.ini, to add freescale vendor id:
# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
# USE 'android update adb' TO GENERATE.
# 1 USB VENDOR ID PER LINE.
0x15a2

  • Create a new udev rule file under the PC's /etc/udev/rules.d/ named: imx-android.rules. And fill in the following line into the file:
SUBSYSTEM=="usb", SYSFS{idVendor}=="15a2", MODE="0666"

  • Change the new udev rule file's permission:
chmod a+r /etc/udev/rules.d/imx-android.rules
  • Connect the Android Device
  • Restart the adb server
    • adb kill-server
    • adb start-server
0 Kudos

3,545 Views
TomVanBraeckel
Contributor I
Great news Tom, thanks !
0 Kudos

3,545 Views
t_heyligen
Contributor I
The issue is not in the kernel.

After some more diff'ing, I discovered Android property "service.adb.tcp.port" was set. If this property is set, adb_main() from system/core/adb/adb.c will listen only on TCP! Unlike running on host, where adb_main() will start listening on both USB and TCP...

Thanks.
0 Kudos

3,545 Views
daiane_angolini
NXP Employee
NXP Employee

the weird thing is that you can see the device. But it´s offline. 

 

I have never faced this!

 

if you figure out the root cause, please share.

0 Kudos

3,545 Views
t_heyligen
Contributor I

Thanks both for your reply.

I double-checked ~/.android/adb_usb.ini and %USERPROFILE%\.android\adb_usb.ini but the file contained the Freescale USB Vendor ID already...

For now, I am using ADB over Ethernet as a workaround.

 

Will look into the differences later.

0 Kudos

3,545 Views
mbp
Contributor V


Tom,

Sorry for the poll this much later.....

...but did you ever get adb working over USB for the Mx51?   

I think I'm following in your footsteps.  :smileysad:

thanks for any input,

Mike

0 Kudos

3,545 Views
TomVanBraeckel
Contributor I

"Note that the prebuilt image by Freescale (from image_imx-android-r10.3_51bbg) is OK:"

 

It seems to me that there's your answer. The prebuilt image's exact source code will be provided to you (as per the GPLv2).

 

If you compile that source code, it should work (otherwise it's a compilation problem).

So then you can compare (hint: diff -Nabur) that version to yours and track down the change that caused the problem...

0 Kudos

3,545 Views
daiane_angolini
NXP Employee
NXP Employee

What did you change on your code? 

 

Would you be missing to change ~/.android/adb_usb.ini for your case?

0 Kudos