进入buildroot目录执行配置命令:
make menuconfig 1
打开adb相关配置,如下图所示
进入100ask_imx6ull-sdk/Buildroot_2019.02/board/100ask/bash/etc/init.d目录,进行如下步骤:
1、新建一个usb目录
mkdir usb 1
2、在init.d目录下新建文件
vi S91usb 并添加如下内容,配置usb composit: #! /bin/sh CONFIGS_HOME=/sys/kernel/config/usb_gadget/demo case "$1" in start) modprobe libcomposite mount none /sys/kernel/config -t configfs mkdir /sys/kernel/config/usb_gadget/demo cd /sys/kernel/config/usb_gadget/demo mkdir strings/0x409 echo 0x1802 > idVendor echo 0x1d06 > idProduct echo 0x0100 > bcdDevice echo "1234567ab" > strings/0x409/serialnumber echo "stack" > strings/0x409/manufacturer echo "usb composite" > strings/0x409/product mkdir -p /sys/kernel/config/usb_gadget/demo/configs/c.1 mkdir -p /sys/kernel/config/usb_gadget/demo/configs/c.1/strings/0x409 echo "adb+xxxx" > $CONFIGS_HOME/configs/c.1/strings/0x409/configuration echo 0xc0 > $CONFIGS_HOME/configs/c.1/bmAttributes echo 500 > $CONFIGS_HOME/configs/c.1/MaxPower /etc/init.d/usb/uvc $1 /etc/init.d/usb/adb $1 ls /sys/class/udc > $CONFIGS_HOME/UDC ;; stop) echo none > /sys/kernel/config/usb_gadget/demo/UDC /etc/init.d/usb/adb $1 ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac exit $?
3、在usb目录下新建adb配置文件
vi adb 并添加如下内容: #!/bin/sh # # Start adb.... # case "$1" in start) cd /sys/kernel/config/usb_gadget killall adbd mkdir -p demo/functions/ffs.adb ln -s demo/functions/ffs.adb demo/configs/c.1 mkdir -p /dev/usb-ffs/adb adb_dev="imx6ull-adb-dev" if [ ! -f "/usr/data/disableadb" ];then echo "Starting adb ..." echo -n $adb_dev > demo/strings/0x409/serialnumber cd - mount -t functionfs adb /dev/usb-ffs/adb adbd & sleep 1 else echo "Not start adb" echo -n $adb_dev > demo/strings/0x409/serialnumber cd - fi ;; stop) killall adbd sleep 1 umount /dev/usb-ffs/adb rm /sys/kernel/config/usb_gadget/ -rf rm /sys/kernel/config/usb_gadget/ -rf umount /sys/kernel/config ;; restart|reload) ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac exit $?
进入kernel目录下,执行命令:
make menuconfig 1
配置如下图所示:
将之前配置后的buildroot和kernel进行重新编译,进入Buildroot执行编译命令,并烧写新生成的emmc.img。
在pc执行命令:
adb shell 1
登录效果如下图所示:
执行命令:
adb push filename / 1
通过上述命令可以将名为filename的文件传输到开发板的根目录下,注意使用adb传输文件一次只能传输一个文件。