Closed shwetachauhan closed 2 years ago
Not sure which SDK example you are using, but the DCD implement has some issue on disconnect handling here.
In ux_dcd_mcimx6_interrupt_thread.c, line 225 there is check if device state is attached, actually the check should be if device state is "above" attached including addressed or configured, so it should be something like following:
if (device -> ux_slave_device_state >= UX_DEVICE_ATTACHED) _ux_device_stack_disconnect();
Thus when disconnect detected after enumeration, stack is notified on disconnection and instance is deactivated.
@shwetachauhan Does this answer your question?
Closing.
Hi,
I have modified usbx_device_mass_storage sdk example for IMXRT060-EVK to include the activate and deactivate callback as shown below:
As of now I am just printing inside these callbacks as shown below: VOID demo_thread_media_activate(VOID storage) { PRINTF("demo_thread_media_activate.....\r\n"); } VOID demo_thread_media_deactivate(VOID storage) { PRINTF("demo_thread_media_deactivate.....\r\n"); }
I do receive the activate callback when I plug in USB but do not get deactivate callback when plugging out the USB but gets both deactivate and activate callback prints after I plugin USB post plugging out .