AnsweredAssumed Answered

Generate USB device detach event

Question asked by Stefan Agner on Aug 16, 2017
Latest reply on Aug 28, 2017 by Stefan Agner

Using U-Boot's USB Gadget stack for a USB client protocol implementation generates a proper USB disconnect on i.MX 6 devices, however, on i.MX 7 it does not generate a USB disconnect. This seem to cause issues on some hosts for subsequent USB reenumeration, hence I am trying to understand why i.MX 7 behaves differently.

 

As far as I understand the USB disconnect is generated by udc_disconnect in drivers/usb/gadget/ci_udc.c by writing a 0 to USBCMD RS field. According to the i.MX 6 and 7 Reference Manual this should cause a disconnect

Device operation mode:
Writing a one to this bit will cause the controller to enable a pull-up on D+ and initiate an attach event. This
control bit is not directly connected to the pull-up enable, as the pull-up will become disabled upon
transitioning into high-speed mode. Software should use this bit to prevent an attach event before the
controller has been properly initialized. Writing a 0 to this will cause a detach event.

 

It just seems that this does not work on i.MX 7... How can I properly cause a detach even on i.MX 7?

 

What I also noticed is that in the i.MX 7 Reference Manaul some register are described in the USB-PHY chapter 11.5, however, a register map for the USB PHY seems to be missing....

 

Best regards

Stefan

Outcomes