• AVR Freaks

Hot!USB CDC disconnect/reconnect issue in Windows 10

Author
Valin0126
New Member
  • Total Posts : 22
  • Reward points : 0
  • Joined: 2020/02/07 04:53:15
  • Location: 0
  • Status: offline
2020/06/24 04:15:46 (permalink)
0

USB CDC disconnect/reconnect issue in Windows 10

PIC32MZ1024EFE
Harmony 2.06

This seems like a Windows 10 issue but maybe related to the USB CDC settings?

If the device is powered up with the USB cable connected or disconnected and then plugged in after power-up, Windows enumerates the device and can communicate via the comm port.

After that if the USB cable is disconnected (USB_DEVICE_Detach() is called) and reconnected (USB_DEVICE_Attach() is called), Windows still enumerates the device but when a software tool attempts to open the comm port it generates a file not found error (custom Python code) or tterm doesn't even see the comm port.

Have not yet tested on other Windows versions to see if this is specific to 10:
Note I did notice the speed setting difference (I inherited the project), it didn't make any difference making them match:

Attached Image(s)

#1

5 Replies Related Threads

    Paul PortSol
    Super Member
    • Total Posts : 630
    • Reward points : 0
    • Joined: 2015/07/03 11:52:03
    • Location: Newfoundland, Canada
    • Status: offline
    Re: USB CDC disconnect/reconnect issue in Windows 10 2020/06/24 05:58:29 (permalink)
    0
    Known issues in Hv206
    - Known bugs, some people using Hv204, or patching Hv206. Search for posts about patching USB in Harmony 2.06
    - Heap size? I've found 10K safe when using USB (500bytes in some sample code isn't reliable on reconnect)
    - Ensure big enough cap on USB 5V if is supplying power 
     
    Paul
     
     
    #2
    crosland
    Super Member
    • Total Posts : 2017
    • Reward points : 0
    • Joined: 2005/05/10 10:55:05
    • Location: Warks, UK
    • Status: offline
    Re: USB CDC disconnect/reconnect issue in Windows 10 2020/06/24 06:20:16 (permalink)
    0
    Valin0126
    After that if the USB cable is disconnected (USB_DEVICE_Detach() is called) and reconnected (USB_DEVICE_Attach() is called), Windows still enumerates the device but when a software tool attempts to open the comm port it generates a file not found error (custom Python code) or tterm doesn't even see the comm port.

     
    Was the Python code/tterm already running and had it previously opened the port?
     
    Try closing the Python/tterm and running it again.
     
    If that fixes it then that's just how Windows works. Even though the same Virtual COM port is assigned, the underlying drivers are using a different handle.
    #3
    Valin0126
    New Member
    • Total Posts : 22
    • Reward points : 0
    • Joined: 2020/02/07 04:53:15
    • Location: 0
    • Status: offline
    Re: USB CDC disconnect/reconnect issue in Windows 10 2020/06/24 06:33:22 (permalink)
    0
    crosland
    Valin0126
    After that if the USB cable is disconnected (USB_DEVICE_Detach() is called) and reconnected (USB_DEVICE_Attach() is called), Windows still enumerates the device but when a software tool attempts to open the comm port it generates a file not found error (custom Python code) or tterm doesn't even see the comm port.

     
    Was the Python code/tterm already running and had it previously opened the port?
     
    Try closing the Python/tterm and running it again.
     
    If that fixes it then that's just how Windows works. Even though the same Virtual COM port is assigned, the underlying drivers are using a different handle.


    Yes, tried all that.  Opening/closing the programs did not resolve the issue.
    #4
    nigelwright7557
    Super Member
    • Total Posts : 447
    • Reward points : 0
    • Joined: 2006/11/06 08:15:51
    • Location: 0
    • Status: offline
    Re: USB CDC disconnect/reconnect issue in Windows 10 2020/06/24 06:49:59 (permalink)
    0
    i found using 2.06 if i closed down pc program then reopened it the usb was locked up.
    i went back to 2.04 and it worked fine.
     
    #5
    Valin0126
    New Member
    • Total Posts : 22
    • Reward points : 0
    • Joined: 2020/02/07 04:53:15
    • Location: 0
    • Status: offline
    Re: USB CDC disconnect/reconnect issue in Windows 10 2020/06/24 06:58:46 (permalink)
    0
    nigelwright7557
    i found using 2.06 if i closed down pc program then reopened it the usb was locked up.
    i went back to 2.04 and it worked fine.
     


    Reverting to 2.04 is not really an option for this application.  The bootloader (USB HID) did have to revert to 2.04 as the HID is also broken in 2.06.
    #6
    Jump to:
    © 2020 APG vNext Commercial Version 4.5