Other Parts Discussed in Thread: UNIFLASH,
I put my MCU into a shutdown state, and after waking it up, I noticed that the reset cause is set to "watchdog."
In my code, I check for both reset causes — whether the MCU has undergone a power cycle reset or a watchdog reset.
However, I always see that the watchdog reset flag is set, even when the MCU has undergone a power cycle reset.
Here is my code;
void powershutdown (uint32_t shutdownTime)
{
(void)Power_registerNotify(&hibSignal, PowerCC32XX_ENTERING_SHUTDOWN,
&preHibConfig, (uintptr_t) NULL);
(void)Power_shutdown(0, shutdownTime);
}
in main, i have checked for reset cause,
int main(void)
{
uint32_t resetCause = MAP_PRCMSysResetCauseGet();
Board_init();
initWatchdog();
PWM_init();
SPI_init();
(void) InitTerm();
UART_PRINT("\n\n=== BOOT DEBUG INFO ===\n");
UART_PRINT("Reset Cause Register: 0x%08X\n", resetCause);
UART_PRINT("Individual Flags:\n");
UART_PRINT(" PRCM_POWER_ON: %s\n", (resetCause & PRCM_POWER_ON) ? "SET" : "CLEAR");
UART_PRINT(" PRCM_LPDS_EXIT: %s\n", (resetCause & PRCM_LPDS_EXIT) ? "SET" : "CLEAR");
UART_PRINT(" PRCM_HIB_EXIT: %s\n", (resetCause & PRCM_HIB_EXIT) ? "SET" : "CLEAR");
UART_PRINT(" PRCM_WDT_RESET: %s\n", (resetCause & PRCM_WDT_RESET) ? "SET" : "CLEAR");
UART_PRINT(" PRCM_MCU_RESET: %s\n", (resetCause & PRCM_MCU_RESET) ? "SET" : "CLEAR");
UART_PRINT(" PRCM_SOC_RESET: %s\n", (resetCause & PRCM_SOC_RESET) ? "SET" : "CLEAR");
if ((resetCause & PRCM_HIB_EXIT) || (resetCause & PRCM_MCU_RESET))
{
UART_PRINT("Not a watchdog reset \n");
}
else if(resetCause & PRCM_WDT_RESET)
{
UART_PRINT("watchdog reset \n");
}
else if(resetCause & PRCM_POWER_ON)
{
(void) Power_registerNotify(&hibSignal, PowerCC32XX_ENTERING_SHUTDOWN,
preHibConfig, (uintptr_t) NULL);
(void) Power_shutdown(0,MAX_INT);
}
while debugging i always get the same reset cause reason.
=== BOOT DEBUG INFO ===
Reset Cause Register: 0x00000007
Individual Flags:
PRCM_POWER_ON: CLEAR
PRCM_LPDS_EXIT: SET
PRCM_HIB_EXIT: SET
PRCM_WDT_RESET: SET
PRCM_MCU_RESET: SET
PRCM_SOC_RESET: SET
HIB Register 0: 0x20004000
is there any way to clear the reset status. If I do powershut down also, I'm getting the above mentioned reset cause only.
