USB Gadget does not recognize disconnect
Hello,
I'm kind of stuck with my STM32MP157C custom board. In general, everything works fine except for the USB. I'm using the new Ecosystem 5 and using the USB OTG with the NCM Ethernet gadget. My USB has no ID pin wired and is in peripheral mode all the time.
When the system has booted and I connect my device via USB to the PC, I get the following output, and the Ethernet connection works fine:
dwc2 49000000.usb-otg: new device is high-speed
[ 96.736784] dwc2 49000000.usb-otg: new address 42
[ 97.115268] IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready
When I disconnect the device, I get no output at all, and also none when I reconnect. The connection then does not work in any way until I reboot. I think the system is not even recognizing the connection loss. But I don't know why. I use the script provided by ST (stm32_usbotg_eth_config.sh) for setting up the gadget, and I have tried all device tree configurations I found for STM32MP1 by now. I will attach mine below.
When I'm trying to stop the gadget manually, I get the following output:
sudo /sbin/stm32_usbotg_eth_config.sh stop
Stop usb gadget
[ 171.527296] dwc2 49000000.usb-otg: dwc2_hsotg_ep_stop_xfr: timeout GINTSTS.GOUTNAKEFF
[ 171.534034] dwc2 49000000.usb-otg: dwc2_hsotg_ep_stop_xfr: timeout DOEPCTL.EPDisable
[ 171.755671] dwc2 49000000.usb-otg: dwc2_hsotg_ep_stop_xfr: timeout GINTSTS.GOUTNAKEFF
[ 171.762413] dwc2 49000000.usb-otg: dwc2_hsotg_ep_stop_xfr: timeout DOEPCTL.EPDisable
[ 171.771005] dwc2 49000000.usb-otg: dwc2_hsotg_ep_stop_xfr: timeout GINTSTS.GOUTNAKEFF
[ 171.778243] dwc2 49000000.usb-otg: dwc2_hsotg_ep_stop_xfr: timeout DOEPCTL.EPDisable
And when I try starting again, the system just crashes.
I would be very grateful for help.
Best regards,
Julius
