This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USB_CDC com port connection lost after reset

Hi,

I've a similar problem like:

USB virtual com port communication lost

My usecase:

- USB is enumerated and sending data

- Terminal program is running

- I reset the msp via:

    USB_disconnect();
    USB_disable();
    PMMCTL0 |= PMMSWPOR;


- I do see the Comport vanish in the device-manager

- after the reset and USB initialization, the com port is there again in the device-manager

- but, the terminal get no data anymore, and when I restart the terminal, it even doesn't find the
virtual com port indicated in the device-manager.

I'm running Windows 7.

Any idea?

regards,

Steffen

  • Hi,

    Try closing the COM port before you issue the USB_disconenct() and subsequent commands.  And then re-opening the COM port after USB is connected again.

    If that does not work then after disconencting USB, close out of the terminal window and unplug the USB cable and emulation cable (if there is one) from the host machine and re-connect and then open the terminal window again.

     

    Regards,

    Arthi Bhat

     

  • Not closing USB COM port makes that port unusable in Windows (MSFT feature). Cured only by rebooting PC.

    Either you have to write your windows application strictly confirming to plug-n-play architecture design. Search MSFT knowledge base for docs related to USB programming and plug-n-play.

    Regards,

    Alexey

  • @Alexey

    See below, not quite unusable.

    But for plug'n play , that sounds bad. Do you have a link?

    @Arthi Bhat

    If I close the COM Port, and then reset the MSP again, it works.

    The initializing reset can occur because of watchdog...

    The problem is, the MSP doesn't know about the host side...

    thanks to both of you

    Steffen

**Attention** This is a public forum