AnsweredAssumed Answered

MKL17Z256VFM4 not entering LLS

Question asked by laurent henault on Mar 17, 2017
Latest reply on Mar 20, 2017 by laurent henault

Hello,

 

Like the tittle says, I'm using MKL17Z256VFM4 and want to make it enter LLS mode. I want the MCU to wake up from LLS mode through the LPTMR. Also, I am using SDK 1.3.0 if that changes anything.

 

Here is what I have so far.

 

Using Init_SMC in processor expert, I enable Low-leakage stop mode. Processor expert looks like this. 

 

SMC seems to be initialized correctly, since I am reading this from the SMC registers.

 

I've also enabled the LPTMR and tested the interrupts coming from NVIC and it seems to be working fine. Since NVIC is disabled in LLS , I added the LLWU component with processor expert to enable LPTMR0 and link an ISR to LLWU. This means I should wake up from the LSS through an LLWU triggered by the LPTMR0. Here's what the initialization looks like.

 

The LLWU_ME register reads 0x1, which means module 0, corresponding to LPTMR0, is enabled. So the LLWU should be set properly. 

 

I created a file named LLWU.c to go along the generated LLWU.h and created a function in there called LLWU_IRQHandler that basically does nothing for now but that will eventually be used when waking up from LLS.

 

Now comes the problem, at some point in the code, I want to jump into LLS. To do so, I write 0x3 to SMC_PMCTRL. 

 

The register is indeed changed correctly but the SMC_PMSTAT register never changes. The debug also keeps going through the code normally which is not supposed to happen if the MCU actually made the switch to LLS.

 

Anybody has an idea of what I might have bypassed that keeps the MCU from switching modes correctly?

 

Thanks!

Outcomes