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.

RTOS/MSP432P401R: Wakeup from GPIO is not working

Part Number: MSP432P401R

Tool/software: TI-RTOS

Hello,

I want to shutdown the controller in the lowest power state (LPM4.5). Therefore I'm using the function:

Power_shutdown(PowerMSP432_SHUTDOWN_1, 0);

This function seems to work. But i can't wake up the controller with a GPIO interrupt. I have configured four buttons as interrupt inputs:

GPIO_PinConfig gpioPinConfigs[] = {
    /* Input pins */
    /*
     * NOTE: Specifying FALLING edge triggering for these buttons to ensure the
     * interrupts are signaled immediately.  See the description of the
     * PowerMSP432 driver's automatic pin parking feature for this rationale.
     */

    /* Buttons */
    GPIOMSP432_P4_0 | GPIO_CFG_IN_PU   | GPIO_CFG_IN_INT_FALLING,
    GPIOMSP432_P4_2 | GPIO_CFG_IN_PU   | GPIO_CFG_IN_INT_FALLING,
    GPIOMSP432_P4_1 | GPIO_CFG_IN_PU   | GPIO_CFG_IN_INT_FALLING,
    GPIOMSP432_P4_5 | GPIO_CFG_IN_PU   | GPIO_CFG_IN_INT_FALLING,
}

    GPIO_setCallback(BUTTON_1, buttonCallback);
    GPIO_setCallback(BUTTON_2, buttonCallback);
    GPIO_setCallback(BUTTON_3, buttonCallback);
    GPIO_setCallback(BUTTON_4, buttonCallback);

    GPIO_enableInt(BUTTON_1);
    GPIO_enableInt(BUTTON_2);
    GPIO_enableInt(BUTTON_3);
    GPIO_enableInt(BUTTON_4);

I'm also using the CC1310 controller. There the shutdown and wakeup is working with the following code:

PINCC26XX_setWakeup(SPI_CSN_WakeUpTable);

/* Wake-up  pin table */
PIN_Config SPI_CSN_WakeUpTable[] =
{
    CC1310_LAUNCHXL_SPI0_CSN | PIN_INPUT_EN | PIN_PULLUP | PINCC26XX_WAKEUP_NEGEDGE,
    PIN_TERMINATE                                 /* Terminate list */
};

Is there something similar for the MSP432 available?

Thank you for your help & efforts

Kevin

  • Kevin,

    We may have to investigate this a little bit on our end and get back to you on this. One quick question here, do you have this function defined in your application?

        /* Register for entering shutdown notifications */
        Power_registerNotify(&notifyObj, PowerMSP432_ENTERING_SHUTDOWN, (Power_NotifyFxn) notifyFxn, 0);

    One other thing that you could also try is to see if your board can wake-up from LPM4.5 through the buttons using a low-level code example to eliminate any hardware.

    Navigate to the SimpleLink SDK folder <SimpleLinkFolder>\examples\nortos\MSP_EXP432P401R\registerLevel\msp432p401x_pcm_11


    And there is the msp432p401x_pcm_11.c example that enters LPM4.5 with a wake-up from GPIO pin.

    William

  • Hello William,

    thank you for your answer.
    I have already registered and defined that function in my application.
    Furthermore I have tried to clear the interrupt flags before shutting down the uC and have checked the registers directly before shutdown(interrupt flags cleared and enabled).

    The example pcm_lpm35_rtc_wakeup.c is not working. When the minute has passed the isr RTC_C_IRQHandler is called. Instead of a reset the controller continues after the PCM_shutdownDevice(PCM_LPM35_VCORE0); function, leaves the main and therefore crashes.

    Thanks for the advice to look at the msp432p401x_pcm_11.c example. I just have tested the example and it works fine.

    Kevin

  • Kevin,

    I found the following example code for TI-RTOS LPM4.5 (power shutdown).  Note, this example is not intended to wakeup from GPIO so it must be modified some to work that way.

    http://dev.ti.com/tirex/#/?link=Software%2FSimpleLink%20MSP432%20SDK%2FExamples%2FDevelopment%20Tools%2FMSP-EXP432P401R%20-%20Rev%202.x%20(Red)%2FTI%20Drivers%2Fpowershutdown%2FTI-RTOS%2FCCS%20Compiler%2Fpowershutdown

    The modifications that I have found to work are the following:

    1. Change the GPIO_wwrite() function to a GPIO_toggle() function so that you can see this working. (Can't use debugger in LPM4.5)
    2. Change the notify function so that P1.1 is not set to outputPin.  (I used (PIN_ALL16 &(~GPIO_PIN1)) as the 2nd parameter for lines 94 & 100 which are the PORT_PA lines.
    3. Include this register level command in your main_tirtos.c file right before Board_initGeneral().   PCM->CTL1 = PCM_CTL1_KEY_VAL;

    This is working for me so that the LED will toggle each time I press S1; please let me know if it works for you also.

    EDIT:

    Just for future users' reference:

    NOTE: I went back and looked at this again today, and realized I missed a step to explain this properly.  You should also add these header files to maintirtos.c

    
    

    /* Driverlib Header files */

    #include <ti/devices/msp432p4xx/driverlib/driverlib.h>

  • Hello John,

    Thank you very much for your help!

    It's working now in my project! The register level command PCM->CTL1 = PCM_CTL1_KEY_VAL before the Board_initGeneral() was the solution.

    I have tried this register command before, but I added this command after the Board_initGeneral(). This worked unfortunately only for one shutdown and wakeup.

    Thanks for the very fast support & kind regards

    Kevin

**Attention** This is a public forum