cpu running slowly after wake up from STOP mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

cpu running slowly after wake up from STOP mode

Jump to solution
1,442 Views
tuomasaaltio
Contributor II

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).

Labels (1)
0 Kudos
Reply
1 Solution
1,230 Views
kerryzhou
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
7 Replies
1,230 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi tuomas aaltio,

    Please check this picture at first:

pastedImage_1.png

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!
-----------------------------------------------------------------------------------------------------------------------

1,230 Views
tuomasaaltio
Contributor II

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?

0 Kudos
Reply
1,230 Views
kerryzhou
NXP TechSupport
NXP TechSupport

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.

pastedImage_1.png

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,230 Views
tuomasaaltio
Contributor II

reason for slow start is routine

SMC_PostExitStopModes();

that takes 100us. Is there way avoid using it? something I could use instead.

0 Kudos
Reply
1,231 Views
kerryzhou
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,230 Views
tuomasaaltio
Contributor II

SDK_2.1_FRDM-KL25Z

0 Kudos
Reply
1,230 Views
tuomasaaltio
Contributor II

code to enten stop mode:

 SMC_PreEnterStopModes();
 SMC_SetPowerModeStop(SMC, kSMC_PartialStop);
 SMC_PostExitStopModes();

0 Kudos
Reply