USBD_MS_Example : Disconnect USB

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi,

When trying to run the USBD_MS_Example1 I encountered the followin problem.
Startup the debugger for the first time and the SD card is properly showing in the windows explore, when disconnecting and reconnecting the USB cable the SD card isn't shown anymore. The only way to resolve the problem is to reset the project then the SD card will re-appear.
Something I've seen also is that when disconnecting the device the event EVENT_USB_Device_Disconnect is never triggered (Is this the problem?), I've tried executing the Disconnect code just before the Connect event but did didn't also resolve my problem.
Can somebody help me with this issue?

Regards
0 Likes
6 Replies
Not applicable
Hi preychler,

The problem where after reconnect, the SD card is not showing is because the Endpoint did not reset while disconnect.
We also found this issue recently with other USB APP and currently is working on the fixed.

As for the Disconnect event not trigger during disconnection, it looks like a software bug. It shouldn't behave this way.
The Disconnect event should be triggered when the device is disconnect and so that the device state could be change.
We will look into this issue to find the root cause and the fix to it.
0 Likes
Not applicable
Hi,

When should we expect the fix to this issue.
0 Likes
Not applicable
Hi preychler,

We are currently still looking for the solution to it.
The fixed will be done on DAVE4 USB APP but if there is a solution, it should be able to implement in DAVE3 USB APP.
0 Likes
Not applicable
Hi preychler,

For the Disconnect event not detected, it is due to the connection of the USB connector.
For relax kit, the USB ID pin (Pin 4 of the USB connector) is not connected, so the plug/unplug actions will not be detected.
In order for the plug and unplug detection, P0.9 of XMC4500 has to be connected with the USB ID pin.
Therefore, in this case the unplugged action is not detected and the Disconnect event is not called.
0 Likes
Not applicable
Hi Jackson,

Thanks for the response.
We are currently using the processor on our own developed board and will try to see if we have the disconnect event correctly on that board. (P0.9 is connected on that board)

Can you send me the extra code needed to reset the endpoint in the disconnect event to resolve my first problem.
0 Likes
Not applicable
Hi preychler,

Can you please add the USBD_MS_init() into the EVENT_USB_Device_Disconnect?
Of course this is not a solution but a workaround for now.

P/S: We are still working on the real solution/fixed for this problem.
0 Likes