AnsweredAssumed Answered

How configure and use acm and adb

Question asked by Marek Bil on Mar 8, 2017
Latest reply on Mar 28, 2017 by jamesbone

Hi, i can't use acm. If i use acm if i switch adb on/off system not run.

 

Mu init.usb.rc

 

# Copyright 2013 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

 

on init
    write /sys/class/android_usb/android0/f_rndis/manufacturer Freescale
    write /sys/class/android_usb/android0/f_rndis/vendorID 18D1
    write /sys/class/android_usb/android0/f_rndis/wceis 1

 

    mount configfs none /config
    mkdir /config/usb_gadget/g1
    write /config/usb_gadget/g1/idVendor 0x18d1
    write /config/usb_gadget/g1/idProduct 0x4e42
    mkdir /config/usb_gadget/g1/strings/0x409
    write /config/usb_gadget/g1/strings/0x409/serialnumber 0123459876
    write /config/usb_gadget/g1/strings/0x409/manufacturer test
    write /config/usb_gadget/g1/strings/0x409/product nv1

 

    mkdir /config/usb_gadget/g1/configs/c.1
    mkdir /config/usb_gadget/g1/configs/c.1/strings/0x409
    write /config/usb_gadget/g1/configs/c.1/strings/0x409/configuration "cdc 2xACM+ECM"

 


    mkdir /config/usb_gadget/g1/functions/acm.GS0
    mkdir /config/usb_gadget/g1/functions/acm.GS1
    mkdir /config/usb_gadget/g1/functions/acm.usb0

 


#    ln -s /config/usb_gadget/g1/functions/acm.GS0  /config/usb_gadget/g1/configs/c.1
#    ln -s /config/usb_gadget/g1/functions/acm.GS1  /config/usb_gadget/g1/configs/c.1
#    ln -s /config/usb_gadget/g1/functions/ecm.usb0  /config/usb_gadget/g1/configs/c.1

 


on boot
    write /sys/class/android_usb/android0/iSerial $ro.serialno
    write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer
    write /sys/class/android_usb/android0/iProduct $ro.product.model

 

on fs
    mkdir /dev/usb-ffs 0770 shell shell
    mkdir /dev/usb-ffs/adb 0770 shell shell
    mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
    write /sys/class/android_usb/android0/f_ffs/aliases adb

 

# USB rndis configuration
on property:sys.usb.config=rndis
    stop adbd
    write /sys/class/android_usb/android0/enable 0
    write /sys/class/android_usb/android0/idVendor 18d1
    write /sys/class/android_usb/android0/idProduct 4e23
    write /sys/class/android_usb/android0/functions ${sys.usb.config}
    write /sys/class/android_usb/android0/bDeviceClass 224
    write /sys/class/android_usb/android0/enable 1
    setprop sys.usb.state ${sys.usb.config}

 

on property:sys.usb.config=mtp
    stop adbd
    write /sys/class/android_usb/android0/enable 0
    write /sys/class/android_usb/android0/idVendor 18d1
    write /sys/class/android_usb/android0/idProduct 4e41
    write /sys/class/android_usb/android0/functions ${sys.usb.config}
    write /sys/class/android_usb/android0/f_acm/instances 2
    write /sys/class/android_usb/android0/enable 1
    setprop sys.usb.state ${sys.usb.config}

 

on property:sys.usb.config=mtp,acm
    stop adbd
    write /sys/class/android_usb/android0/enable 0
    write /sys/class/android_usb/android0/idVendor 18d1
    write /sys/class/android_usb/android0/idProduct 2513
    write /sys/class/android_usb/android0/functions ${sys.usb.config}
    write /sys/class/android_usb/android0/f_acm/instances 2
    write /sys/class/android_usb/android0/enable 1
    setprop sys.usb.state ${sys.usb.config}

 


on property:sys.usb.config=mtp,adb

 

    stop adb
    write /sys/class/android_usb/android0/enable 0
    write /sys/class/android_usb/android0/idVendor 18d1
    write /sys/class/android_usb/android0/idProduct 4e42
    write /sys/class/android_usb/android0/functions ${sys.usb.config}
    write /sys/class/android_usb/android0/enable 1
    start adbd
    write /config/usb_gadget/g1/UDC ci_hdrc.0
    
    setprop sys.usb.state ${sys.usb.config}

 

on property:sys.usb.config=mtp,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 2514
    write /sys/class/android_usb/android0/functions ${sys.usb.config}
    write /sys/class/android_usb/android0/f_acm/instances 2
    write /sys/class/android_usb/android0/enable 1
    start adbd
    setprop sys.usb.state ${sys.usb.config}

 


on property:sys.usb.config=ptp
    stop adbd
    write /sys/class/android_usb/android0/enable 0
    write /sys/class/android_usb/android0/idVendor 18d1
    write /sys/class/android_usb/android0/idProduct 4e43
    write /sys/class/android_usb/android0/functions ${sys.usb.config}
    write /sys/class/android_usb/android0/enable 1
    setprop sys.usb.state ${sys.usb.config}

 

on property:sys.usb.config=ptp,adb
    write /sys/class/android_usb/android0/enable 0
    write /sys/class/android_usb/android0/idVendor 18d1
    write /sys/class/android_usb/android0/idProduct 4e44
    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}

 

How can i use acm and adb ?

Outcomes