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.

CCS/MSP430F5529: USB Low Power lock

Part Number: MSP430F5529

Tool/software: Code Composer Studio

Hi 

I am trialling the USB code that is bundled with the Launchpad for the MSP430F5529 and have compiled using the CDC. The device runs fine and communicates perfectly, however it goes into Low Power mode sometime after the PC enters sleep. The USB serial port is then switched off on the PC, and one cannot re-start the microcontroller from the USB - a reset of the MSP430 is required. I have edited all the functions in usbEventHandling.c to return TRUE but this does not fix the issue. I have also tried removing the bWake condition in iUsbInterruptHandler(void) in usblsr.c to always clear the low power mode bits (see below) but this also does not work.

//if (bWakeUp) //wdm change
    //{
        __bic_SR_register_on_exit(LPM3_bits);   // Exit LPM0-3
        __no_operation();  // Required for debugger
    //}

Please can you assist?

Regards, Warren

  • Hello Warren,

    I'm trying to understand the behavior you are seeing.  Is the below correct?  Can you expand on where I have questions?

    1. USB working as expected, communicating with PC.  

    2. PC goes to sleep.  After some time, MSP430 enters LPM mode.  

    3. PC switches off USB Serial port?  (What does this mean?  Does USB power remain?)

    4. PC is woken up but MSP430 stays asleep?  

    Thanks,

    JD

  • Hi JD, thanks very much for the response.

    Points 1, 2 & 4 are accurate.

    3. I have external power on my board to keep the MSP430 running with an LED toggling to indicate activity. If I leave the USB connected and the PC goes to sleep, after a period of time, the LED stops toggling, thus indicating that the MSP must be going into a LPM. If I run the board without the USB connected, the LED keeps running.

    I unfortunately do not have my FET here to debug, so have been programming the MSP via the USB. I assume that the code for the USB is putting the MSP into a LPM, but cannot find where this is done in the code.

  • Can anyone assist with this issue -  I cannot seem to find where the code put the MSP into LPM.

  • Hey Warren,

    Which USB CDC code example are you using? Is it C1_LEDOnOff?   Let me know what example and I'll take a look at the firmware. 

    Are you using a launchpad or some other EVM?

    Also, how long between computer going to sleep and the LED stop blinking? 

    I'm not convinced yet that the MSP430 is going to sleep or if something on the USB bus is somehow causing the MSP430 to stop running somehow.  

    Thanks,

    JD

  • Morning JD - thanks very much for responding.

    1. I am using the SimpleUSBBackChannel example

    2. I have designed my own board, but the USB circuit is exactly the same as the Launchpad MSP430F5529

    3. I have tried to establish exactly how long, but this has not been possible as the PC sleep varies. It appears as if it is about 2 minutes

    4. You may be right about the MSP430 not going into sleep - I assumed this because of the code in Usblsr.c which has a line clearing the LPM3 bits

    if (bWakeUp)
        {
            __bic_SR_register_on_exit(LPM3_bits);   // Exit LPM0-3
            __no_operation();  // Required for debugger
        }

    I have since established that if you disconnect the Com Port (Stop Communication in DockLight) the issue does not occur. Although disconnecting the Com Port is a solution in the App we need to still develop, I am worried that the MSP locks up before this can be done. 

    Your assistance to find the root cause of the Lock Up would be appreciated.

  • Hey Warren,

    I've done some digging on my side but I haven't been able to identify a specific root cause.  I've looked through the USB example and talked with the software team and I'm not aware of a state that puts the device into an "always" asleep mode.  I don't think the issue is a software one, in the USB Developer's Package.  I also reviewed all the known USB Errata, and none seem to match this case.  

    If anything, I think this leads me back to suspecting the PC side.   I have 2 theories. 

    1.  The USB Driver/DLL is ending up in a strange state, that isn't recognizing the connection or sending any signals

    2.  Somehow there is an issue with the USB power dropping out or maybe noise signal lines being fed into the MSP430.  If this is powering the MSP430 board, maybe it's causing issues that way.  

    Have you monitored the USB signals to see what they look like when this happens?  

    Have you tried it on any other computers/setups?  

    Thanks,

    JD

  • Hey Warren,

    Saw another thread today on USB.  It seems different to me but wanted you to be aware: https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/845259 

    If the USB power and signals look clean when the PC goes to sleep, do you have a USB decoder to trace the USB commands being sent similiar to that thread?  

    Thanks,

    JD

  • Hi JD - thanks for the response

    In answer to your theories:-

    1. Would this cause the MSP to lock up?

    2. This could be true, but why does it only happened when the PC goes into Sleep? The MSP target board has it's own power - I have a jumper to connect USB power to the board, and this is not fitted. I will shorting the jumper to see what happens.

    3. I unfortunately have not as I do not have a scope with me

    4. we experience the same error on a PC running Linux

  • Thanks JD

    I read through the threads, but I am not sure this is the same issue. It seems like the USB module is Stalling, but there is no mention of the micro stalling.

    No harm in asking though.

  • Hi Warren, 

    Have the issue been solved?

    regards

    KC

  • Hi KC

    The issue has not been resolved yet. The root cause is definitely from the PC. When I disconnect the port in the Comms App (Docklight) that I am using, it does not occur. 

    Your assistance would be appreciated.

    Warren

  • Hey Warren,

    Thanks for the update.  This is similar to my initial suspicion that somehow the computer or driver doesn't recognize the device after the computer goes to sleep.  I also assume it's fully on the computer side and that the MSP430 is still running, not actually stuck.  But the computer sends no USB signals to wake it.  

    I feel like the only way to truely confirm this is with a USB sniffer of some sort.  I know there are software programs that can monitor the PC communication busses and keep logs.  Do you have access to something like this?  

    Assuming this is the case, I'm not sure what the fix would be.  Seems like it would be a USB driver update of some kind.  

    Thanks

    JD

      

**Attention** This is a public forum