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.

MSP430F2618: watchdog not resetting the MCU

Part Number: MSP430F2618

Hi,
Is there any edge case in which the watchdog can't restart the MCU if it gets stuck?
The reason I am asking is that we had our device locks up in some weird state, and the watchdog doesn't restart it.
When the device ends up in this state, if we pause it in Code Composer studio, it looks like the PC register is not changing its value and the line it gets stuck on seems to be inside watchdog_refresh() on 
WDTCTL = WDTPW + WDTNMI + WDTTMSEL + WDTCNTCL + WDTSSEL;

Sometimes it will get stuck in a couple of hours, sometimes in a couple of days, but it seems like it's happening faster when there are a lot of interrupts - like receiving data over UART. Can WDT reset the device if it's handling another interrupt? Is there something that we can do to avoid this situation?

/**
 * Initialize Watchdog
 */
inline void watchdog_init()
{
    // WDTPW - Enter password (without password device will reset)
    // WDTHOLD = 0 - Watchdog timer+ is not stopped
    // WDTNMIES = 0 - This bit selects the interrupt edge for the NMI interrupt when WDTNMI = 1
    // WDTNMI = 1 - NMI function
    // WDTTMSEL = 0 - Watchdog mode
    // WDTCNTCL = 1 - Watchdog timer+ counter clear.
    // WDTSSEL = 1 - ACLK set at 12kHz (from 4kHz to 22kHz - internal oscillator) see Clk_init()
    // WDTISx = 00 - Watchdog clock source /32768 ->  ~ 2.7s [1.5s - 8.2s]
    WDTCTL = WDTPW + WDTNMI + WDTTMSEL + WDTCNTCL + WDTSSEL;

    // NMI interrupt enable. This bit enables the NMI interrupt.
    IE1 |=  NMIIE;
    IE1 |=  WDTIE;
}

/**
 * Refreshes watchdog.
 */
inline void watchdog_refresh()
{
    WDTCTL = WDTPW + WDTNMI + WDTTMSEL + WDTCNTCL + WDTSSEL;
}

inline void watchdog_stop()
{
    WDTCTL = WDTPW + WDTHOLD;
}

void Clk_init()
{
    BCSCTL1 = CALBC1_1MHZ;
    BCSCTL1 |= DIVA_0;          // Divider for ACLK /1

    DCOCTL =  CALDCO_1MHZ;      // DCO = 1 MHz
    BCSCTL2 |= DIVS_1;          // SMCLK = DCO/2 -> 500 kHz

    // Low-frequency clock select and LFXT1 range select. These bits select between LFXT1 and VLO when XTS = 0,
    // and select the frequency range for LFXT1 when XTS = 1
    BCSCTL3 |= LFXT1S1;

    IFG1 = 0;
    /* Wait for the crystal to settle. */
    do
    {
        /* Clear the fault flag. */
        IFG1 &= ~OFIFG;
    }
    while (IFG1 & OFIFG);
}

**Attention** This is a public forum