Hi Shrejjhh,
Yes, if you want to do the flash program, you can change the power mode to RUN, then do the flash program, after that, you can go back the VLPR again.
Actually, just the power mode switch.
About the power mode switch, you can refer to our SDK code, power_mode_switch, you can find it in folder :
FRDM-KE15Z\boards\frdmke15z\demo_apps\power_mode_switch
SDK can be downloaded from this link:
Welcome | MCUXpresso SDK Builder
void APP_PowerModeSwitch(smc_power_state_t curPowerState, app_power_mode_t targetPowerMode)
{
switch (targetPowerMode)
{
case kAPP_PowerModeVlpr:
APP_SetClockVlpr();
SMC_SetPowerModeVlpr(SMC);
while (kSMC_PowerStateVlpr != SMC_GetPowerModeState(SMC))
{
}
break;
case kAPP_PowerModeRun:
/* Power mode change. */
SMC_SetPowerModeRun(SMC);
while (kSMC_PowerStateRun != SMC_GetPowerModeState(SMC))
{
}
/* If enter RUN from VLPR, change clock after the power mode change. */
if (kSMC_PowerStateVlpr == curPowerState)
{
APP_SetClockRunFromVlpr();
}
break;
case kAPP_PowerModeWait:
SMC_PreEnterWaitModes();
SMC_SetPowerModeWait(SMC);
SMC_PostExitWaitModes();
break;
case kAPP_PowerModeStop:
SMC_PreEnterStopModes();
SMC_SetPowerModeStop(SMC, kSMC_PartialStop); /* Normal STOP mode. */
SMC_PostExitStopModes();
break;
case kAPP_PowerModeVlpw:
SMC_PreEnterWaitModes();
SMC_SetPowerModeVlpw(SMC);
SMC_PostExitWaitModes();
break;
case kAPP_PowerModeVlps:
SMC_PreEnterStopModes();
SMC_SetPowerModeVlps(SMC);
SMC_PostExitStopModes();
break;
default:
PRINTF("Wrong value");
break;
}
}
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------