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.