Other Parts Discussed in Thread: UNIFLASH
Here I noticed a non-intuitive behavior (I hope explained somewhere) about the return value of PRCMSysResetCauseGet() when debugging (i.e. when launch the firmware using XDS and with __SF_DEBUG__ defined).
On our boards I see the same bahavior even when burning an image with UniFlash with __SF_DEBUG__ NOT defined.
Example:
void ApplicationTask(void) { InitSimplelink(ROLE_STA); UART_PRINT("[SYS] Reset cause is "); _u32 resetCause = PRCMSysResetCauseGet(); _u32 wakeCause; switch (resetCause) { case PRCM_POWER_ON: UART_PRINT(0, "power on\r\n"); // do something break; case PRCM_LPDS_EXIT: case PRCM_CORE_RESET: case PRCM_MCU_RESET: case PRCM_WDT_RESET: case PRCM_SOC_RESET: case PRCM_HIB_EXIT: wakeCause = PRCMHibernateWakeupCauseGet(); UART_PRINT("Sysreset = %lu\tWakeup = %lu\r\n", resetCause, wakeCause); // do something else break; }
// .... }
The very first time I burn the image I get the value 0 for PRCMSysResetCauseGet() which is PRCM_POWER_ON. Then my firmware will put the MCU in hibernation state. No way to get another PRCM_POWER_ON even removing the batteries for minutes (shorting the VBAT to discharge any capacitor). It always returns PRCM_HIB_EXIT.
The only way I found to get another PRCM_POWER_ON is:
- connect the XDS to my board
- remove the batteries from my board
- reset the XDS (I'm using the launchpad, so I press the push-button close to USB connector)
- insert again the batteries: now it shows power on
What am I missing here?
SWRU465 at page 501 says:
unsigned long PRCMSysResetCauseGet(void)
Description: This function acquires the reason for an MCU reset. This is a sticky status.
Parameter: None
Return: Returns the MCU reset cause as one of the following:
• PRCM_POWER_ON: Power-on reset
• PRCM_LPDS_EXIT: Exiting from LPDS
• PRCM_CORE_RESET: Software reset (core only)
• PRCM_MCU_RESET: Software reset (core and associated peripherals)
• PRCM_WDT_RESET: Watchdog reset
• PRCM_SOC_RESET: Software SOC reset
• PRCM_HIB_EXIT: Exiting from hibernate
What does "this is a sticky status" mean?