I was trying to change the power mode to VLPS to RUN. before going to deep sleep I am enabling the gpio pin interrupt and setting a flag. while wake up in the isr I am checking the flag and using the below function to change to RUN mode.
but this is not working. I am getting the interrupt but the code is not running.
My sleep sequence is given below
POWER_SYS_Init(&powerConfigsArr, POWER_MODES, &powerStaticCallbacksConfigsArr, 0);
Is it possible to change the state from VLPS to RUN without resetting the MCU?
Can anyone help me to share the example code to change the power mode from VLPS to RUN?
Thanks in advance.
Shinod A K
There is this power_mode_switch_s32k148 SDK example in the S32 Design Studio.
The MCU wakes up into either RUN mode or VLPR mode, depending on the system mode prior to VLPS.
Instead of this function POWER_SYS_SetMode(RUN, POWER_MANAGER_POLICY_AGREEMENT);
You can use POWER_SYS_GetCurrentMode() in the ISR to check the current mode.
The function reads the Power Mode Status register (SMC_PMSTAT).