When i disconnect and connect USB cable, while using USB-CDC i get 16 bytes previously loaded to the driver, how can i remove them?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-12 5:36 AM
Every period of time i send ~33bytes through USB CDC, if suddenly USB cable disconnected and reconnect i get 16 bytes of the last message loaded, and then continue to get new messages.
How can i detect disconnection and were these 16 bytes located?
- Labels:
-
STM32H7 Series
-
USB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-12 5:54 AM
Sounds more like a windows driver issue than an STM32 thing. Windows should be able to detect when it's unplugged (COM port goes away). Use a USB monitor to see if the actual data on the line includes the 16 bytes.
You can reset the USB peripheral on disconnect (VBUS goes low) and reinitialize to stop whatever ongoing transaction it's doing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-12 6:36 AM
Actually it happens on Linux. Linux allow re-connection.
On Windows the communication does not recover after re-connecting the cable, It requires resetting the device in order to reconnect.
Is there a event on VBUS changes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-12 6:46 AM
