Hello Felipe, I have a boundary devices nitrogen8m board and am trying to use the usb-device port as a mass storage device. I see no activity on my usb analyzer when I run the script below. So I followed the instructions here: https://www.kernel.org/doc/html/v4.18/driver-api/usb/dwc3.html. Attached are the compressed regdump and trace files. I know the electrical is OK because I can stop at uboot, use command = "ums 0 mmc 0" and nitrogen8m shows up as mass storage device. After I let Linux boot up, I cannot use the usb-device port as a mass storage device. I have been stuck for several days now. No help from Boundary Devices. My only theory is that uboot may be touching usb-device registers and this prevents linux usb-device from working. Just a theory. ### ### Nitrogen8m board Uboot version: ### U-Boot 2018.07-35271-ge6bfe39 (Aug 10 2018 - 12:37:43 +0000) real-aarch64-linux-android-gcc (GCC) 4.9.x 20150123 (prerelease) GNU ld (binutils-2.25-f3d35cf6) 2.25.51.20141117 ### ### Nitrogen8m board Linux kernel: ### uname -a Linux nitrogen8m 4.14.98-2.0.0-ga+yocto+g0e18008a04cf ### ### Nitrogen8m board Modules.builtin include ### kernel/fs/configfs/configfs.ko kernel/drivers/usb/common/usb-common.ko kernel/drivers/usb/core/usbcore.ko kernel/drivers/usb/dwc2/dwc2.ko kernel/drivers/usb/dwc3/dwc3.ko kernel/drivers/usb/dwc3/dwc3-pci.ko kernel/drivers/usb/dwc3/dwc3-of-simple.ko kernel/drivers/usb/gadget/libcomposite.ko kernel/drivers/usb/gadget/function/usb_f_acm.ko kernel/drivers/usb/gadget/function/usb_f_ss_lb.ko kernel/drivers/usb/gadget/function/u_serial.ko kernel/drivers/usb/gadget/function/usb_f_serial.ko kernel/drivers/usb/gadget/function/usb_f_obex.ko kernel/drivers/usb/gadget/function/u_ether.ko kernel/drivers/usb/gadget/function/usb_f_ncm.ko kernel/drivers/usb/gadget/function/usb_f_ecm.ko kernel/drivers/usb/gadget/function/usb_f_eem.ko kernel/drivers/usb/gadget/function/usb_f_ecm_subset.ko kernel/drivers/usb/gadget/function/usb_f_rndis.ko kernel/drivers/usb/gadget/function/usb_f_mass_storage.ko kernel/drivers/usb/gadget/function/usb_f_fs.ko kernel/drivers/usb/gadget/udc/udc-core.ko kernel/fs/configfs/configfs.ko ### ### Nitrogen8m board device tree excerpt ### usb@38100000 { compatible = "fsl, imx8mq-dwc3"; #address-cells = <0x2>; #size-cells = <0x2>; ranges; clocks = <0x4 0xdc>; clock-names = "usb1_ctrl_root_clk"; assigned-clocks = <0x4 0x6e 0x4 0x98>; assigned-clock-parents = <0x4 0x56 0x4 0x48>; assigned-clock-rates = <0x1dcd6500 0x5f5e100>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <0x37>; dwc3 { compatible = "snps,dwc3"; reg = <0x0 0x38100000 0x0 0x10000>; interrupts = <0x0 0x28 0x4>; phys = <0x38 0x0 0x38 0x1>; phy-names = "usb2-phy", "usb3-phy"; power-domains = <0x39>; snps,power-down-scale = <0x2>; usb3-resume-missing-cas; usb3-lpm-capable; snps,has-lpm-erratum; snps,lpm-nyet-threshold = <0xf>; status = "okay"; dr_mode = "otg"; vbus-supply = <0x3a>; }; }; ----- mass storage script below ------ #!/bin/bash dd if=/dev/zero of=/dev/shm/file bs=1024 count=200 cd /sys/kernel/config/usb_gadget/ mkdir -p usbms cd usbms echo 0x1d6b > idVendor # Linux Foundation echo 0x0104 > idProduct # Multifunction Composite Gadget echo 0x0100 > bcdDevice # v1.0.0 echo 0x0200 > bcdUSB # USB2 mkdir -p strings/0x409 echo "fedcba9876543211" > strings/0x409/serialnumber echo "AndyPurcell" > strings/0x409/manufacturer echo "ap.mstore" > strings/0x409/product mkdir -p configs/c.1/strings/0x409 echo "Config1:mass storage" > configs/c.1/strings/0x409/configuration echo 20 > configs/c.1/MaxPower # Add functions here FILE=/dev/shm/file mkdir -p functions/mass_storage.usb0 echo 1 > functions/mass_storage.usb0/stall echo 0 > functions/mass_storage.usb0/lun.0/cdrom echo 0 > functions/mass_storage.usb0/lun.0/ro echo 0 > functions/mass_storage.usb0/lun.0/nofua echo $FILE > functions/mass_storage.usb0/lun.0/file ln -s functions/mass_storage.usb0 configs/c.1/ # see gadget configurations below # End functions ls /sys/class/udc > UDC Andy Purcell Keysight Technologies 900 South Taft Loveland, Colorado 80537 970-679-5976
Attachment:
regdump.txt.gz
Description: regdump.txt.gz
Attachment:
trace.txt.gz
Description: trace.txt.gz