enabling ADB on a new device

813 views
Skip to first unread message

Iram Shahzad

unread,
Jul 17, 2009, 6:28:50 AM7/17/09
to android...@googlegroups.com
Hi

I am trying to enable ADB through USB on my experimental device.
I have the following question in this regard.

It seems there are two ways for this.
1. support USB gadget driver
2. support USB function driver

Which one of the above is recommended?

It seems that devphone uses the No 2. approach.
But the common kernel at
git://android.git.kernel.org/kernel/common.git
does not contain the function driver related codes.

I have tried the No 1. approach. But it looks like
drivers/usb/gadget/f_adb.c
has several problems. Has it ever been tested on any device?

Many thanks in advance
IS


Ke

unread,
Jul 17, 2009, 2:24:54 PM7/17/09
to android-porting
You need to make sure the kernel image has necessary options and
drivers enabled.

In the kernel config file, you need to make sure:

peripheral or otg mode is enabled.
such as
# CONFIG_USB_MUSB_PERIPHERAL=y
or
# CONFIG_USB_MUSB_OTG=y
do not enable both, they would be conflicting options.

gadget support needs to be enabled
CONFIG_USB_GADGET=y

and

android usb adb gadget needs to built into kernel with 'y' or you can
have it build as a module 'm' (insmod during init.rc)
CONFIG_USB_ANDROID=y

what do you mean by:

> I have tried the No 1. approach. But it looks like
> drivers/usb/gadget/f_adb.c
> has several problems. Has it ever been tested on any device?

To test, you can do lsusb on your host system to see if the android
usb device shows up.
I had to run sudo adb start-server for the device to show up, could
not get udev rules working properly.

If you want to get this device working with the windows drivers, you
may need to modify inf file to add proper PID and VID and force driver
install with "have disk" option.

On Jul 17, 6:28 am, "Iram Shahzad" <iram.shah...@jp.fujitsu.com>
wrote:

RR

unread,
Jul 18, 2009, 11:40:48 AM7/18/09
to android-porting
Me too have same question.

devphone seems to have the following two types of implementations.
So far as I understand, Mike Lockwood of Google recommends
the latter type in an earlier mail. It would be better if he confirms.

1. function driver implementation
drivers/usb/function/adb.c
drivers/usb/function/msm_hsusb.c

2. gadget driver implementation
drivers/usb/function/android.c
drivers/usb/function/f_adb.c
drivers/usb/function/msm72k_udc.c

RR

Claw

unread,
Aug 7, 2009, 12:13:05 PM8/7/09
to android-porting

Is there a particular version of kernel that I should be running for
ADB?
I am running the android 2.6.25 which is used for the release 1.0 of
Android. I am not able to find the CONFIG Flags CONFIG_USB_MUSB* or
CONFIG_USB_ANDROID that you have mentioned.

Thanks,

On Jul 17, 11:24 pm, Ke <keke...@gmail.com> wrote:
> You need to make sure the kernel image has necessary options and
> drivers enabled.
>
> In the kernel config file, you need to make sure:
>
> peripheral or otg mode is enabled.
> such as
> # CONFIG_USB_MUSB_PERIPHERAL=y
> or
> # CONFIG_USB_MUSB_OTG=y
> do not enable both, they would be conflicting options.
>
> gadget support needs to be enabled
> CONFIG_USB_GADGET=y
>
> and
>
> android usbadbgadget needs to built into kernel with 'y' or you can
> have it build as a module 'm' (insmod during init.rc)
> CONFIG_USB_ANDROID=y
>
> what do you mean by:
>
> > I have tried the No 1. approach. But it looks like
> > drivers/usb/gadget/f_adb.c
> > has several problems. Has it ever been tested on any device?
>
> To test, you can do lsusb on your host system to see if the android
> usb device shows up.
> I had to run sudoadbstart-server for the device to show up, could
> not get udev rules working properly.
>
> If you want to get this device working with the windows drivers, you
> may need to modify inf file to add proper PID and VID and force driver
> install with "have disk" option.
>
> On Jul 17, 6:28 am, "Iram Shahzad" <iram.shah...@jp.fujitsu.com>
> wrote:
>
> > Hi
>
> > I am trying to enableADBthrough USB on my experimental device.
Reply all
Reply to author
Forward
0 new messages