Tom Heyligen

No ADB Interface in USB Descriptors

Discussion created by Tom Heyligen on Oct 14, 2011
Latest reply on Sep 9, 2013 by MIKE PETERSEN

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.

Outcomes