how to enable adb tool in L5.4.3_1.0.0 of imx6qpsaredsd

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to enable adb tool in L5.4.3_1.0.0 of imx6qpsaredsd

4,425 Views
yibhan
Contributor III

Dear all,

I want to use adb tools in yocto, especially L5.4.3_1.0.0, but it doesn't seem to work.

please let me know about enabling adb tool in yocto linux in detail, I am new in yocto project.

==========================

Build Configuration:
BB_VERSION           = "1.44.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "ubuntu-16.04"
TARGET_SYS           = "arm-poky-linux-gnueabi"
MACHINE              = "imx6qpsabresd"
DISTRO               = "fsl-imx-xwayland"
DISTRO_VERSION       = "5.4-zeus"
TUNE_FEATURES        = "arm vfp cortexa9 neon thumb callconvention-hard"
TARGET_FPU           = "hard"
meta                 
meta-poky            = "HEAD:0275e68b0576cdefc19718e4b1977044f9f43f48"
meta-oe              
meta-multimedia      
meta-python          = "HEAD:aad5b3d070cd8c58828b0975cf861d8ebc90f460"
meta-freescale       = "HEAD:0be39721cea6e04c589a419f4bb07fabd0da6704"
meta-freescale-3rdparty = "HEAD:aea3771baa77e74762358ceb673d407e36637e5f"
meta-freescale-distro = "HEAD:ca27d12e4964d1336e662bcc60184bbff526c857"
meta-bsp             
meta-sdk             
meta-ml              = "HEAD:435f5e984856a943986491fddd061734a0b9eba5"
meta-browser         = "HEAD:5f365ef0f842ba4651efe88787cf9c63bc8b6cb3"
meta-rust            = "HEAD:5cda04c7c2158fc982502ca1e7893f71e4ca1729"
meta-gnome           
meta-networking      
meta-filesystems     = "HEAD:aad5b3d070cd8c58828b0975cf861d8ebc90f460"
meta-qt5             = "HEAD:432ad2aa6c3a13253fefc909faba368851d21fb1"

Labels (2)
0 Kudos
6 Replies

4,071 Views
raghavendra_ale
Contributor I

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

 

A+,
Raghav
------------------------------------------------------------------------------
If Java had true garbage collection, most programs would delete themselves upon execution.
~ Robert Sewell
0 Kudos

4,266 Views
yibhan
Contributor III

Hello gusarambula,

Thank you for the answer. I have an another concern. Should I add or modify some of kernel configuration for adding adb tools in yocto? I think a device should detect adb device in usb at first.

Thank you in advance.

Best Regards,

0 Kudos

4,266 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Yibeom Han,

I haven’t tested these android tools in Yocto, but from my experience with adb you would need to connect the device in developer mode so that it can connect trough adb.

Regards,

0 Kudos

4,266 Views
yibhan
Contributor III

Hi guys,

I want to know how to enable ADB tools in Yocto project so that I could use ADB functions in linux project.

Do you have any idea to apply ADB tools into yocto project? I am using L5.4.3_1.0.0 in yocto?

I just want to know how to activate ADB tools package and to build and deploy, then check if it is applied in device.

I am new in yocto project.

0 Kudos

4,266 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Yibeom Han,

I haven’t seen ADB tools as part of the Yocto Project as is. However, it seems that there are some Android Tools included as part of the Open Embedded layer.

You can add these tools to your Yocto image on the BSP Release or Community BSP by adding the following line to your conf/local.conf file on the build directory:

IMAGE_INSTALL_append = " android-tools "

I hope that this helps!

Regards,

0 Kudos

4,266 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Yibeom Han,

Are you referring to Android Debug Bridge (link below)? If that’s the case there is not a Yocto integration of the adb tools that I’m aware of, but it is available as part of the i.MX Android BSPs.

https://developer.android.com/studio/command-line/adb

The available Android BSPs for the i.MX are available on the link below. The latest Android BSP for the i.MX6QP SABRE would be P9.0.0_2.2.0.

https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/android-os-for-...

I hope this helps!

Regards,

0 Kudos