I am working on a K60 custom board with MQX 4.2 and I am having issues putting the processor to STOP mode (LLS). It seems the WFI instruction has no effect. _lpm_set_operation_mode(LPM_OPERATION_MODE_STOP) is called from PEE at 96 Mhz. Clock config was done using Processor Expert, the custom board has a 8 MHZ resonator. Before WFI is executed, here are the registers:
SIM_SCGC4 = 0xF0100070 -> LLWU is set
LLWU_ME = 0x01 -> WUME0 is selected for wakeup source
MCG_C6 = 0x40 -> clock monitor disabled
MC_PMPROT = 0x2A -> LLS is allowed
MC_PMCTRL = 0x8B -> STOPM to Low-Leakage Stop (LLS), RUNM=00
SCB_SCR = 0x04 -> SLEEPDEEP bit is set
After WFI instruction:
LLWU_F3 = 0x00 - > Module 0 input was not a wakeup source
SMC_PMCTRL = 0x8B -> STOPA is set
I also tried the Lowpower mqx example without success.
Any help would be appreciated, Thank You.