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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,572 次查看
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.

标签 (1)
0 项奖励
回复
1 解答
1,517 次查看
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 项奖励
回复
4 回复数
1,545 次查看
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 项奖励
回复
1,542 次查看
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 项奖励
回复
1,518 次查看
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 项奖励
回复
1,549 次查看
MithileshKumar
Contributor II

Please can anybody help on this

0 项奖励
回复