Hi,
I'm working on a LPCXpresso55S36 evaluation board, and I'm trying to read the PMC->RESETCAUSE register to get the last chip reset reason, however it's value is always zero. I started from the demo project "power_mode_switch_lpc" in SDK 10.2.2 and I've tried to add a simple printf as follow in main function:
PRINTF("Last Reset cause: %d\n",PMC->RESETCAUSE);
At power-on, I expected that last reset cause was POR, so the value should be "1", but the printed value was"0". After RTC wakeup the device from the "Deep power down mode", i expected that "DPD_EVENTS_ORDER" bits was set as "010b" (RTC) and the "DPDRESET_RTC" bit was set to "1", but also in this case the printed value was always "0".
Am i missing something? How could i get info about last reset cause?
Thanks
Enrico
已解决! 转到解答。
Hi,
Pls use the code like:
#include "fsl_power.h"
power_reset_cause_t p_reset_cause;
power_boot_mode_t p_boot_mode;
power_wakeup_pin_t p_wakeupio_cause;
POWER_GetWakeUpCause(&p_reset_cause, &p_boot_mode, &p_wakeupio_cause);
__asm("nop");
This function within the drivers provided checks the reset source using the AOREG1 register of the PMC.
reset_cause_reg = PMC->AOREG1;
Hope it can help you
BR
XiangJun Rong
Hi,
Pls use the code like:
#include "fsl_power.h"
power_reset_cause_t p_reset_cause;
power_boot_mode_t p_boot_mode;
power_wakeup_pin_t p_wakeupio_cause;
POWER_GetWakeUpCause(&p_reset_cause, &p_boot_mode, &p_wakeupio_cause);
__asm("nop");
This function within the drivers provided checks the reset source using the AOREG1 register of the PMC.
reset_cause_reg = PMC->AOREG1;
Hope it can help you
BR
XiangJun Rong