When I attempt to initialize the PIT after waking from VLPS, the PIT does not behave how I would expect. From what I can tell, the PIT is taking 18,707 times longer to trigger an interrupt after waking from VLPS when compared to before doing any operation related to VLPS.
I hope the attached code explains what I am attempting to do well enough. I made a barebones program where I use the PIT to wait 1ms. Everything works before I enter VLPS but after I come out of VLPS it is taking 18.707s to do the same wait operation. If I do it with a 2ms baseline it will take 37.413s after VLPS and so on. If I keep the PIT constantly on it seems to interrupt in a consistent manner but if I try to fully init OR just restart the timer using PIT_StartTimer() after VLPS I get this really long wait.
I would really like to be able to turn off the PIT and only periodically use it otherwise I would just leave it on. I checked everything I could think of after doing the VLPS operation including verifying the power mode state (SMC_GetPowerModeState()), verifying the bus clock rate (CLOCK_GetBusClkFreq()), checking the priority of the PIT irq (NVIC_GetPriority()), calling all initialization functions again, and others but nothing I saw seemed out of place.
Any help would be greatly appreciated.
Device: MKL16Z128VFM4
Installed SDK: SDK_2.x_MKL16Z128xxx4 version 2.2.0 manifest version 3.0.0
IDE: MCUExpresso version 11.6.0