Hi,
We are trying to port our application which was running on MSP430 and CC2520 Radio with single MKW41Z512 SoC from NXP. I am using TPM0 timer clocked with MCGIRCLK at 4MHz fast IRC to wake up from VLPS (Very Low Power Stop) mode. I am also using TPM1 and TPM2 for some other purpose to come out of sleep mode. I am entering into VLPS mode directly from RUN mode (FEE) and exiting back to RUN mode with these timers. The SOC resets itself with Core Lockup bit set in RCM_SRS1 register. This issue is not happening when running the same with debugger (which I think doesn't stop the MCG clock to enable debugging). If the VLPS mode enter is removed then there is no reset.
I have used the driver example to enter to VLPS mode.
status_t SMC_SetPowerModeVlps(SMC_Type *base)
{
uint8_t reg;
/* configure VLPS mode */
reg = base->PMCTRL;
reg &= ~SMC_PMCTRL_STOPM_MASK;
reg |= (kSMC_StopVlps << SMC_PMCTRL_STOPM_SHIFT);
base->PMCTRL = reg;
/* Set the SLEEPDEEP bit to enable deep sleep mode */
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
/* read back to make sure the configuration valid before enter stop mode */
(void)base->PMCTRL;
__DSB();
__WFI();
__ISB();
/* check whether the power mode enter VLPS mode succeed */
if (base->PMCTRL & SMC_PMCTRL_STOPA_MASK)
{
return kStatus_SMC_StopAbort;
}
else
{
return kStatus_Success;
}
}
One another point to add up is that only once in 3 times this code returns kStatus_Success and most of the other times it returns kStatus_SMC_StopAbort, for which also I couldn't find a reason.
Any quick help or suggestion will be greatly appreciated as we need to solve this to take a decision on using this SoC as power consumption is very stringent requirement.
Hello Yuvaraj Nagendran,
The MCU can’t enter to VLPS while debugging is enabled and instead enters STOP mode. You can refer to chapter 9.6 Debug in Low Power Modes in the reference manual for more information on this.
Regarding, the core lockup. Can you give more details of when it occurs? Does it happen when entering or exiting VLPS?
Can you share what demo application are you using and what modifications were made? For example, the power mode switch demo can be used to enter VLPS and configure the wake up source with a button or the LPTMR.
Additionally, what wireless protocol stack will you be using? I ask this because most of the wireless examples can be configured to go to low power modes and it is all managed automatically by the low power library.
Regards,