Hi, I used S32K116 ARM v2.2 tool.
I'm trying to apply Run Mode -> VLPS Mode
By 61mA -> 32mA - it means go to VLPR Mode. (I should be reduce Current to ~1mA)
But, I think that example code doesn't go deepsleep Mode.
mumumilmil_0-1747202148718.png
It seems to go VLPR Mode but, Not going to VLPS Mode(deepsleep)
void enable_low_power_modes(void)
{
SMC->PMPROT |= SMC_PMPROT_AVLP(1); /* Allow very low power run mode */
SMC->PMCTRL |= SMC_PMCTRL_RUNM(2);
}
void go_to_sleep(void)
{
unsigned long int regValue = ((*(unsigned long int *)0x4007E014u) & 0xFFu);
/* Very low power stop mode can be entered only from Run mode or Very low power run mode*/
if ((regValue != 1UL) && (regValue != 4UL)) {
return;
}
/* Set the SLEEPDEEP bit to enable deep sleep mode (STOP)*/
(*(unsigned long int *) 0xE000ED10u) |= (1 << 2);
/* Set power mode to specified STOP mode*/
/* SMC_HAL_SetStopModeControl(baseAddr, stopMode); */
SMC->PMCTRL |= SMC_PMCTRL_STOPM(2);
/* Wait For Interrupt */
#if defined (__GNUC__)
__asm volatile ("wfi");
#endif
}
And if VLPS mode needs to SIRC Clock, I should adjust VCCR? ( Now, Using RCCR for SYS, Core clock)
mumumilmil_1-1747202367059.png