Part Number: MSPM0L1306
Hello,
I have a customer trying to implement a wakeup from shutdown mode example using their own driver library implementation.
This is their power policy shutdown function:
/*!
* @brief Call this to configure the MCU into shutdown mode
* @param None
* @return None
*/
void SetPowerPolicyShutdown( void )
{
SYSCTL->SOCLOCK.PMODECFG = SYSCTL_PMODECFG_DSLEEP_SHUTDOWN;
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
}
This is the code that sets up the shutdown condition:
button.SetWake( IO_Definitions::BUTTON_WAKE_CONFIG );
DL_SYSCTL_setPowerPolicySHUTDOWN();
delayCycles(1000000);
//sleepMode.SetPowerPolicyShutdown( );
while ( 1 )
{
// waiting on the interrupt
__WFI();
}
So I have tried just copying in the driverlib implementation of the shutdown power policy. Both right now appear to just cause the MCU to sit in the WFI loop.
I have verified that my IO configurations for the wake pin PA18 match that of our shutdown example.
There are no other peripherals enabled on this device right now outside of systick. I did try to disable systick but this didn't impact anything either.
I have noticed that slightly different versions of the code would cause the MCU to actually go into a non-connectable state where I couldn't download code to the device and would only come out after reset. So this seems to mean that sometimes I can get to a shutdown state, but it's very inconsistent and I have never been able to wake up the device out of shutdown.
Any tips on what could be preventing the device from both waking up from shutdown and what could be preventing me from fully reaching shutdown?
Customer is using IAR compiler 9.40.
Munan