如何把开发板配置成usb device 的从设备模式

请教下如何把开发板配置成usb device 的从设备模式,如 uvc camera,插到电脑上设备管理器识别出uvc camera的usb设备节点,又如 U盘,插到电脑上可是识别到U盘设备。

anyone know? need some help thanks

Hello @hyphop

Please help to setup the board as OTG device. Thanks.

@hugoleong are you asking for linux ?
if so, please refer to this topic thread :slightly_smiling_face:

Thank you, I will refer to it

  1. which kernel ?
  2. more details about what u need !?
  3. i have write something about this How to use g_mass_storage module - #3 by hyphop

board: VIM3
kernel: Linux 4.9

I want to configure the board to be recognized as uvccamera device when connected to PC

ok! what u wait from otg uvccamera mode ?

such as,Plug in a Mipi / USB camera on the board, and then connect the board to the PC.
PC can use amcap to open the uvccamera

ok! im not sure about automaticly works without additional manipulations (need check drivers sources )

in any case u need rebuild kernel and u need next options

CONFIG_USB_G_WEBCAM for legacy mode
or
CONFIG_USB_CONFIGFS_F_UVC for configfs way

both of whem not enabled in default fenix configuration

I recompiled the kernel with the following modifications:

1.in the linux directory apply the following changes

=> drivers/amlogic/usb: AMLOGIC_USBPHY must select USB_PHY to link properly · g4bwy/khadas-linux@d9a6fe9 · GitHub
=> arm64: kvim3_miner_defconfig: enable USB and EEM gadget support · g4bwy/khadas-linux@564439f · GitHub
=> arm64: kvim3_miner.dts: set dwc2_a controller-type to device only mode · g4bwy/khadas-linux@d8b8378 · GitHub
2.start the fenix build again and press enter when asked if you want to proceed with the modified files
3.update kernel

$ sudo dpkg -i linux-dtb-.deb
$ sudo dpkg -i linux-image-.deb
$ sync
$ sudo reboot
4.Run the following script

#!/bin/sh
cd /sys/kernel/config/usb_gadget/
mkdir -p /sys/kernel/config/usb_gadget/camera
cd camera
echo $VID > idVendor
echo $PID > idProduct
mkdir strings/0x409
echo $MANUFACTURER > strings/0x409/manufacturer
echo $PRODUCT > strings/0x409/product
echo $SERIALNUMBER > strings/0x409/serialnumber

mkdir functions/uvc.usb0
cd functions/uvc.usb0
mkdir control/header/h/
echo “0x0110” > control/header/h/bcdUVC
echo “48000000” > control/header/h/dwClockFrequency
ln -s control/header/h/ control/class/fs/
ln -s control/header/h/ control/class/ss/

cat < control/terminal/camera/default/bmControls
$CamControl1
$CamControl2
$CamControl3
EOF

cat < control/processing/default/bmControls
$ProcControl1
$ProcControl2
EOF

#YUV
mkdir streaming/uncompressed/u/
for i in $YUV
do
if [ $i = 360p ];then
mkdir streaming/uncompressed/u/360p/
echo “333333” > streaming/uncompressed/u/360p/dwFrameInterval
echo “333333” > streaming/uncompressed/u/360p/dwDefaultFrameInterval
echo “55296000” > streaming/uncompressed/u/360p/dwMaxBitRate
echo “460800” > streaming/uncompressed/u/360p/dwMaxVideoFrameBufferSize
echo “55296000” > streaming/uncompressed/u/360p/dwMinBitRate
echo “360” > streaming/uncompressed/u/360p/wHeight
echo “640” > streaming/uncompressed/u/360p/wWidth
elif [ $i = 720p ];then
mkdir streaming/uncompressed/u/720p/
echo “333333” > streaming/uncompressed/u/720p/dwFrameInterval
echo “333333” > streaming/uncompressed/u/720p/dwDefaultFrameInterval
echo “29491200” > streaming/uncompressed/u/720p/dwMaxBitRate
echo “1843200” > streaming/uncompressed/u/720p/dwMaxVideoFrameBufferSize
echo “29491200” > streaming/uncompressed/u/720p/dwMinBitRate
echo “720” > streaming/uncompressed/u/720p/wHeight
echo “1280” > streaming/uncompressed/u/720p/wWidth
elif [ $i = 1080p ];then
mkdir streaming/uncompressed/u/1080p/
echo “333333” > streaming/uncompressed/u/1080p/dwFrameInterval
echo “333333” > streaming/uncompressed/u/1080p/dwDefaultFrameInterval
echo “29491200” > streaming/uncompressed/u/1080p/dwMaxBitRate
echo “4147200” > streaming/uncompressed/u/1080p/dwMaxVideoFrameBufferSize
echo “29491200” > streaming/uncompressed/u/1080p/dwMinBitRate
echo “1080” > streaming/uncompressed/u/1080p/wHeight
echo “1920” > streaming/uncompressed/u/1080p/wWidth
else
echo “YUV $i is invalid!”
fi
done

#MJPEG
mkdir streaming/mjpeg/m/
for i in $MJPEG
do
if [ $i = 360p ];then
mkdir streaming/mjpeg/m/360p/
echo “333333” > streaming/mjpeg/m/360p/dwFrameInterval
echo “333333” > streaming/mjpeg/m/360p/dwDefaultFrameInterval
echo “10240000” > streaming/mjpeg/m/360p/dwMaxBitRate
echo “460800” > streaming/mjpeg/m/360p/dwMaxVideoFrameBufferSize
echo “10240000” > streaming/mjpeg/m/360p/dwMinBitRate
echo “360” > streaming/mjpeg/m/360p/wHeight
echo “640” > streaming/mjpeg/m/360p/wWidth
elif [ $i = 720p ];then
mkdir streaming/mjpeg/m/720p/
echo “333333” > streaming/mjpeg/m/720p/dwFrameInterval
echo “333333” > streaming/mjpeg/m/720p/dwDefaultFrameInterval
echo “20480000” > streaming/mjpeg/m/720p/dwMaxBitRate
echo “1843200” > streaming/mjpeg/m/720p/dwMaxVideoFrameBufferSize
echo “20480000” > streaming/mjpeg/m/720p/dwMinBitRate
echo “720” > streaming/mjpeg/m/720p/wHeight
echo “1280” > streaming/mjpeg/m/720p/wWidth
elif [ $i = 1080p ];then
mkdir streaming/mjpeg/m/1080p/
echo “333333” > streaming/mjpeg/m/1080p/dwFrameInterval
echo “333333” > streaming/mjpeg/m/1080p/dwDefaultFrameInterval
echo “40960000” > streaming/mjpeg/m/1080p/dwMaxBitRate
echo “4147200” > streaming/mjpeg/m/1080p/dwMaxVideoFrameBufferSize
echo “40960000” > streaming/mjpeg/m/1080p/dwMinBitRate
echo “1080” > streaming/mjpeg/m/1080p/wHeight
echo “1920” > streaming/mjpeg/m/1080p/wWidth
elif [ $i = 2160p ];then
mkdir streaming/mjpeg/m/2160p/
echo “333333” > streaming/mjpeg/m/2160p/dwFrameInterval
echo “333333” > streaming/mjpeg/m/2160p/dwDefaultFrameInterval
echo “61440000” > streaming/mjpeg/m/2160p/dwMaxBitRate
echo “16588800” > streaming/mjpeg/m/2160p/dwMaxVideoFrameBufferSize
echo “61440000” > streaming/mjpeg/m/2160p/dwMinBitRate
echo “2160” > streaming/mjpeg/m/2160p/wHeight
echo “3840” > streaming/mjpeg/m/2160p/wWidth
else
echo “MJPEG $i is invalid!”
fi
done

#FRAMEBASED
mkdir streaming/framebased/fb/
for i in $H264
do
if [ $i = 360p ];then
mkdir streaming/framebased/fb/360p/
echo “333333” > streaming/framebased/fb/360p/dwFrameInterval
echo “333333” > streaming/framebased/fb/360p/dwDefaultFrameInterval
echo “8192000” > streaming/framebased/fb/360p/dwMaxBitRate
echo “8192000” > streaming/framebased/fb/360p/dwMinBitRate
echo “360” > streaming/framebased/fb/360p/wHeight
echo “640” > streaming/framebased/fb/360p/wWidth
elif [ $i = 720p ];then
mkdir streaming/framebased/fb/720p/
echo “333333” > streaming/framebased/fb/720p/dwFrameInterval
echo “333333” > streaming/framebased/fb/720p/dwDefaultFrameInterval
echo “10240000” > streaming/framebased/fb/720p/dwMaxBitRate
echo “10240000” > streaming/framebased/fb/720p/dwMinBitRate
echo “720” > streaming/framebased/fb/720p/wHeight
echo “1280” > streaming/framebased/fb/720p/wWidth
elif [ $i = 1080p ];then
mkdir streaming/framebased/fb/1080p/
echo “333333” > streaming/framebased/fb/1080p/dwFrameInterval
echo “333333” > streaming/framebased/fb/1080p/dwDefaultFrameInterval
echo “15360000” > streaming/framebased/fb/1080p/dwMaxBitRate
echo “15360000” > streaming/framebased/fb/1080p/dwMinBitRate
echo “1080” > streaming/framebased/fb/1080p/wHeight
echo “1920” > streaming/framebased/fb/1080p/wWidth
elif [ $i = 2160p ];then
mkdir streaming/framebased/fb/2160p/
echo “333333” > streaming/framebased/fb/2160p/dwFrameInterval
echo “333333” > streaming/framebased/fb/2160p/dwDefaultFrameInterval
echo “30720000” > streaming/framebased/fb/2160p/dwMaxBitRate
echo “30720000” > streaming/framebased/fb/2160p/dwMinBitRate
echo “2160” > streaming/framebased/fb/2160p/wHeight
echo “3840” > streaming/framebased/fb/2160p/wWidth
else
echo “H264 $i is invalid!”
fi
done
mkdir streaming/header/h/
ln -s streaming/uncompressed/u/ streaming/header/h/
ln -s streaming/mjpeg/m/ streaming/header/h/
ln -s streaming/framebased/fb/ streaming/header/h/

ln -s streaming/header/h/ streaming/class/fs/
ln -s streaming/header/h/ streaming/class/hs/
ln -s streaming/header/h/ streaming/class/ss/

#-Create and setup configuration
cd …/…/
mkdir configs/c.1/
echo 500 > configs/c.1/MaxPower
echo 0xc0 > configs/c.1/bmAttributes
mkdir configs/c.1/strings/0x409/
echo “Config 1” > configs/c.1/strings/0x409/configuration
ln -s functions/uvc.usb0/ configs/c.1/

mkdir functions/uac1.a2
echo 3 > functions/uac1.a2/p_chmask
echo 48000 > functions/uac1.a2/p_srate
#echo 1 > functions/uac1.a2/req_number
#echo 96001 > functions/uac1.a2/c_srate
#echo 1 > functions/uac1.a2/p_chmask
#mkdir configs/c.2
#echo 120 > configs/c.2/MaxPower
#mkdir configs/c.2/strings/0x409
#echo “paycam mic” > configs/c.2/strings/0x409/configuration
ln -s functions/uac1.a2/ configs/c.1/

ls /sys/class/udc > UDC
echo “0x01” > bDeviceProtocol
echo “0x02” > bDeviceSubClass
echo “0xEF” > bDeviceClass

However, after the board is connected to the PC, the PC cannot recognize the USB device

show dmesg / from both sides - its can help :wink:
another one dont forget change dtb for otg mode for vendor kernel

Dmesg is a little long, which part do you want to see。
and how to change dtb for otg mode for vendor kernel?

all about USB its will be enough :wink:

[ 0.547053] usbcore: registered new interface driver usbfs
[ 0.547117] usbcore: registered new interface driver hub
[ 0.547201] usbcore: registered new device driver usb
[ 0.775772] usbcore: registered new interface driver asix
[ 0.775855] usbcore: registered new interface driver ax88179_178a
[ 0.775910] usbcore: registered new interface driver cdc_ether
[ 0.775966] usbcore: registered new interface driver cdc_eem
[ 0.776020] usbcore: registered new interface driver net1080
[ 0.776076] usbcore: registered new interface driver rndis_host
[ 0.776132] usbcore: registered new interface driver cdc_subset
[ 0.776185] usbcore: registered new interface driver zaurus
[ 0.776251] usbcore: registered new interface driver cdc_ncm
[ 0.776308] usbcore: registered new interface driver qmi_wwan
[ 0.776405] usbcore: registered new interface driver GobiNet
[ 0.777447] usbcore: registered new interface driver cdc_acm
[ 0.777529] usbcore: registered new interface driver cdc_wdm
[ 0.777591] usbcore: registered new interface driver usb-storage
[ 0.777685] usbcore: registered new interface driver usbserial
[ 0.777737] usbcore: registered new interface driver usbserial_generic
[ 0.777777] usbserial: USB Serial support registered for generic
[ 0.777830] usbcore: registered new interface driver ch341
[ 0.777875] usbserial: USB Serial support registered for ch341-uart
[ 0.777927] usbcore: registered new interface driver cp210x
[ 0.777966] usbserial: USB Serial support registered for cp210x
[ 0.778019] usbcore: registered new interface driver ftdi_sio
[ 0.778062] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 0.778120] usbcore: registered new interface driver option
[ 0.778161] usbserial: USB Serial support registered for GSM modem (1-port)
[ 0.778213] usbcore: registered new interface driver pl2303
[ 0.778257] usbserial: USB Serial support registered for pl2303
[ 0.778768] usbcore: registered new interface driver xpad
[ 0.779348] usbcore: registered new interface driver uvcvideo
[ 0.779424] usbcore: registered new interface driver cx231xx
[ 0.782356] usbcore: registered new interface driver usbhid
[ 0.782374] usbhid: USB HID core driver
[ 3.517681] amlogic-new-usb2-v2 ffe09000.usb2phy: USB2 phy probe:phy_mem:0xffe09000, iomap phy_base:0xffffff80086fa000
[ 3.528060] amlogic-new-usb3-v2 ffe09080.usb3phy: USB3 phy probe:phy_mem:0xffe09080, iomap phy_base:0xffffff80086fe080
[ 4.927246] usbcore: registered new interface driver snd-usb-audio
[ 5.230214] usb usb2: We don’t know the algorithms for LPM for this host, disabling LPM.
[ 5.238436] dwc_otg: usb0: type: 2 speed: 0, config: 0, dma: 0, id: 0, phy: ffe09000, ctrl: 0
[ 5.552463] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[ 5.812580] usb 2-1: new SuperSpeed USB device number 2 using xhci-hcd
[ 5.997610] usb 1-1.1: new high-speed USB device number 3 using xhci-hcd
[ 6.520507] usb 1-1.1.1: new low-speed USB device number 4 using xhci-hcd
[ 6.640579] input: USB OPTICAL MOUSE as /devices/platform/ff500000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.1/1-1.1.1/1-1.1.1:1.0/0003:0000:3825.0001/input/input4
[ 6.650552] hid-generic 0003:0000:3825.0001: input,hidraw0: USB HID v1.11 Mouse [ USB OPTICAL MOUSE] on usb-xhci-hcd.0.auto-1.1.1/input0
[ 6.744464] usb 1-1.1.3: new low-speed USB device number 5 using xhci-hcd
[ 6.864965] input: LIZHI Flash IC USB Keyboard as /devices/platform/ff500000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:1C4F:0082.0002/input/input5
[ 6.932723] hid-generic 0003:1C4F:0082.0002: input,hidraw1: USB HID v1.11 Keyboard [LIZHI Flash IC USB Keyboard] on usb-xhci-hcd.0.auto-1.1.3/input0
[ 6.947093] input: LIZHI Flash IC USB Keyboard as /devices/platform/ff500000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.1/0003:1C4F:0082.0003/input/input6
[ 7.016662] hid-generic 0003:1C4F:0082.0003: input,hiddev0,hidraw2: USB HID v1.11 Keyboard [LIZHI Flash IC USB Keyboard] on usb-xhci-hcd.0.auto-1.1.3/input1
[ 7.108463] usb 1-1.1.4: new high-speed USB device number 6 using xhci-hcd
[ 9.457994] input: HD Pro Webcam C920 as /devices/platform/ff500000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.1/1-1.1.4/1-1.1.4:1.0/input/input7
[ 77.169286] usb 1-1.1.1: USB disconnect, device number 4
[ 77.452900] usb 1-1.1.1: new low-speed USB device number 7 using xhci-hcd
[ 77.585377] input: USB OPTICAL MOUSE as /devices/platform/ff500000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.1/1-1.1.1/1-1.1.1:1.0/0003:0000:3825.0004/input/input8
[ 77.586367] hid-generic 0003:0000:3825.0004: input,hidraw0: USB HID v1.11 Mouse [ USB OPTICAL MOUSE] on usb-xhci-hcd.0.auto-1.1.1/input0

need something like this

[   10.159607] dwc2 ff400000.usb: bound driver configfs-gadget
[   10.320724] dwc2 ff400000.usb: new device is high-speed
[   10.435152] dwc2 ff400000.usb: new device is high-speed
[   10.499055] dwc2 ff400000.usb: new address 1

are u sure otg was enable in DTB ?

  • check you kernel config again may be something missed

its my config from krescue

root@Krescue:/# zcat /proc/config.gz | grep -e _G_ -e _USB_GA  -e _USB_CO -e _US
B_F
CONFIG_USB_COMMON=y
# CONFIG_USB_CONN_GPIO is not set
# CONFIG_USB_FOTG210_HCD is not set
# CONFIG_USB_FTDI_ELAN is not set
CONFIG_USB_GADGET=y
# CONFIG_USB_GADGET_DEBUG is not set
# CONFIG_USB_GADGET_DEBUG_FILES is not set
# CONFIG_USB_GADGET_DEBUG_FS is not set
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
# CONFIG_USB_FOTG210_UDC is not set
# CONFIG_USB_GADGET_XILINX is not set
CONFIG_USB_F_ACM=y
CONFIG_USB_F_SS_LB=y
CONFIG_USB_F_SERIAL=y
CONFIG_USB_F_OBEX=y
CONFIG_USB_F_NCM=y
CONFIG_USB_F_ECM=y
CONFIG_USB_F_EEM=y
CONFIG_USB_F_SUBSET=y
CONFIG_USB_F_RNDIS=y
CONFIG_USB_F_MASS_STORAGE=y
CONFIG_USB_F_FS=y
CONFIG_USB_F_UAC1=m
CONFIG_USB_F_UAC1_LEGACY=m
CONFIG_USB_F_UAC2=m
CONFIG_USB_F_UVC=m
CONFIG_USB_F_MIDI=m
CONFIG_USB_F_HID=y
CONFIG_USB_F_PRINTER=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_ACM=y
CONFIG_USB_CONFIGFS_OBEX=y
CONFIG_USB_CONFIGFS_NCM=y
CONFIG_USB_CONFIGFS_ECM=y
CONFIG_USB_CONFIGFS_ECM_SUBSET=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
# CONFIG_USB_CONFIGFS_PHONET is not set
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_LB_SS=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_UAC1=y
CONFIG_USB_CONFIGFS_F_UAC1_LEGACY=y
CONFIG_USB_CONFIGFS_F_UAC2=y
CONFIG_USB_CONFIGFS_F_MIDI=y
CONFIG_USB_CONFIGFS_F_HID=y
CONFIG_USB_CONFIGFS_F_UVC=y
CONFIG_USB_CONFIGFS_F_PRINTER=y
CONFIG_USB_G_NCM=m
CONFIG_USB_GADGETFS=m
CONFIG_USB_FUNCTIONFS=m
CONFIG_USB_FUNCTIONFS_ETH=y
# CONFIG_USB_FUNCTIONFS_RNDIS is not set
CONFIG_USB_FUNCTIONFS_GENERIC=y
# CONFIG_USB_G_SERIAL is not set
CONFIG_USB_G_PRINTER=m
# CONFIG_USB_G_NOKIA is not set
# CONFIG_USB_G_ACM_MS is not set
CONFIG_USB_G_MULTI=m
# CONFIG_USB_G_MULTI_RNDIS is not set
CONFIG_USB_G_MULTI_CDC=y
CONFIG_USB_G_HID=m
# CONFIG_USB_G_DBGP is not set
CONFIG_USB_G_WEBCAM=m

am not sure, its my config from krescue

#CONFIG_USELIB is not set
CONFIG_USER_NS=y
CONFIG_DEFAULT_USE_ENERGY_AWARE=y
#CONFIG_USERFAULTFD is not set
#CONFIG_DEBUG_PERF_USE_VMALLOC is not set
CONFIG_HAVE_PERF_USER_STACK_DUMP=y
CONFIG_MODULES_USE_ELF_RELA=y
B_F#CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
#CONFIG_CPU_FREQ_GOV_USERSPACE is not set
CONFIG_XFRM_USER=y
#CONFIG_CEPH_LIB_USE_DNS_RESOLVER is not set
CONFIG_MAY_USE_DEVLINK=y
CONFIG_AMLOGIC_USB=y
CONFIG_AMLOGIC_USB_DWC_OTG_HCD=y
CONFIG_AMLOGIC_USB_HOST_ELECT_TEST=y
CONFIG_AMLOGIC_USBPHY=y
CONFIG_AMLOGIC_USB2PHY=y
CONFIG_AMLOGIC_USB3PHY=y
#CONFIG_AMLCAP_LOG_TIME_USEFORFRAMES is not set
#CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
#CONFIG_USB_SWITCH_FSA9480 is not set
CONFIG_USB_NET_DRIVERS=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_AX88179_178A=y
CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_NET_CDC_EEM=y
CONFIG_USB_NET_CDC_NCM=y
CONFIG_USB_NET_NET1080=y
CONFIG_USB_NET_RNDIS_HOST=y
CONFIG_USB_NET_CDC_SUBSET_ENABLE=y
CONFIG_USB_NET_CDC_SUBSET=y
CONFIG_USB_BELKIN=y
CONFIG_USB_ARMLINUX=y
CONFIG_USB_NET_ZAURUS=y
CONFIG_USB_NET_QMI_WWAN=y
CONFIG_THERMAL_GOV_USER_SPACE=y
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
CONFIG_USB_GSPCA=m
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=y
CONFIG_USB_HID=y
CONFIG_USB_HIDDEV=y
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
#CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
CONFIG_USB_DEFAULT_PERSIST=y
#CONFIG_USB_DYNAMIC_MINORS is not set
CONFIG_USB_OTG=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_PCI=y
CONFIG_USB_XHCI_PLATFORM=y
CONFIG_USB_EHCI_HCD=y
#CONFIG_USB_EHCI_ROOT_HUB_TT is not set
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_EHCI_PCI=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PCI=y
CONFIG_USB_ACM=y
#CONFIG_USB_PRINTER is not set
CONFIG_USB_WDM=y
#CONFIG_USB_TMC is not set
CONFIG_USB_STORAGE=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_HOST=y
CONFIG_USB_DWC3_PCI=y
CONFIG_USB_DWC3_OF_SIMPLE=y
CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_CONSOLE=y
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_CH341=y
#CONFIG_USB_SERIAL_WHITEHEAT is not set
#CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
CONFIG_USB_SERIAL_CP210X=y
#CONFIG_USB_SERIAL_CYPRESS_M8 is not set
#CONFIG_USB_SERIAL_EMPEG is not set
CONFIG_USB_SERIAL_FTDI_SIO=y
CONFIG_USB_SERIAL_PL2303=y
CONFIG_USB_SERIAL_WWAN=y
CONFIG_USB_SERIAL_OPTION=y
CONFIG_USB_PHY=y
CONFIG_USB_ISP1301=y
#CONFIG_USB_ULPI is not set
#CONFIG_DUAL_ROLE_USB_INTF is not set
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
CONFIG_USB_LIBCOMPOSITE=y
CONFIG_USB_U_ETHER=y
CONFIG_USB_F_EEM=y
CONFIG_USB_F_RNDIS=y
CONFIG_USB_F_MASS_STORAGE=m
CONFIG_USB_F_FS=y
CONFIG_USB_F_UVC=m
CONFIG_USB_F_MIDI=y
CONFIG_USB_F_MTP=y
CONFIG_USB_F_PTP=y
CONFIG_USB_F_AUDIO_SRC=y
CONFIG_USB_F_ACC=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_RNDIS=y
CONFIG_USB_CONFIGFS_EEM=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_MTP=y
CONFIG_USB_CONFIGFS_F_PTP=y
CONFIG_USB_CONFIGFS_F_ACC=y
CONFIG_USB_CONFIGFS_F_AUDIO_SRC=y
CONFIG_USB_CONFIGFS_UEVENT=y
CONFIG_USB_CONFIGFS_F_MIDI=y
CONFIG_USB_MASS_STORAGE=m
CONFIG_USB_G_WEBCAM=m
CONFIG_DEVFREQ_GOV_USERSPACE=y
CONFIG_EXT4_USE_FOR_EXT2=y
CONFIG_INOTIFY_USER=y
CONFIG_NFS_USE_LEGACY_DNS=y
#CONFIG_DEBUG_STACK_USAGE is not set
#CONFIG_TEST_USER_COPY is not set
CONFIG_AMLOGIC_USER_FAULT=y
CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y
CONFIG_HAVE_ARCH_HARDENED_USERCOPY=y
CONFIG_HARDENED_USERCOPY=y
#CONFIG_HARDENED_USERCOPY_PAGESPAN is not set
#CONFIG_CRYPTO_USER is not set
CONFIG_CRYPTO_USER_API=y
CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_USER_API_SKCIPHER=y
#CONFIG_CRYPTO_USER_API_RNG is not set
#CONFIG_CRYPTO_USER_API_AEAD is not set
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y

which configuration options are about OTG

i have write before :wink:

Is it necessary to change kbi portmode from PCIE to USB? and how to change it