Hi everybody,
I have a problem with LPTMR and port Interrupts.
If an LPTMR is correctly working and enabling the interruptions of the ports and immediately after, the interruption occurs, the LPTMR stops working. On the contrary, if enabling the port interruptions, and I wait a second (real, no delay in code), the LPTMR continues working properly.
Why the LPTMR stops working when the interruption occurs inmediately after they have been enabled?
Note1: Impossible to solve with a delay on the code.
Note2: KW41Z and MCUXpresso.
Thanks in advance,
Alejandro Pérez
Thanks for your answer.
The whole project I can not share because of confidentiality issues, I'm sorry.
The question is: according to the MKW41Z/31Z/21Z Reference Manual, the LPTMR always operates even after a reset, but the function that I use (TMR_StartLowPowerTimer) says: "When the timer goes off, call the callback function in non-interrupt context" so there is a problem with the interrupts. How can I guarantee that the LPTMR calls the callback if an interruption is generated immediately after the enablement? Because the LPTMR works properly If the interrups occurs some secons after enabling...
Very strange!
Thanks!
Alejandro
Hi again Alice,
I think I have solved the problem. Everything had to do with "PWRLib_LLWU_DisableAllWakeupSources()" and their wrong use.
Thanks a million for your time.
Alejandro Pérez