how to support usb gadget serial function correctly for imx6q

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

how to support usb gadget serial function correctly for imx6q

2,505 次查看
huiwang
Contributor II

system:android 5.1

platform:imx6q

now I do such operations below to add usb acm function:

1.add some code in init.freescale.usb.rc

   on property:sys.usb.config=acm,adb
   write /sys/class/android_usb/android0/enable 0
   write /sys/class/android_usb/android0/idVendor 18d1
   write /sys/class/android_usb/android0/idProduct 4e45
   write /sys/class/android_usb/android0/f_acm/instances 1
   write /sys/class/android_usb/android0/functions ${sys.usb.config}
   write /sys/class/android_usb/android0/enable 1
   start adbd
   setprop sys.usb.state ${sys.usb.config}

2.adb shell to set the usb property

   #setprop persist.sys.usb.config acm,adb    the default property is mtp,adb

3.install the gadget driver on my windows computer, it can identify the serial of COM24, and I can also communicate using this COM

But now question is when i want to change the usb property back 

    #setprop persist.sys.usb.config mtp,adb

the android system will reboot at once, and the property is also acm,adb

what wrong with it and how can i config correctly to support usb gadget serial (acm) function?

Thanks a lot !

标签 (1)
标记 (4)
0 项奖励
回复
2 回复数

2,241 次查看
huiwang
Contributor II

add some more information:

revise the default usb prop (mtp,adb) to (ptp,adb) ,  and change it back to(mtp,adb). The android system is running OK without rebooting.

0 项奖励
回复

2,241 次查看
jimmychan
NXP TechSupport
NXP TechSupport
0 项奖励
回复