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 !
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.
please try this : https://community.nxp.com/message/884871