Hello, I put in place a "USB mass storage gadget" and basically the device works like a charm. For an entire day no issues at all, with my "dumb" device (a regular soundbar), the USB-Host, access to it (USB mass storage gadget) just like a regular "usb pen drive" without any kind of problem all the day long. The issue arises when the USB-host stops to access the usb mass storage gadget for hours; of course, during the night, the bar is powered off and does not play sounds, but next morning when I turn it on again, there is no way to let the bar access USB mass storage gadget until I force a reboot of my Linux machine. Analyzing logs (dmesg mainly) does not show any kind of issue, error, traceback or other, so I tried to investigate more in details, and I discovered that the "virtual" usb port created by dwc2 driver (named, in my case "fe980000.usb") hangs in "not attached" state forever; finally found thanks to this command: cat /sys/class/udc/fe980000.usb/state not attached I tried several Linux embedded utilities as well as, reset scripts found on the the web, in order to "reset" the device, the port, the hub, and even the full usb-stack, but no way to "restore" the right functionality of the virtual usb port, unless you do a full fresh reboot. After the reboot, the port goes in "not attached" and immediately, when I power-on the USB host it goes in "configured" state and works like a charm again. Among my several tests, I performed: 1) unbind/bind 2) modprobe -r dwc2 modprobe dwc2 3) modprobe -r g_mass_storage modprobe g_mass_storage file=/piusb.bin stall=0 removable=y watching the results in the logs, and every command returns and performs right, without any error, but the port still remains, always "not attached". In the end, I tried to create, by myself, a python script with this content, and I was pretty confident, to get the right result, cause I got in the dmesg logs, almost the same identical output I get during a standard reboot: SyntaxEditor Code Snippet CMD_UNMOUNT1 = "modprobe -r g_mass_storage" CMD_SYNC2 = "sync" CMD_UNMOUNT3 = " modprobe -r dwc2" CMD_MOUNT4 = "modprobe dwc2" CMD_MOUNT5 = "modprobe g_mass_storage file=/piusb.bin stall=0 removable=y" os.system(CMD_UNMOUNT1) time.sleep(30) os.system(CMD_SYNC2) time.sleep(30) os.system(CMD_UNMOUNT3) time.sleep(30) os.system(CMD_MOUNT4) time.sleep(30) os.system(CMD_MOUNT5) With this python script I get this log from dmesg, and, this is really almost identical to what I get from dmesg during a reboot: [Feb14 10:35] dwc2 fe980000.usb: remove, state 4 [ +0.000052] usb usb3: USB disconnect, device number 1 [ +0.004965] dwc2 fe980000.usb: USB bus 3 deregistered [Feb14 10:36] dwc2 fe980000.usb: supply vusb_d not found, using dummy regulator [ +0.000972] dwc2 fe980000.usb: supply vusb_a not found, using dummy regulator [ +0.207690] dwc2 fe980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM [ +0.000173] dwc2 fe980000.usb: DWC OTG Controller [ +0.000014] dwc2 fe980000.usb: new USB bus registered, assigned bus number 3 [ +0.000023] dwc2 fe980000.usb: irq 38, io mem 0xfe980000 [ +0.000155] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.01 [ +0.000008] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ +0.000005] usb usb3: Product: DWC OTG Controller [ +0.000005] usb usb3: Manufacturer: Linux 6.1.0-rpi7-rpi-v8 dwc2_hsotg [ +0.000005] usb usb3: SerialNumber: fe980000.usb [ +0.000315] hub 3-0:1.0: USB hub found [ +0.000028] hub 3-0:1.0: 1 port detected [ +30.033766] Mass Storage Function, version: 2009/09/11 [ +0.000033] LUN: removable file: (no medium) [ +0.000132] LUN: removable file: /piusb.bin [ +0.000016] Number of LUNs=1 [ +0.000271] g_mass_storage gadget.0: Mass Storage Gadget, version: 2009/09/11 [ +0.000020] g_mass_storage gadget.0: userspace failed to provide iSerialNumber [ +0.000013] g_mass_storage gadget.0: g_mass_storage ready [ +0.000019] dwc2 fe980000.usb: bound driver g_mass_storage [ +0.297414] dwc2 fe980000.usb: new device is full-speed [ +0.363083] dwc2 fe980000.usb: new device is full-speed [ +0.964163] dwc2 fe980000.usb: new device is full-speed [ +0.964170] dwc2 fe980000.usb: new device is full-speed Looking at the log, I was pretty confident, but unfortunately, "cat /sys/class/udc/fe980000.usb/state" still returns "not attached" and power-on the soundbar has no change, it starts blinking as nothing is attached. Even running the script with the bar powered-on, you can see every "cycle", as if you manually, remove the cable, and at a time, you put the cable again etc.. but no change, it starts blinking and "cat /sys/class/udc/fe980000.usb/state" reamins "not attached". Something is still missing, so I asked some Linux expert and he told me to write to the mailing list cause maybe a bug and, to complete, if I do the same action with a regular usb-key mass storage pendrive, one hundred times, the USB-host (soundbar) recognizes it immediately and starts playing with no fault at all. Thank you very much in advance, Best regards Federico