K22F LLS Mode

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

K22F LLS Mode

Jump to solution
921 Views
whata
Contributor III

Hi, I'm using a MK22FN512 in a FreeRTOS (Tickless mode) envinronment, where device spends most of it's time in LLS mode (kSMC_StopSub3) briefly waking up either on timer (LPTMR) or some LLWU source. Up until recently everything worked as expected where the whole board consumed around 15uA in idle (which is an ok number) but after adding a small piece of code which does not affect pin configurations nor does it modify the type sleep mode the power consumption suddenly jumped  to 150uA. Debugger was detached in both measurements. Similar measurements were obtained on other boards as well.

Since no pin modifications were done i newly added piece of code I've removed added code and saw the expected drop to normal levels, then I moved code back in, but relocated two stucts related to the new code into lower sram and the saw the current level dropped to 15uA (at least for some time).

Testing so far without moving structs to lower sram reveals the following:

1. I've verifed SMC_SetPowerModeLls(SMC, &lls_config) returns kStatus_Success upon exit every time.

2. If task with "added code" finishes execution and goes on to pend on a queue for next event -> current consumption is high (150uA) But if during this sleep phase another task wakes up, finishes it's work and goes on to pend on it's queue, power consumption during sleep returns to normal (15uA).

3. Upon LLS entry it seems that current drops initially to 15uA only to jump to 150uA a bit later.

I'm a bit confused on how to go about debugging this, since there is no way that I know of to debug while in LLS, unless i swap out LLS entry with SMC_SetPowerModeWait(SMC) but then I'm not quite sure what to look for.

P.S Prior to every sleep entry sleep handler executes a function which reconfigures certain pins (uart rx, swd etc..) to inputs with pull-ups enable to reduce power consumption, upon exit they are reconfigured back. Both functions are automatically generated based on Config Tools Pin settings.

Labels (1)
Tags (3)
0 Kudos
Reply
1 Solution
808 Views
whata
Contributor III

Always check if your structs are properly intialized!

The issue was caused by incomplete intialization of Bandgap buffer.  Only .enable flag was being set, while .enableInLowPowerMode flag was ingnored. After properly initializing the latter one the problem is now gone.

View solution in original post

0 Kudos
Reply
1 Reply
809 Views
whata
Contributor III

Always check if your structs are properly intialized!

The issue was caused by incomplete intialization of Bandgap buffer.  Only .enable flag was being set, while .enableInLowPowerMode flag was ingnored. After properly initializing the latter one the problem is now gone.

0 Kudos
Reply