AnsweredAssumed Answered

MKV31 & FreeRTOS - VLPS Mode

Question asked by kylewagner on Jan 24, 2020
Latest reply on Jan 30, 2020 by Alexis Andalon

Hi All,

 

I’m working with a Kinetis MKV31F512VLH12 and am trying to put it into VLPS low power mode. I’m using the MCUXpresso IDE and using the FreeRTOS OS. I’ve used the ConfigTools within Xpresso to do my pin configurations and generate most of my drivers.

 

I have a task running that blinks an LED, so I know if the processor is in run or stop mode.

 

My code that I’m using to put the processor into VLPS mode is below:

 

void Sleep(void)

{

  DisableGlobalIRQ();

  SMC_PreEnterStopModes();

  SMC_SetPowerModeVlps(SMC);

  SMC_PostExitStopModes();

  __asm volatile ("dsb");

  __asm volatile ("WFI");

}

 

I noticed that the datasheet says that “With debug enabled, transitions from Run directly to VLPS are not allowed and result in the system entering Stop mode instead.” As a result, I am programming a Release configuration, disconnecting the debugger, and then resetting the micro.

 

Upon reset, I observe the processor drawing about 40mA, which seems to be the HSrun mode current. I am able to see the current draw drop down to ~8mA, but then immediately jumps back up to ~40mA. The LED only stops blinking briefly during the period when the current drops to 8mA.

 

I’m assuming that the period of 8mA current draw is the processor entering VLPS, though that still seems like a lot of current for VLPS. I’m also thinking that something keeps waking the processor, but I can’t figure out what that might be. My “DisableGlobalIRQ” call is an attempt to disable all interrupts, but perhaps this isn’t doing what I think it is doing.

 

Any help is appreciated! Thanks!

Outcomes