Android Adb Gadget Driver

Marvell PXA310, Linux kernel 2.6.25


1. adb gadget file: drivers/usb/gadget/android_adb.c


2. Configs need enabled:

CONFIG_USB=y
CONFIG_USB_OTG=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_SELECTED=y
CONFIG_USB_COMPOSITE=y
CONFIG_USB_GADGET_PXA3XX_U2D=y
CONFIG_USB_PXA3XX_U2D=y
CONFIG_USB_OTG_PXA3xx_U2D=y
CONFIG_USB_OTG_PXA3XX=y
CONFIG_USB_GADGET_DUALSPEED=y
CONFIG_USB_ADB_GADGET=m


3. Make and generate the module: g_android_adb.ko


4. Install adb gadget: insmod /lib/modules/g_android_adb.ko


5. $ lsusb
Bus 004 Device 009: ID 18d1:dddd


6. In your host Linux PC (I am using Ubuntu), create a file "/etc/udev/rules.d/50-android.rules " with following contents:
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"

In which, the "18d1 " is the USB device's vendor ID which is hard-coded in android_adb.c . you can change it or not, but if you change, remember to change both the 50-android.rules file and android_adb.c file.

After creating the file, execute command:
$chmod a+rx /etc/udev/rules.d/50-android.rules


7. Now connect your device with your host PC with USB cable, go to "out/host/linux-x86/bin " in your Android source tree directory and execute command:
$./adb devices


You will get:
List of devices attached
0123456789ABCDEF device

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. android 带删除按钮的ListView
  2. android 监听SDCard安装和卸载的代码片段
  3. Android(安卓)TouchDelegate 扩大点击区
  4. libnghttp2 NDK 交叉编译
  5. Android 利用AudioManager控制后台音乐播
  6. Android的xml布局文件代码讲解(TextView
  7. Android仿微信语音聊天功能
  8. 在Android中发送HTTP POST请求示范
  9. Android Bitmap 变色
  10. Android 退出动画下广告不出错详解