Hello Rocco,
I made a quick review on your files and could notice that you are masking the LLWU interrupt, but if you check KL25's reference manual, in section 15.1.2.1 LLS mode, there is a note that specifies about LLWU interrupt must not be masked by the interrupt controller to avoid a scenario where the system does not fully exit stop mode on an LLS recovery, so i think that is your problem.
In addition, i am also attaching a basic project where RTC, GPIO and Power Mode are included, in this case, i can wake up from LLS either using external pin (PTD6) and/or RTC Alarm interrupt, i hope this can help you as guidance.
I tested this project and it works well to demostrate that RTC can wake MCU from LLS mode (please notice that i am not using an external 32.768kHz RTC clock and accuracy is not achieved in this simple project, but it serves as guidance to understand the process to wake-up by using external and internal modules).
For more information about RTC clocking in FRDM-KL25Z i can suggest to watch this post: RTC in KL devices - should it be possible to use OSC32KCLK?
If you have another question please let me know it!
Best Regards,
Isaac
----------------------------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
----------------------------------------------------------------------------------------------------------------------------------------