This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432P401R: Hard vs soft reset

Part Number: MSP432P401R


I am developing an application that should return to a known state if the processor gets locked up, so I am implementing the WDT.

Can someone explain the differences between the two resets?

The TRM states that for a hard reset, control is returned to user code, SRAM is maintained but the processor is *not* rebooted.

What does this imply? Does my user code start at some random point? Does it start at the init code and then call main? Are any initializations done?

Also the driverlib manual gets confused between WDT_A_clearTimer ( void ) and WDT_resetTimer().

  • Hard Reset is a class 2 reset while a soft reset is a class 3 reset.  The class 2 automatically initiates a class 3.  The main difference is the state of the processor and the peripherals.  In the case of class 2 the processor is reset and the peripherals are reset.  This is most obvious in looking at the peripheral registers and seeing the ‘reset’ values indicated in the TRM.  With the class 3 there is more subtlety with the state of the M4 (debug PPB space) and the peripherals are not reset.

    The key difference between class 0/1 and class 2/3 is the boot code and the associated boot-override mailbox.  With class 0/1 the boot code is executed, where class ‘1’ is a ‘controlled’ re-execution of the boot code.   In this sense, with a hard reset the 'device' is not rebooted.

    The user or application code will always start at the same point, the reset vector, but the path to get there is different depending upon the class of reset.  In the context of the SDK we have used the startup_msp432p401r.c file to define the reset vector from where we call the SystemInit(), defined in system_msp432p401r_ccs.c, and cinit.  

    The driverLib was intended to support future versions and that is why multiple names are supported.

    /* Defines for future devices that might have multiple instances */
    #define WDT_A_holdTimerMultipleTimer(a)  WDT_A_holdTimer()
    #define WDT_A_startTimerMultipleTimer(a) WDT_A_startTimer()
    #define WDT_A_resetTimerMultipleTimer(a) WDT_A_clearTimer()
    #define WDT_A_initWatchdogTimerMultipleTimer(a,b,c) WDT_A_initWatchdogTimer(b,c)
    #define WDT_A_initIntervalTimerMultipleTimer(a,b,c) WDT_A_initIntervalTimer(b,c)
    #define WDT_A_registerInterruptMultipleTimer(a,b) WDT_A_registerInterrupt(b)
    #define WDT_A_unregisterInterruptMultipleTimer(a) WDT_A_unregisterInterrupt()
    
    /* Backwards compatibility layer */
    #define WDT_A_hold WDT_A_holdTimerMultipleTimer
    #define WDT_A_start WDT_A_startTimerMultipleTimer
    #define WDT_A_resetTimer WDT_A_resetTimerMultipleTimer
    #define WDT_A_watchdogTimerInit WDT_A_initWatchdogTimerMultipleTimer
    #define WDT_A_intervalTimerInit WDT_A_initIntervalTimerMultipleTimer

     

    WDT_resetTimer() -> WDT_A_resetTimerMultipleTimer -> WDT_A_clearTimer().  I will ask that to be provided in a different format.


    Regards,

    Chris

**Attention** This is a public forum