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/MSP430FR2153: Problems with Wakeup from LPM4

Part Number: MSP430FR2153

Tool/software: Code Composer Studio

Hi,

I am struggling with LPM4 wakeup. There are two sources which will wakeup the processor: button press and UART data. Button press wakes up my MSP most times - but not always. And UART does never. I cannot the the reason why. Here are some code snippets (I am really sorry, but code highlighter seems not to work for me):

within main loop:

while(1)
    {
    	static uint16_t count = MAIN_SLEEP_TIMEOUT_MS;
        WAIT_MILLISECONDS(1);
        if(signal_anySignalsSet() == false)
        {
        	if(--count == 0)
        	{
        		count = MAIN_SLEEP_TIMEOUT_MS;
                bluetooth_sleepUART();
                __bis_SR_register(LPM4_bits | GIE);                     // Enter LPM4, interrupts enabled
                __no_operation();
        	}
        }
        if(semaphore_check(SEMAPHORE_UART_LINE) == true)
        {
        }
}

within UART interrupt:

if(rxByte == CR)
{
semaphore_send(SEMAPHORE_UART_LINE);
bic_SR_register_on_exit(LPM4_bits);
}

within button interrupts:

if(stor_ifg & BUTTON1_FALLING) // Button is pushed
{
// debounce
WAIT_MILLISECONDS(5);
if((P1IN & BUTTON1_FALLING) == 0) // has to stay 0
{
signal_send(SIGNAL_BUTTON_PRESSED);
DEBUG_PIN1_TGL();
//__bic_SR_register_on_exit(LPM4_bits);
__no_operation();
}
} // button falling

I am pressing the buttons 3 or more times and suddenly a press or release does not execute a wakeup!!!

  • Hi Matthias,

    When the device does not wakeup on the button press/release, do you need to power cycle the device?

    Have you checked if the erratas related to LPM4 are not encountered by your code?

    You can find the device errata at https://www.ti.com/lit/pdf/slaz723. The erratas that are relevant to LPM4 are PMM32, CS13 when the device transitions from active mode.  

    Srinivas

  • Dear Srinivas,

    I finally achieved to test out with frequency of 2 MHz. But I get the same error. And as the error can be observed running without debugger, I exclude the EEM bug.

    Just an idea: What happens, if an interrupt is nested? (I am not quite sure, if it is nested) If I call the "__bic_SR_register(LPM4_bits | GIE);" within the inner interrupt, does the return from the outer interrupt overwrite the SR from its stack? Would it be a good idea to signal to all interrupts to perform wakeup on exit? What will happen, if I call the __bic_SR twice?

    Another idea: what will happen, if interrupts are not nested, but another interrupt is pending when exiting an interrupt with __bic_SR...?

    Thank you for your support,

    Matthias

  • I tested to set a global marker whether to wakeup on RETI and it seems to work

**Attention** This is a public forum