Deep Sleep and VLPS on MK64FN1M0VLL12

Showing results for 
Search instead for 
Did you mean: 

Deep Sleep and VLPS on MK64FN1M0VLL12

Contributor II

So I'm trying to put my microcontroller into deep sleep mode (stop) or the VLPS mode. In my code I'm calling a function that suppose to put the uC in sleep mode and then I would like to use a UART port as a wake up. From what I have read in STOP mode any interrupt should wake the microcontroller (without use of the LLWU). Here is a code that I'm using to put the system in sleep:

 NVIC_EnableIRQ(UART4_RX_TX_IRQn);  //enable UART4 interrupts
 /* Set the STOPM field to 0b010 for VLPS mode */
 //exit to run on interrupt
 /*wait for write to complete to SMC before stopping core */
 dummyread = SMC_PMCTRL;
 /* Now execute the stop instruction to go into VLPS */
/* Set the SLEEPDEEP bit to enable deep sleep mode - enter stop mode*/
 #ifdef CMSIS
 /* WFI instruction will start entry into STOP mode */

There are multiple issues that I observed with both STOP and VLPS modes:

   1. The current is regular RUN mode is around 40mA at 3V, which is what the datasheet specifies. After I execute the    sleep instruction it decreases to around 25 mA, which is way to big. According to datasheet it should be around    0.5mA.

   2. The system does not wake up, when I send any command through UART. It looks like it is not responding at all.

   3. The sleep function does not work in debug mode. It looks like the instructions are executed but it does not go    into any sleep modes. (I'm using Keil development studio).

Any help or suggestions is greatly appreciated.

3 Replies

Contributor II

Thanks guys, will try some of your suggestions and let you know if it works. Thanks again.

0 Kudos

NXP TechSupport
NXP TechSupport


NXP provides KSDK software for K64 product, which includes low power demo located at below default location:


The KSDK software could be build and downloaded from here.

And customer also could download bare-metal K64 example code from here, which also provides a low power demo.

Bare metal sample code for Kinetis K64 120 Mhz

The UART module could wake up the core from STOP and VLPS mode with interrupt enabled. Please check if the related UART module interrupt enabled or not.

Wish it helps.

Have a great day,
Ma Hui
Note: If this post answers your question, please click the Correct Answer button. Thank you!

Specialist V


This gives some expected figure and you can test on HW using the binaries at

Attached is the low power interface as used by the uTasker project which includes a complete (integrated) low power solution supporting all modes and automatic dynamic switching between whatever mode you want to use (eg. VLPS with almost unrestricted UART operation on all 6 UARTs) so that you don't need to actively command anything (it will simply sleep whenever there is nothing pending).
The solution has been proven during over two years of real product operation (also K64 based, but is compatible with all K, KL, etc. designs) with very low power requirements in a POS type environment requiring also immediate UART response (eg. bar code readers) and so is reliable and mature (not simply example code that needs further development and bug fixing to become useful).

All code is Keil compatible (as well as CW, KDS, IAR, Green Hills, etc.) and the complete framework contains a Keil project. Note however that not all low leakage modes can be fully tested with the debugger since the JTAG/SWD interface will also be deactivated.