KL17 - VLLS1 pin wake-up (LLWU)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KL17 - VLLS1 pin wake-up (LLWU)

1,532 Views
AndreVB
Contributor III

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.

 

 

 

Labels (2)
Tags (3)
0 Kudos
Reply
5 Replies

1,456 Views
AndreVB
Contributor III

Hello Pablo

I went through the document but I coundn´t find any anything related to solve my problem. 

I found a post (https://community.nxp.com/t5/Kinetis-Microcontrollers/VLPS-mode-started-from-debugger-draws-2mAs-Eve.... It looks similar to my problem but it happes in VLPS.

The code (above) I am using was based on KL02´s SDK example. 

Any clue on what´s going on?

Thank you,

Andre

0 Kudos
Reply

1,441 Views
PabloAvalos
NXP TechSupport
NXP TechSupport

Hi @AndreVB 

 

Thank you so much for letting me know.

 

Hoping you are well, let me check that issue, because if you are correctly in a low power mode, you do not have to see higher currents. Only may I ask you a question? Why did you tell me at the beginning you were using KL17 and the current SDK you are using now is KL02 ? I'm confused in this part.

 

I will stay tuned to your response, so please let me know if you have more questions.

 

Best Regards.
Pablo Avalos.

0 Kudos
Reply

1,436 Views
AndreVB
Contributor III

Hi Pablo,

Typo error I mean KL17 SDK. Sorry about that.

By the way, I kind of found the issue. The LLWU wakeup pin flag is not being cleared. because the LLWU_HANDLER(void) is not being called after VLLS1 exit.

If I add LLWU_ClearExternalWakeupPinFlag(LLWU, 14); in the main() it works. The Idd goes to the expected levels. Any reason why the that IRQ handler is not being called?

Thank you

Andre

0 Kudos
Reply

1,411 Views
PabloAvalos
NXP TechSupport
NXP TechSupport

Hi @AndreVB 

 

Thank you so much for your reply and the info provided.

 

If IRQ Handler is not being called, it could be for two reasons, the IRQ is not being configured correctly (please check that you are calling EnableIRQ() function with parameter LLWU_IRQn), or the other reason can be that interrupt flag is not being cleared correctly since you start running, please check those.

 

If you have more questions, please let me know.

 

Best Regards.
Pablo Avalos.

0 Kudos
Reply

1,494 Views
PabloAvalos
NXP TechSupport
NXP TechSupport

Hi @AndreVB 

 

I would like to apologize for the delay. I got sick suddenly and couldn't write a response to you.

 

Hoping you find well, I would like to share with you an application note that might be helpful to clarify your concern about VLLS0, 1 and 2: https://www.nxp.com/docs/en/application-note/AN4470.pdf. The AN contains important information about VLLS and some charts with valued info.

 

Hoping this AN can be helpful, please let me know if you have some other concerns.

 

Sincerely

Pablo Avalos.