I'm working on a project with the MKW41Z4 doing 802.15.4 communication, and trying to go to VLPS mode with wake up by LPTMR. I have a simple test program without the 802.15.4 that just does the VLPS and LPTMR, using the sequence:
SMC_PreEnterStopModes();
SMC_SetPowerModeVlps(SMC);
SMC_PostExitStopModes();
to enter sleep mode, and that works fine. However, when I put that in the real application (which was mostly written by someone else), I get a hard fault when it wakes. Are there any things I should be doing before entering VLPS othter than what is done by those three SMC functions?