after configure configfs gadget and connect ubuntu machine getting disabled event

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

after configure configfs gadget and connect ubuntu machine getting disabled event

跳至解决方案
2,275 次查看
ankitpanchal167
Contributor III

Hi 

i am try to enable configfs gadget using usb_f_fs.ko with imx8mp

kernel version : 5.4 

below My gadget configuration.

modprobe libcomposite
mkdir -p /run/usb/config
mount none /run/usb/config -t configfs
cd /run/usb/config/usb_gadget/
mkdir g1
cd g1
echo 0x1600 >idVendor

echo 0x0030 >idProduct

mkdir strings/0x409
echo "0000000000" >strings/0x409/serialnumber
echo "XYZ" >strings/0x409/manufacturer

echo "product1" >strings/0x409/product

mkdir configs/c.1
mkdir configs/c.1/strings/0x409
echo "Config1" >configs/c.1/strings/0x409/configuration

mkdir functions/ffs.usb0
ln -s functions/ffs.usb0 configs/c.1
cd ../../../
mkdir -p ffs
mount usb0 ffs -t functionfs -o gid=1000,uid=1000

i am using ffs-test utility for test and it's able to endpoint. but after write UDC and connect with ubuntu os geting disabled event.

also test with windows its not geting any event ya response 

below attach logs with ubuntu os 

root@imx8mp:/run/usb/ffs# ~/ffs-test_magic_v2 64 &
[1] 1139
root@imx8mp:/run/usb/ffs#
ffs-test: info: ep0: writing descriptors (in v2 format)
ffs-test: info: ep0: writing strings
ffs-test: dbg: ep1: starting
ffs-test: dbg: ep2: starting
ffs-test: info: ep1: starts
ffs-test: info: ep0: starts
ffs-test: info: ep2: starts
root@imx8mp:/run/usb/ffs# echo 38100000.dwc3 > ../config/usb_gadget/g1/UDC
Event BIND
root@imx8mp:/run/usb/ffs# [ 483.832965] configfs-gadget gadget: full-speed config #1: c
Event DISABLE
 

below attach logs with windows os 

root@imx8mp:/run/usb/ffs# ~/ffs-test_magic_v2 64 &
[1] 1139
root@imx8mp:/run/usb/ffs#
ffs-test: info: ep0: writing descriptors (in v2 format)
ffs-test: info: ep0: writing strings
ffs-test: dbg: ep1: starting
ffs-test: dbg: ep2: starting
ffs-test: info: ep1: starts
ffs-test: info: ep0: starts
ffs-test: info: ep2: starts
root@imx8mp:/run/usb/ffs# echo 38100000.dwc3 > ../config/usb_gadget/g1/UDC
Event BIND

0 项奖励
回复
1 解答
2,259 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Can you see what happened in kernel log?

在原帖中查看解决方案

0 项奖励
回复
2 回复数
2,260 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Can you see what happened in kernel log?

0 项奖励
回复
2,253 次查看
ankitpanchal167
Contributor III

Hi

It's descriptor issue now its resolved 

Thanks 

0 项奖励
回复