Make UDC & Android ADB Gadget driver work

來源:互聯網
上載者:User
Make UDC & Android ADB Gadget driver work


1. Open the config menu, enable USB Gadget support and choose PXA27x UDC driver support and Android ADB Gadget driver support.

If
you don't have PXA27x item appeared in the menu, copy pxa27x_udc.c and
pxa27x_udc.h from Linux 2.6.27 source tree into drivers/usb/gadget
directory and make the modifications of Kconfig and Makefile files
accordingly.

If you don't have Android ADB Gadget item appeared
in the menu, copy android_adb.c from the kernel directory of Android
source code tree into drivers/usb/gadget directory and make the
modifications of Kconfig and Makefile files accordingly.



2. Open the devices.c in directory arch/arm/mach-pxa, locate at struct platform_device pxa_device_udc,

make sure the .name

field value is "pxa27x-udc

". If not, change it.

3. Write p535_udc.c
, in which calls the pxa_set_udc_info
function to do the initial work for the PXA27x UDC driver.

4. Make and generate the zImage file.

5. Run Android on your P535 with the new zImage.

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

. Actually P535's VID is 0B05

, 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 P535 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





Which shows that your device has been connected. Now you can use the adb tool in whichever way you like. 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.