What causes cpu to run slowly after wake up? Code puts cpu to STOP mode and wakeup is TMP isr. It works otherwise but the cpu is running slowly. When running code with out stop mode, isr takes 1us. With stop mode isr takes 12us.
frdm-kl25z board (KL25Z128VLK).
Solved! Go to Solution.
Hi tuomas aaltio,
What the KL25 code you are using? KSDK2.0-FRDM-KL25?
I didn't find the KSDK for KL25 using SMC_PostExitStopModes, so you can comment it, when the interrupt happens, the code will exit stop mode. if SMC_PostExitStopModes is used for the clock mode switch, fore example, PBE to PEE, because just as I have said, PEE enter STOP, wakeup will be PBE, clock switch to PEE need time. If you you don't want to do this clock switch, you can use other clock mode to enter STOP, then you don't need to do the clock mode switch after waking up.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi tuomas aaltio,
Please check this picture at first:
Take care, if you are using PEE mode, after exit the STOP, the clock mode is PBE, so your clock is changed, you need to change PBE to PEE again to keep the same clock frequency.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
now code execution speed is ok, but it takes surprisingly long time to start, 80us. That is the time between TMP module interrupt trigger (can be seen from pwm signal and cpu current consumption) to isr to run. Is wake-up from STOP mode really so slow?
Hi tuomas aaltio,
STOP to RUN wake up is normally 4us, but if you do the clock mode switch, then run the TPM again, the clock mode switch also need to cause time, but this time is not the wake up time.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
reason for slow start is routine
SMC_PostExitStopModes();
that takes 100us. Is there way avoid using it? something I could use instead.
Hi tuomas aaltio,
What the KL25 code you are using? KSDK2.0-FRDM-KL25?
I didn't find the KSDK for KL25 using SMC_PostExitStopModes, so you can comment it, when the interrupt happens, the code will exit stop mode. if SMC_PostExitStopModes is used for the clock mode switch, fore example, PBE to PEE, because just as I have said, PEE enter STOP, wakeup will be PBE, clock switch to PEE need time. If you you don't want to do this clock switch, you can use other clock mode to enter STOP, then you don't need to do the clock mode switch after waking up.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
SDK_2.1_FRDM-KL25Z
code to enten stop mode:
SMC_PreEnterStopModes();
SMC_SetPowerModeStop(SMC, kSMC_PartialStop);
SMC_PostExitStopModes();