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.

MSPM0G3519: What is wrong with my wakeup function? (MSPM0G3519)

Part Number: MSPM0G3519

Tool/software:

I have a button configured as GPIO input on PA28 and labeled as MCU_BTNn in syscfg.  This is an active low button that when I hold the button down for >3 secs, we call the below shutdown() function, which successfully shuts the application down but does not wake the application up when I press the button.  I have verified on my scope that the button is pulling the i/o down to logic 0 when the button is pushed.  Does anybody see any issues with my shutdown function that is not properly setting up the wakeup function for that pin?

void shutdown()
{
    // operating mode SHUTDOWN
    DL_GPIO_clearPins(GPIOC, DL_GPIO_PIN_5);  // LED BLUE GPIO
    DL_GPIO_clearPins(GPIOB, DL_GPIO_PIN_0);  // DEBUG LED
    // helpful info from my ti_msp_dl_config.h:
    /* Defines for USER_BTN: GPIOA.28 with pinCMx 3 on package pin 3 */
    // pins affected by this interrupt request:["USER_BTN"]
    // #define MCU_BTNn_INT_IRQN                                       (GPIOA_INT_IRQn)
    // #define MCU_BTNn_INT_IIDX                       (DL_INTERRUPT_GROUP1_IIDX_GPIOA)
    // #define MCU_BTNn_USER_BTN_IIDX                              (DL_GPIO_IIDX_DIO28)
    // #define MCU_BTNn_USER_BTN_PIN                                   (DL_GPIO_PIN_28)
    // #define MCU_BTNn_USER_BTN_IOMUX                                   (IOMUX_PINCM3)
    DL_GPIO_initDigitalInputFeatures(MCU_BTNn_USER_BTN_IOMUX, DL_GPIO_INVERSION_DISABLE,
        DL_GPIO_RESISTOR_NONE, DL_GPIO_HYSTERESIS_DISABLE, DL_GPIO_WAKEUP_ON_0);
    for (int i=0; i<100000; i++) { __asm("nop"); } // pause a moment

    DL_SYSCTL_setPowerPolicySHUTDOWN();
    while (1)
    {
        __WFI(); /* Enter selected power policy */
    }
}
  • I figured it out.  First I noticed I had not properly configured the iomux in syscfg for that pin.  This finally enabled the wakeup to work.  Then, I had to call DL_SYSCTL_releaseShutdownIO(); function before shutting down to prevent an immediate wakeup after shutting down.