AnsweredAssumed Answered

how to support usb gadget serial function correctly for imx6q

Question asked by hui wang on Dec 19, 2018
Latest reply on Dec 27, 2018 by jimmychan

system:android 5.1


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 !