The code get reset after __WFI() when enterning deep sleep mode

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

The code get reset after __WFI() when enterning deep sleep mode

Jump to solution
992 Views
MithileshKumar
Contributor II

Hi 

I am try to put my system in low power mode. I am able to switch the other power states but when I try to switch to SystemIdle state, which tries to put system in deep sleep mode, my code get reset while executing __WFI().

Can someone please suggest the probable cause and solution to it.

I have taken sdk code and integrated in my project running on IAR integrated Eclipse workbench.

Labels (1)
0 Kudos
1 Solution
937 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Thank you for your additional information.

If the low power enable (WDZST) bit is set, the WDOG timer operation will be suspended in low power STOP or DOZE mode.
To disable wdog first unlock it.

DisableInterrupts; // disable global interrupt
WDOG_CNT = 0xD928C520; //unlock watchdog
WDOG_CS &= ~WDOG_CS_EN_MASK; //disable watchdog
EnableInterrupts; //enable global interrupt

If you have more questions do not hesitate to ask me.
Best regards,
Omar

View solution in original post

0 Kudos
4 Replies
965 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello
Hope you are well.
Please follow these steps, it is important to set DOZE mode:

Omar_Anguiano_0-1658446525837.png

Additionally, make sure that there is no pending interruption when entering in that power mode.

If you have more questions do not hesitate to ask me.
Best regards,
Omar

0 Kudos
962 Views
MithileshKumar
Contributor II

Thanks for the response..

We have gone through the application note as well as taken reference from SDK.

We are disabling the interrupts as well as disabling Systick so that it may not cause any issue.

On analysis we observed that while executuing __WFI(), it is not waiting for wakeup source to generate interrupt but watchdog is resetting the system.

We tried disabling the watching before calling __WFI(), but the watchdog is not getting disabled.

0 Kudos
938 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Thank you for your additional information.

If the low power enable (WDZST) bit is set, the WDOG timer operation will be suspended in low power STOP or DOZE mode.
To disable wdog first unlock it.

DisableInterrupts; // disable global interrupt
WDOG_CNT = 0xD928C520; //unlock watchdog
WDOG_CS &= ~WDOG_CS_EN_MASK; //disable watchdog
EnableInterrupts; //enable global interrupt

If you have more questions do not hesitate to ask me.
Best regards,
Omar

0 Kudos
969 Views
MithileshKumar
Contributor II

Please can anybody help on this

0 Kudos