lpc802 hang when watchdog reset trigger after enter power down mode.

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

lpc802 hang when watchdog reset trigger after enter power down mode.

2,735 Views
frank-lin-Sunon
Contributor III

Hi,

I'm adding a watchdog to an old program.

Attached are my watchdog program and delay program (sleep will enter power dwon mode).

When I use the following equation, the watchdog reset can be triggered normally and booted successfully.
WatchDog_Init();
Delay_Delay1ms(6000);

But when I use the following equation, the reboot procedure cannot be completed.
WatchDog_Init();
Delay_Sleep1ms(6000);

0 Kudos
Reply
4 Replies

2,721 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Do you say that the LPC802 hangs when it enters power-down mode even if the watchdog reset event happens?

Anyway, pls configure  to use the FRO as the main clock before you enter power-down mode.

xiangjun_rong_0-1731034580309.png

 

If you still have issue, pls post your project and describes your issue clearly so that we can duplicate your issue.

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply

2,686 Views
frank-lin-Sunon
Contributor III

I have simplified the program as shown in the attachment. MAINCLKSEL has been set at the beginning of the program (and will not be changed).

When booting, pwm will be output on gpio 9.

When I use Delay_Delay1ms(6000); in Source/source/Main.c; watchdog can operate normally and boot normally.

When I use Delay_Sleep1ms(6000) in Source/source/Main.c; the watchdog should be triggered, but it cannot boot normally (no PWM output).

0 Kudos
Reply

2,635 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Regarding your question, we have the power_mode_switch example in SDK, pls download SDK package from the link:

https://mcuxpresso.nxp.com/en

xiangjun_rong_0-1731930371217.png

For your issue, it appears that you use WKT to wake-up LPC802 from power-down mode, so pls check the WKT counter in debugger and check if the counter changes with time.

void Delay_Sleep1ms(int _1ms) {
#ifdef _DEBUG
Delay_Delay1ms(_1ms);
#else
LPC_WKT->CTRL &= ~(0x08 | 0x01);
LPC_WKT->CTRL |= (((uint32_t)(((uint32_t)(LOW_POWER_OSC)) << WKT_CLKSEL)) & 0x01);
LPC_WKT->COUNT = _1ms * 1000;

Delay_PowerDown(true);

WKT_INT = false;
#endif
}

It appears that you do not set SYSCON->SYSAHBCLKCTRL0|=1<<9;

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply

2,616 Views
frank-lin-Sunon
Contributor III

Hi @xiangjun_rong ,

Did you misunderstand my question?
My question is that in power down mode, watchdog reset cannot perform reset correctly.

"SYSCON->SYSAHBCLKCTRL0|=1<<9;" has been used in Delay_Init. I also confirmed that Delay_Sleep1ms can enter power down mode and exit at the time I specify.
Delay_Sleep1ms(6000); in the program is intended to test the watchdog reset under power down (watchdog reset is set to 2s).

0 Kudos
Reply