CC3235SF: Reset cause is not cleared

Part Number: CC3235SF
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.

  • Hi,

    Just a quick comment.

    Your code is wrong. Macros PRCM_POWER_ON, PRCM_LPDS_EXIT are not bit masks but return values from PRCMSysResetCauseGet().

    Let say:

    #define PRCM_POWER_ON 0x00000000

    UART_PRINT("  PRCM_POWER_ON:   %s\n", (resetCause & 0x00000000) ? "SET" : "CLEAR"); --> this line will be always "CLEAR" regardless state of resetCause 

    you should to use:

    UART_PRINT("  PRCM_POWER_ON:   %s\n", (resetCause == 0x00000000) ? "SET" : "CLEAR");

    Jan

  • Hi,

    Like Jan said, those macros are return values. Please see prcm.h in SDK-DIR/source/ti/devices/cc32xx/driverlib, especially this section:

    //*****************************************************************************
    // Values that will be returned from PRCMSysResetCauseGet().
    //*****************************************************************************
    #define PRCM_POWER_ON             0x00000000
    #define PRCM_LPDS_EXIT            0x00000001
    #define PRCM_CORE_RESET           0x00000003
    #define PRCM_MCU_RESET            0x00000004
    #define PRCM_WDT_RESET            0x00000005
    #define PRCM_SOC_RESET            0x00000006
    #define PRCM_HIB_EXIT             0x00000007
  • Hi Jan,
    I always get the resetCause reason as:
    Reset Cause Register: 0x00000007 which is PRCM_HIB_EXIT. Even the MCU has undergone a watchdog reset.

  • UART_PRINT("\n\n=== BOOT DEBUG INFO ===\n");
    UART_PRINT("Reset Cause Register: 0x%08X\n", resetCause);
    UART_PRINT("\nIndividual 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 the controller get reset by watcdog reset, I get;

    === BOOT DEBUG INFO ===

    Reset Cause Register: 0x00000007

    Individual Flags:

    PRCM_POWER_ON: CLEAR

    PRCM_LPDS_EXIT: CLEAR

    PRCM_HIB_EXIT: SET

    PRCM_WDT_RESET: CLEAR

    PRCM_MCU_RESET: CLEAR

    PRCM_SOC_RESET: CLEAR

  • Hi,

    I haven't never seen such issue. Are you sure that device is restarted by WDT? What status do you see when you trigger reset by the reset pin? Can you test at CC3235 LaunchPad?

    Jan

  • Hi Jan,

    I'm intentionally performing the Watchdog reset by not refreshing the watchdog. At that time also I'm getting PRCM_HIB_EXIT only.

    void initWatchdog(void)
    {
    Watchdog_Params params;

    Watchdog_init();
    Watchdog_Params_init(&params);
    params.resetMode = Watchdog_RESET_ON;
    params.debugStallMode = Watchdog_DEBUG_STALL_ON;

    watchDogHandle = Watchdog_open(Board_WATCHDOG_0, &params);

    if (watchDogHandle == NULL) {
    while (1); // Error
    }

    reload = Watchdog_convertMsToTicks(watchDogHandle, 15000); // 10s timeout
    Watchdog_setReload(watchDogHandle, reload);
    }


    void* watchDogTask(void *args)
    {
    for(;;)
    {
    vTaskDelay(3000);
    if ((taskFlags & ALLTASKSETBIT) == ALLTASKSETBIT)
    {
    Watchdog_clear(watchDogHandle);
    Watchdog_setReload(watchDogHandle, reload);
    taskFlags = 0;
    }
    else
    {
    UART_PRINT("Watchdog not cleared! Flags: 0x%02X\n", taskFlags);
    }

    }
    return NULL;
    }

  • Hi,

    What you see when you try other reset sources?

    Jan

  • Hi,

    I'm performing power shut down by calling this function:

    void powershutdown (uint32_t shutdownTime)
    {
    (void)Power_registerNotify(&hibSignal, PowerCC32XX_ENTERING_SHUTDOWN,
                             &preHibConfig, (uintptr_t) NULL);
        (void)Power_shutdown(0, shutdownTime);
    }
    I'm getting the same reset cause reason:

    Reset Cause Register: 0x00000007

    Individual Flags:

    PRCM_POWER_ON: CLEAR

    PRCM_LPDS_EXIT: CLEAR

    PRCM_HIB_EXIT: SET

    PRCM_WDT_RESET: CLEAR

    PRCM_MCU_RESET: CLEAR

    PRCM_SOC_RESET: CLEAR

  • Hi,

    I think this is expected, because for full SoC reset is used hibernation API. Try reset by pin of power cycle.

    You can check implementation of Power_shutdown() inside \source\ti\drivers\power\PowerCC32XX.c.

    Jan

  • Hi Jan,
    I tried this Power_shutdown() shutdow,
    void powershutdown (uint32_t shutdownTime)
    {
        (void)Power_shutdown(0, shutdownTime);
    }
    for this also I'm getting the same reset Cause reason:

    Reset Cause Register: 0x00000007

    Individual Flags:

    PRCM_POWER_ON: CLEAR

    PRCM_LPDS_EXIT: CLEAR

    PRCM_HIB_EXIT: SET

    PRCM_WDT_RESET: CLEAR

    PRCM_MCU_RESET: CLEAR

    PRCM_SOC_RESET: CLEAR

    And the another point is, I have checked the 
    uint32_t wakeCause = PRCMHibernateWakeupCauseGet();
    while checking the HIbernateWakeup casue reason,
    I get PRCM_HIB_WAKEUP_CAUSE_GPIO (0x00000004) when the MCU has undergone a power cycle reset and PRCM_HIB_WAKEUP_CAUSE_SLOW_CLOCK (0x00000002) when the MCU Has undergone a watchdog reset.

     

  • Hi,

    As I said if you are using Power_shutdown() return code 0x7 from PRCMSysResetCauseGet() is expected. This is normal. What do you see when you try other reset sources like POR or reset pin (nRESET)?

    Jan

  • Hi,
    I tried the same power_shutdown with the CC3235 LaunchPad and checked the PRCMSysResetCauseGet().
    I got the resetCause reason PRCM_WDT_RESET when the MCU has undergone the Watchdog and PRCM_POWER_ON when the MCU has undergone the power shut down reset.

  • Hi,

    That means same code at CC3235 LaunchPad works without any issue? Right? It is correct to say that we narrowed down issue to your hardware?

    Jan

  • Hi,
    I always get reset cause reason Hibernate exit (PRCM_HIB_EXIT) if I flash the code using uniflash in my hardware and CC3235sf Launchpad for watchdog reset and power cycle reset. I get the resetCause reason PRCM_WDT_RESET when the MCU has undergone the Watchdog and PRCM_POWER_ON when the MCU has undergone the power shut down reset when I perform debug using CCS. I'm using the XDS110 DEBUG PROBE.

  • Hi,

    I am having trouble understanding what you are saying. 

    You're saying that when you flash code to conduct watchdog and power cycle reset functionality, your reset reason is hibernation exit? You also get a reset reason of watchdog timer reset during debug mode?

  • Hi Jan,

    What configuration do I need to change to get the exact reset cause? For example, if the MCU has undergone a watchdog reset, I need to identify it as a watchdog reset, and similarly for a power cycle reset.

  • Hi,

    I never seen such issue as yours. I am not sure what is going on at your case. Unfortunately I am not able test this at my end. Please wait for answer from TI.

    Jan

  • Hi KS,

    Can you send me a dumb-down version of your project so that I can see if I can reproduce your issue on my end, or at least whatever code you are currently running to trigger non-shutdown events that supposedly result in an incorrect reset cause?

  • Hi,

    I'm using simplelink SDK 6.10 version, and CCS version 12.0.0 in CC3235SF. I'm using FreeRTOS in my project. I have configured watchdog to check whether all the task are reporting, if any errors occurs the watchdog will reset the MCU. I keep on storing my data in network processor file system(NVS), if the watchdog reset happens I'll read the data from file system continuing the procedure from the left over state. To identify the reset reason I'm using the function PRCMSysResetCauseGet() after the main. But, the function returns the reset reason as PRCM_HIB_EXIT even the reset happens because of watchdog. I'm sure that the reset happens because of watchdog because I'm intentionally performing that.
    I want to know the configuration that I need to perform to get the proper reset cause reason.

  • Hi,

    Hold on. This is not related to your case. How often do you save values into NWP filesystem (sFlash). If you do this often, this is very bad idea because you will soon damage SPI flash (it have guaranteed 100k write cycles / sector only).

    Jan

  • Ok, I won't do the filesystem stuff but will replicate the rest of your experiment and let you know what I see.

  • Hi KS.

    Can you run the watchdog driver example in the SDK? I couldn't use your code because it gave me a bunch of just normal compilation errors so I ran the watchdog example and used your resetCause printout logic. In my experiment using the example, I reset my board once and then triggered the watchdog reset afterwards and below is my terminal output.

    I hope this helps.