How is the USB disconnection detection working in i.MX6?

cancel
Showing results for 
Search instead for 
Did you mean: 

How is the USB disconnection detection working in i.MX6?

430 Views
Contributor II

Hello Hi,

We are developing a product based on i.MX6 Dual lite running linux on it.  It has a USB port supporting both HOST and DEVICE modes (using  i.MX6 OTG USB port).


We are failing to detect the "USB disconnections" randomly. This is seen in both host mode and device mode.

Could somebody help me to understand how USB disconnection detection works, specifically in device mode?

I understand how it works when i.MX6 is in HOST mode. If USB device is removed from bus, as the device side termination is gone, host side voltage will go ~800mV. Disconnection Envelope Detector would detect this during the EOP of a SOF and USB controller/PHY would understand that device is no longer attached to the bus. 

But how is the disconnect detection mechanism working when i.MX6 is in device mode? Could somebody help me to understand it? Linux divers are relying on USB interrupt and checking the port status registers. But  I am trying to understand the HW detection mechanism. 

Thanks in advance!

Regards,
Sonu

Labels (4)
0 Kudos
3 Replies

49 Views
NXP TechSupport
NXP TechSupport

Hi Sonu

in device mode one can try to monitor VBUS signal, using USB_nOTGSCregister

and for example "VBus Valid Interrupt" event.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

49 Views
Contributor II

Hi Igor,

Thank you for your reply. Unfortunately we cannot use the VBUS based mechanism.

The above mentioned use case is for Apple Carplay, and we are powering the iphone from our unit always.

I was wondering what would be other mechanisms to detect  "host disconnect" from device side.

Thanks,

Sonu

0 Kudos

49 Views
NXP TechSupport
NXP TechSupport

Hi Sonu

one can use CCS (Current Connect Status-) bit USB_nPORTSC1 register.

Best regards
igor

0 Kudos