when I chose lowpower mode 4, suppose the mcu should be in in VLLS0/1 mode. but it doesn't work.
codes:
bool_t PWRLib_MCU_Enter_VLLSx(uint8_t mode)
{
bool_t lowpower_skipped = FALSE;
#if cPWR_EnableDeepSleepMode_8 || cPWR_EnableDeepSleepMode_5
if ( 0 == setjmp(pwr_CPUContext))
#endif
{
#if cPWR_EnableDeepSleepMode_8 || cPWR_EnableDeepSleepMode_5
if(gpfPWR_VLLS_EnterCb != NULL)
{
gpfPWR_VLLS_EnterCb();
}
#endif
LLWU->F1 = LLWU->F1;
LLWU->F2 = LLWU->F2;
LLWU->FILT1 |= LLWU_FILT1_FILTF_MASK;
LLWU->FILT2 |= LLWU_FILT2_FILTF_MASK;
SCB->SCR &= (uint32_t)~(uint32_t)(SCB_SCR_SLEEPONEXIT_Msk);
/* Set the SLEEPDEEP bit to enable CORTEX M0 deep sleep mode */
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
SMC->PMCTRL = (uint8_t)((SMC->PMCTRL & (uint8_t)~(uint8_t)(SMC_PMCTRL_STOPM(0x03))) | (uint8_t)(SMC_PMCTRL_STOPM(0x04)));
SMC->STOPCTRL = (SMC_STOPCTRL_PSTOPO(0x00) | SMC_STOPCTRL_LLSM(mode));
#if (cPWR_RamRetentionInVLLS == 2)
SMC->STOPCTRL |= SMC_STOPCTRL_RAM2PO_MASK;
#endif
#if cPWR_POR_DisabledInVLLS0
if (mode == 0)
{
SMC->STOPCTRL |= SMC_STOPCTRL_PORPO_MASK;
}
#endif /* cPWR_POR_DisabledInVLLS0 */
(void)(SMC->PMCTRL == 0U); /* Dummy read of SMC_PMCTRL to ensure the register is written before enterring low power mode */
/* WFI instruction will start entry into deep sleep mode */
__asm("WFI");
lowpower_skipped = TRUE;
}
return lowpower_skipped;
}
the function always go to “ lowpower_skipped = TRUE;” and the current is still very high. Doesn't like VLLS0/1 mode due to datasheet. Please help