USB Detach

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

USB Detach

646 Views
jmag99
Contributor II

I am using the MQX USB device stack.  I am wondering if there is a way to force the usb connection to detach and shut down until the user unplugs and re-plugs the USB cable to the device.

0 Kudos
2 Replies

341 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi,

If you want to reset the USB interface (resulting in a detach event), you could use the following functions (considering the CDC example):

  • USB_Class_CDC_DeInit --> for de-initialize the USB CDC (disappears from Device Manager).
  • USB_Class_CDC_Init --> for re-initialize the USB CDC (appears again on Device Manager).

Hope this will be useful for you.

Best regards!

/Carlos

0 Kudos

341 Views
jmag99
Contributor II

Unfortunately, the HID class does not have the same function.  I added one, but it does not do what I needed.  Instead, I have put the USB peripheral into standby and controlled the pull-ups manually.  Removing the D+ pullup, using the OTGCTL register, causes the device to detach through a software means.  It can be recovered by just putting the pull-up control back and re-enabling the peripheral (plus plugging in the cable).

0 Kudos