星期二, 5月 16, 2023
星期五, 5月 05, 2023
how to enable adb tool in L5.4.3_1.0.0 of imx6qpsaredsd
how to enable adb tool in L5.4.3_1.0.0 of imx6qpsaredsd
https://elinux.org/images/e/ef/USB_Gadget_Configfs_API_0.pdf
https://community.nxp.com/t5/i-MX-Processors/how-to-enable-adb-tool-in-L5-4-3-1-0-0-of-imx6qpsaredsd/m-p/1066983
You need to include the "android-tools" in your build recipe
IMAGE_INSTALL += "\
android-tools \
"
The device adb daemon "adbd" uses kernel USB gadget config for communication.
The Linux kernel USB Gadget Configfs interface should be used to configure the required function (adb or adb+acm or other)
USB Gadget configs interface explained here USB_Gadget_Configfs_API
Below is an example USB Gadget configuration:
mount -t configfs none /sys/kernel/config
mkdir -p /sys/kernel/config/usb_gadget/g1
#USB 2.0
echo 0x0200 > /sys/kernel/config/usb_gadget/g1/bcdUSB
#Instantiate English strings
mkdir -p /sys/kernel/config/usb_gadget/g1/strings/0x409
echo 1 > /sys/kernel/config/usb_gadget/g1/os_desc/use 1
#Configure VID/PID/ProductName/Serial (replace with your vid/pid)
echo "0x1d6b" > /sys/kernel/config/usb_gadget/g1/idVendor
echo "0x0104" > /sys/kernel/config/usb_gadget/g1/idProduct
echo "0123456789" > /sys/kernel/config/usb_gadget/g1/strings/0x409/serialnumber
echo "Foo Inc" > /sys/kernel/config/usb_gadget/g1/strings/0x409/manufacturer
echo "Bar Prod" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product
#Create Function(s) Instance(s)
mkdir -p /sys/kernel/config/usb_gadget/g1/functions/ffs.adb
mkdir -p /sys/kernel/config/usb_gadget/g1/configs/b.1
mkdir -p /sys/kernel/config/usb_gadget/g1/configs/b.1/strings/0x409
echo "ffs.adb" > /sys/kernel/config/usb_gadget/g1/configs/b.1/strings/0x409/configuration
#Bind functions
ln -s /sys/kernel/config/usb_gadget/g1/functions/ffs.adb /sys/kernel/config/usb_gadget/g1/configs/b.1
mkdir -p /dev/usb-ffs
mkdir -p /dev/usb-ffs/adb
mount -t functionfs adb /dev/usb-ffs/adb
#Start adbd daemon
start-stop-daemon --start --background --oknodo --quiet --exec /usr/bin/adbd
echo 0x1 > /sys/kernel/config/usb_gadget/g1/os_desc/b_vendor_code
#Attach created gadget device to the UDC driver
#UDC driver name obtained from "ls /sys/class/udc/"
echo ci_hdrc.0 > /config/usb_gadget/g1/UDC
訂閱:
文章 (Atom)