cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
212 Views
Registered: ‎02-17-2020

Unable to create a mass storage gadget ,On linux host getting xhci_drop_endpoint called with disable endpoint error

Kernel Configuration

Device Drivers-------->

    USB support

        <*> USB Gadget Support

            <M>   USB Gadget Drivers – Xilinx usb driver M

            <M>   Gadget Filesystem

            <M>   Mass Storage Gadget

File systems  --->

    Pseudo filesystems  --->

        {M} Userspace-driven configuration filesystem

 

CONFIG_USB_DWC3 = y
CONFIG_USB_DWC3_DUAL_ROLE = y
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_PLATFORM=y

CONFIG_CONFIGFS_FS=m
CONFIG_USB_GADGET=y
CONFIG_USB_LIBCOMPOSITE=m
CONFIG_USB_F_MASS_STORAGE=m
CONFIG_USB_CONFIGFS=m
CONFIG_USB_CONFIGFS_MASS_STORAGE=y


Device tree

dr_mode = "peripheral";

 

But unable to create a mass storage gadget with full configuration as in wondows it is detected as mass storage but drive is not detected.On linux host getting xhci_drop_endpoint called with disable endpoint error.

0 Kudos
5 Replies
Highlighted
Moderator
Moderator
162 Views
Registered: ‎02-07-2018

Re: Unable to create a mass storage gadget ,On linux host getting xhci_drop_endpoint called with disable endpoint error

HI @yashasdg_007 

Please follow steps mentioned in below link:https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841729/Zynq+Ultrascale+MPSOC+Linux+USB+device+driver

Please use this script for mass storage if are using 2018.x onwards petalinux.

modprobe configfs
modprobe libcomposite.ko
modprobe usb_f_mass_storage.ko
modprobe gadgetfs.ko

dd if=/dev/zero of=/tmp/mydev count=500 bs=1M
mount -t configfs none /sys/kernel/config
cd /sys/kernel/config/usb_gadget
mkdir g1
cd g1
echo "64" > bMaxPacketSize0
echo "0x200" > bcdUSB
echo "0x100" > bcdDevice
echo "0x03FD" > idVendor
echo "0x0501" > idProduct
cat max_speed
echo "high-speed" > max_speed
mkdir functions/mass_storage.ms0
mkdir configs/c1.1
echo /tmp/mydev > functions/mass_storage.ms0/lun.0/file
echo 1 > functions/mass_storage.ms0/lun.0/removable
ln -s functions/mass_storage.ms0/ configs/c1.1/
echo "fe200000.dwc3" > UDC

 

 

Thanks & Regards

Aravind

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

0 Kudos
Highlighted
Visitor
Visitor
150 Views
Registered: ‎02-17-2020

Re: Unable to create a mass storage gadget ,On linux host getting xhci_drop_endpoint called with disable endpoint error

@aravindb 

I have followed the above mentioned steps only but only it is detected as mass storage but not as drive and it is unable to communicate due to the end point related issue even with usb 2.0 is also unable to communicate.

0 Kudos
Highlighted
Moderator
Moderator
142 Views
Registered: ‎02-07-2018

Re: Unable to create a mass storage gadget ,On linux host getting xhci_drop_endpoint called with disable endpoint error

HI @yashasdg_007 

What is the host machine you are using it, is it windows or Ubuntu machine, Can you please connect USB cable between  board & Ubuntu host machine after running that above mentioned script.

I have tested in all versions, i dont see any issues in Eval boards.

 

THanks & eragrds

Aravind

0 Kudos
Highlighted
Visitor
Visitor
133 Views
Registered: ‎02-17-2020

Re: Unable to create a mass storage gadget ,On linux host getting xhci_drop_endpoint called with disable endpoint error

Linux host i have connected after connecting first it will show this

With USB 3.0 in linux host

Getting

New Super speed USB deviceno using xchi_hcd

USB device found vid pid

Mfr product sril no

Configuration chosen from 1 choice

SCSI emulation for USB mass storage devices

Device found at

Waiting for device to settle before scanning

Device scan complete

Reset super speed USB device no using xchi_hcd

xcHI_drop_endpoint called with disabled ep ffff880162bf3408

 

For USB 2.0

usb 1-1.4: new high speed USB device number 53 using ehci_hcd
usb 1-1.4: New USB device found, idVendor=03fd, idProduct=0500
usb 1-1.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
usb 1-1.4: configuration #1 chosen from 1 choice
scsi13 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 53
usb-storage: waiting for device to settle before scanning
usb 1-1.4: USB disconnect, device number 53

Please give me the kernel configuration parameters as i have doubt in that and also the UDC which is being showed in /sys/class/udc is fe2000000.dwc3 in forum it is ci_hdrc.o is this is impacting anythng please let me know.

 

 

 

0 Kudos
Highlighted
Visitor
Visitor
90 Views
Registered: ‎02-17-2020

Re: Unable to create a mass storage gadget ,On linux host getting xhci_drop_endpoint called with disable endpoint error

Need full info of Kernel configuration and device tree for gadget support as per the xilinx url followed but unable to access in linux host.

0 Kudos