Hello my friends!
I have an application using the KL17 (coded with MCUXpresso) in which I excute a piece of code and put the part in VLPS for 1s. This is my ON Mode.
By pressing two buttons when wake up from VLPS, my device enters in VLLS3. Consumption is 2uA. I have a RTC also working. I use LLWU pin to wake up from VLLS3. This is my OFF Mode. Everthing is perfect so far.
However, I tried VLLS1. Parts enters in VLLS1, consumption is 1.6uA. The part exits VLLS1 but now I have an extra constant 2mA current. The application apparently enters in VLPS (I know that because it puts the LCD in power down after a few seconds idle). Well, at least the LPMTR is doing its job. But maybe the part no longer enters in VLPS anymore?
If I put the part in VLLS1 again consumption goes to 1.6uA. But it wakes up again with the extra ~2mA.
Main() related code
/* Power related. */
SMC_SetPowerModeProtection(SMC, kSMC_AllowPowerModeAll);
if (kRCM_SourceWakeup & RCM_GetPreviousResetSources(RCM)) /* Wakeup from VLLS. */
{
PMC_ClearPeriphIOIsolationFlag(PMC);
}
BOARD_InitBootPins();
BOARD_BootClockRUN();
To enter VLLS1
{
LLWU_SetExternalWakeupPinMode(LLWU, 14, kLLWU_ExternalPinFallingEdge);
EnableIRQ(LLWU_IRQn); /* pin is configured on Pins Tool */
smc_power_mode_vlls_config_t vlls_config;
vlls_config.subMode = kSMC_StopSub1;
SMC_PreEnterStopModes();
SMC_SetPowerModeVlls(SMC, &vlls_config);
SMC_PostExitStopModes();
}
LLWU Handler
void LLWU_HANDLER(void)
{
LLWU_ClearExternalWakeupPinFlag(LLWU, 14);
}
In summary, everething works fine if I replace vlls_config.subMode = kSMC_StopSub1 by vlls_config.subMode = kSMC_StopSub3
Any clue of what can be happening? By the way, the issue happens in VLLS0, 1, and 2. To build the code, I use examples from the KL25 SDK. I do appreciate any help.
Thank you, Andre VB.