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.

MSP430 - USB CDC Comms fail on MCU reboot

Other Parts Discussed in Thread: MSP430F5528

Hi,

Im using a MSP430F5528 - USB CDC for Serial Comms. Ive found a problem that when forcing the Firmware reboot causes lose of USB comms? The Device manager on the PC still can see the MSP430 CDC COM port but no serial comms.

Ive found that when primary USB power is removed (i.e usb cable removed) and reapplied the USB serial Comms is works, the problem is only after a firmware reboot.

Is there a formal procedure for the MSP430 USB library to ensure on Firmware reboot the USB comms that is established is not lost?

Any suggestions would be grateful.

Kind regards

Des

  • Just an update,

    It looks like I can save the USB COM from crashing by ensuring that the PC terminal program is disconnected from the COM port being used by the MSP though this is without calling USB_disconnect() or USB_disable() functions. 

    My intention is to keep the COM Port established once connected with PC, this can disappear of removal of USB power etc.

    Any thoughts?

    Des

    PS this post was helpful

    http://e2e.ti.com/support/microcontrollers/msp430/f/166/t/342912.aspx

  • If for some reason the USB slave disconnects (and an MCU reboot is a good reason for this), Windoze unloads the drivers and the COM port disappears. Once the device reconnects, the drivers are loaded again and the COM port reappears, but it is a new instance (jsut with the same name) and the previous connection to the application is severed (the driver doesn’t know that the app did connect last time and still thinks it can access the port).

    The only solution I can think of is that the application must be aware of a possibly disappearing COM port (checkign the status in regular intervals, testing for return error codes on read/write calls), so it tries to reconnect once the OS gives an error.
    (most apps do not even check for an error, assuming a COM port is always there if it was there once, and read/write is always working)

  • ...uve hit the nail on the head there.

    For now Ive tweaked the PC application so thats it aware of a disappearing COM port (found by VID and PID) and waits for it to appear again after issue MCU reboot messages.

    Thank you for you suggestion..

    Des

**Attention** This is a public forum