【i.mx.rt1061】 the USB device can not detect disconnection from a host

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

【i.mx.rt1061】 the USB device can not detect disconnection from a host

1,474 Views
bobhi009
Contributor I

Hi:

        I try to get a notification when the USB decice disconnected from a host.

1. I modified the value of the macro definition USB_DEVICE_CONFIG_DETACH_ENABLE 

/*! @brief Whether the device detached feature is enabled or not. */
#define USB_DEVICE_CONFIG_DETACH_ENABLE (1U)

2. Add  Event handler In callback function 

bobhi009_0-1630141749564.png

But cannot detect the connection status.

 

when I modify the ehci driver  like shown as below , I can detect the device plug into a host , and can't detect unplug from the host yet. 

bobhi009_1-1630141896430.png

 

So how to get a notification when the USB decice disconnected from a host.

 

 

 

0 Kudos
Reply
4 Replies

831 Views
stefan_bgw
Contributor I

Hi @bobhi009 ,

Did you menage to solve this issue??

@jingpan 

The thing is that USB_DeviceEhciIsrFunction(...) function is not even triggered when USB is detached...

0 Kudos
Reply

1,462 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @bobhi009 ,

I follow you step on my RT1060 EVK. It works well. Attach and Detach information is printed on UART.  I test on the USB CDC demo.

 

Regards,

Jing

0 Kudos
Reply

1,458 Views
bobhi009
Contributor I

Thanks for your replay,

Did you modify the echi driver  like this? 

bobhi009_0-1630306024673.png

 

 

0 Kudos
Reply

1,452 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

No, I didn't change here.

 

Regards,

Jing

0 Kudos
Reply