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.

MSP430F6638: PC USB causes my device to lock up

Part Number: MSP430F6638

Reposting with less detail but new information.

My device uses the TI USB API in an HID configuration.

  • When the device is connected to the PC via a USB cable and no apps are open that will communicate with the device, plugging a peripheral into any USB port on my PC can possibly cause my project to lock-up (once every ten or so tries).
  • When the device is connected to an unattended PC via a USB cable overnight and no apps are open that will communicate with the device, the device will be locked up when I return to the office in the morning.
  • When the device is connected to the PC via a USB cable and an app has opened the device thus making it unavailable to any other app on my PC, even if the app is not trying to communicate with the device, my device will continue to operate (my device remained operational all weekend).

Does anyone have any troubleshooting ideas? Could it be related to the PC USB selective suspend even though it should be disabled?

  • Hi Fusillade,

    Can you ensure that all sleep states are disabled for your PC? Also, it sounds from your 3rd point that you are able to collect data continuously provided that you are connected to an app that is communicating with the device.  When you connect another usb device to your PC, this can trigger a re-enumeration of USB devices on that bus. I'm wondering if USB re-enumeration is causing the first issue you mentioned.

    BR,
    Leo

  • Closed the app (which was designed to open the port but not generate any communication) running on my PC yesterday before I left  after 72 hours with no issues. Came in this morning and the device is locked up. Checked power settings in Windows 10 Pro / Version 2004 / Build 19041.746:

    • Settings / Power & Sleep / Sleep (When plugged in, PC goes to sleep after "Never")
    • Settings / Power & Sleep / Additional Power Settings / Choose or customize a power plan / Change plan settings / Change advanced power settings / USB Settings / USB selective suspend settings / Disabled
    • Settings / Power & Sleep / Additional Power Settings / Choose or customize a power plan / Change plan settings / Change advanced power settings / Sleep / Sleep after / Never
    • Settings / Power & Sleep / Additional Power Settings / Choose or customize a power plan / Change plan settings / Change advanced power settings / Sleep / Allow Hybrid Sleep / On
    • Settings / Power & Sleep / Additional Power Settings / Choose or customize a power plan / Change plan settings / Change advanced power settings / Sleep / Hibernate after / never
    • Device Manager / USB Input Device Properties / Power Management / Allow the computer to turn off this device to save power / On  (was off last time I checked but it has been a while)

    Based on the device manager settings under HID for the USB Input Device, power management states that it can allow the computer to turn off this device to save power. I assume that Windows would generate a USB event to warn the the device of what is about to happen. So if Windows decided to "turn off this device to save power", the TI USB API must be designed to handle the USB event. Would this be a USBVECINT_PWR_VBUSOff event?

    You mentioned re-enumeration. What if Windows chooses to re-enumerate the device (which is what it could be doing based on the data generated in WireShark when I plug and unplug a device on my PC)? How does the TI USB API handle this event? Does it simply reset (USBVECINT_RSTR) the USB bus?

    My assumption is that my device does not properly handle a USB event during the described situations. I'm just trying to determine which events these are so I can debug from there.

    Thanks

  • FYI. I've changed the following setting and started a new test.

    • Device Manager / USB Input Device Properties / Power Management / Allow the computer to turn off this device to save power / Off

  • After changing the following setting:

    • Device Manager / USB Input Device Properties / Power Management / Allow the computer to turn off this device to save power / Off

    I left my device connected to the PC for 48 hours with no issues.

    Final test. With my device powered by the battery and the USB connector plugged into the instrument, I rebooted my PC. Immediately locks up my device.

    So, the issue I experience appears to be when the PC powers off the USB port. If this is the case, what event in the TI API app handles such an event? Would this be a USBVECINT_PWR_VBUSOff event?

    Thanks.

  • Hi Fusillade,

    If the device is getting locked up - it's likely a problem with the firmware that resides on a separate microcontroller that provides the USB HID to I2C bridge.  Although we don't publish this code, I can tell you that when we get this event, we shut down the clocks - which is likely why you are seeing your platform lock up.

    BR,
    Leo

  • Any tips to get around this issue?

  • Hi Fusillade,

    Since we don't release this code, the best solution is to turn off USB power management in Device Manager so that this event doesn't get sent to the platform.

    BR,
    Leo

  • Leo,

    Thanks for your help. I'll keep working on the problem. I have a stripped down version of the firmware running on the same device but it does not exhibit this behavior which lets me believe it is a firmware configuration issue.

**Attention** This is a public forum