The SDK 2.x doesn't exist on MK60FN1M0VMD15
do we have any example code how to get into VLPS mode?
OK, many thanks, so now I have code
SMC->PMPROT |= SMC_PMPROT_AVLP_MASK;
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
SMC->PMCTRL &= ~SMC_PMCTRL_STOPM_MASK;
SMC->PMCTRL |= SMC_PMCTRL_STOPM(0x2); // VLPS mode
dummyread = base->PMCTRL;
to go to sleep and looks like chip is entering VLPS mode and then wakes up on GPIO or LPTMR.
However, chip allways wake up via reset .... but I need to have it continue after WFI instruction. Do I miss something?
Please specify whether you have also GPIO interrupt and/or LPTMR operation in addition to this code and whether you have the watchdog enabled or disabled?
1. SMC->PMPROT is a 'write-once' register so if you are using general example code there is a risk that it has already been written to in some other initialisation and so it is not in the mode that you expect and/or won't operate correctly.
2. The 150MHz K60 needs also the LPWUI flag in SMC->PMCTRL to ensure wake-up from an interrupt (although it is not critical if you are entering VLPS directly from RUN)
3. If the watchdog hasn't been disabled and you don't have a service that is regularly exiting from VLPS to service the watchdog and return to VLPS automatically you will need to ensure that the STOPEN flag in the watchdog control register is disabled to stop the watchdog firing in VLPS, and causing a reset.
4. You should disable interrupts before calling the WFI command and only enable them again once it continues (to ensure no race states and orderly recovery)
5. If you have the clocks operating from the PLL you also need to re-configure and restart the PLL each time you return to RUN mode
uTasker - for immediate and complete Kinetis solutions
See the uTasker open source project links below. It supports almost all processors and boards (even older ones) and includes dynamic low power support.
To go to VLPS you just do:
and it will move to the mode as soon as all critical activity has stopped (eg. UART transmission that are still in progress that don't want to be frozen) and then recovers on any activity (and returns back to VLPS as soon as possible again).
See videos and links below for more information.
Low power and LLWU: http://www.utasker.com/kinetis/LLWU.html
Low power videos:
VLPS with continuous UART operation: https://community.nxp.com/message/421247#421247
For better, faster, cheaper product developments consider uTasker developer's version, professional Kinetis support, one-on-one training and complete fast-track project solutions to set you apart from the herd : http://www.utasker.com/support.html