Hi Russell
In my experience VLLS0 can't wake from the LPTMR (it can wake from LLWU ports though).
- VLLS1, VLLS2 and VLLS3 can wake from LPTMR.
Therefore if you avoid VLLS0 you may be OK.
I have attached a binary file for the FRDM-K22F which demonstrates the operation:
1. Load the code with the usal drag-and-drop method on to the board when it appears as an external drive
2. When it runs the green LED flashes at 2.5Hz and every 5s the LPTMR interrupt will toggle the RED LED
By default the processor is sleeping in WAIT state when there are no interrupts
3. On its VCOM UART conection at 115k there is a menu - hit the enter key to see it:
Hello, world... FRDM-K22F [Software]
Static memory = 0x00000a7c
OS Heap use = 0x0219 from 0x6000
Initial stack margin 0x000193ec
WOKEN - restoring WAIT mode
Serial number: 00
Software version V1.4.012
Device identification: KINETIS
Main menu
===================
1 Configure LAN interface
2 Configure serial interface
3 Go to I/O menu
4 Go to administration menu
5 Go to overview/statistics menu
6 Go to USB menu
7 Go to I2C menu
8 Go to utFAT disk interface
9 FTP/TELNET commands
a CAN commands
help Display menu specific help
quit Leave command mode
4. Go to the Administrator menu by entering 4 and ENTER
Admin. menu
===================
up go to main menu
show_config Show configuration
save Save configuration to FLASH
reject Reset non-saved changes
restore Restore factory settings
show_time Display date/time
set_time Set time hh:mm:ss
set_date Set Date dd:mm:yyyy
show_alarm Display alarm d/t
set_alarm Set alarm (date)(+)[time]
del_alarm Delete alarm
show_lp Show low power mode and options
set_lp [option] Set low power mode
wdog Watchdog
boot Reset to boot loader
reset Reset device
last_rst Reset cause
help Display menu specific help
quit Leave command mode
5. List the low power modes available with "show_lp"
#show_lp
RUN = 0
WAIT = 1 [active]
STOP = 2
VLPR = 3
VLPW = 4
VLPS = 5
LLS2 = 6
LLS3 = 7
VLLS0 = 8
VLLS1 = 9
VLLS2 = 10
VLLS3 = 11
6. You can test the various low power modes with, for example
"set_lp 5"
In the modes that can wake by LPTMR interrupt the LPTMR will still toggle the red LED every 5s and the current consumption can be measured and compared
7. You can compare the 4 VLLS modes and you will see that "set_lp 9, 10 and 11" will reset each time the LPTMR fires (wake up form VLLSx modes is always via reset).
"set_lp 8" will show that the processor is set to the VLSS0 but the LPTMR no longer wakes.
However there is also a LLWU set on the input SW2 which can wake it at any time.
Hello, world... FRDM-K22F [Wakeup]
Static memory = 0x00000a7c
OS Heap use = 0x0219 from 0x6000
Initial stack margin 0x000193dc
WOKEN - restoring WAIT mode
Regards
Mark
[uTasker project developer for Kinetis and i.MX RT]