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.

MSP430F5529: USB fails to enumerate when exiting LPM2

Part Number: MSP430F5529

Hi,

I have a battery powered product here that goes into LPM2 sleep mode and wakes up once a minute then goes back to sleep.

The device is fitted with a USB connector and I have a VUSB_On interrupt into my software stack. Upon connection of the USB the interrupt is triggered, device wakes up and exits Low Lower Mode.

The problem exists that the USB will fail to enumerate until you 'get lucky' after the 3rd or so USB connection attempt.

Does anyone have any suggestions on the best approach for exiting LPM on a USB connection?.  I figure the MSP430 will take some time to startup again and get the clocks going, which possibly violates the USB requirement for enumeration.

Thanks

Stomp!

  • Hello Stomp,

    Are you calling USB_connect() after USB_handleVbusOnEvent()? If the device is attached to a host, and software calls USB_connect(), the host usually begins enumerating it immediately. The state shifts to ST_ENUM_IN_PROGRESS. Usually enumeration finishes quickly, and the state moves to USB_ENUM_ACTIVE. However, for a variety of reasons, this may not happen. Descriptions about these reasons can be found in Section 6.10 in the MSP430 USB Programmer's API Guide. Also, check out Figure 8 which has the USB Device State Diagram. From your description, it sounds like the device is going from the ST_PHYS_DISCONNECTED state to the ST_PHYS_CONNECTED_NOENUM state when VBUS appears. The issue seems to be when going from the ST_PHYS_CONNNECTED_NOENUM state to ST_ENUM_ACTIVE state.

    Lastly, Section 12 has some helpful debugging tips that should be very helpful.

    Regards,

    James

    MSP Customer Applications

  • Hi James,

    Thanks for your detailed response. The level of support we get from TI is world class!.

    Our MSP430 USB stack has worked well in several products now for quite some time, however its only that we have switched one of our products to sleep in LPM2 mode, if we sleep in LPM0 mode the problem does not occur.

    Likewise we can connect and disconnect the USB cable a couple of times and the device eventually enumerates when sleeping in LPM2, but works fine all the time in LPM0.

    I'll do some analysis of what state the device is in and report back.

    Thanks for your help.

    Cheers
    Stomp!.
  • Hello Stomp,

    Did you resolve your issue?

    Regards,

    James

    MSP Customer Applications
  • Hi James,

    Its pretty poor form that I forget to close out these forum posts, I'll try and improve in the future.

    The solution to the problem was to put some additional delay time from the VBus_On interrupt to when we configure the device. I am under the impression that the combination of how our device works, along with the oscillator startup time from sleep were causing some problems with the USB system.

    It is resolved. Thanks.

    Stomp!

  • Hello Stomp,

    It's no problem at all. I just wanted to follow-up with you, and I'm glad to hear you figured it out! Also, thanks for coming back to share your solution with the community. I'm sure it will help others in the future.

    Regards,

    James

    MSP Customer Applications

**Attention** This is a public forum