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.

SYSBIOS 6.32 and use of a watchdog

Other Parts Discussed in Thread: MSP430F5438, SYSBIOS

Goodmorning,

I'm trying to use a watchdog with my MSP430f5438. But I have some problems with SYSBIOS and watchdog interaction: my application stop working if I disable "the watchdog disabling". Are there any resources o user manuals to give me an example of SYSBIOS/Watchdog use?

Thank you so much,

Seo80

P.S. here is my source code

void main(){
 
     /* use ROV->SysMin to view the characters in the circular buffer*/
    WDTCTL = WDTPW + WDTHOLD;
     
    System_printf("enter main()\n");
    Led_Init();
    Led1_On();
    Led2_Off();
 
 
    CLOCK_XT1_Init(MCLK+ACLK+SMCLK);
    CLOCK_FLL_Init(MCLK+SMCLK);
 
    Calendar_Init(defaultTime());
    RTC_startClock_();
 
    P11DIR = P11DIR | 0x02 | 0x04 |0x01 ;            //set P11.1 & P11.2 as output
    P11SEL = P11SEL | 0x02 | 0x04 |0x01 ;            //set P11.1 & P11.2 as MCLK/SMCLK/aclk function
 
    UART3_Init(ACLK, 9600);
    USB_write_string("Start!\n\r\0");
 
     WDTCTL = WDTPW + 0x0000;
    Delay(1500);
    value = 1;
    WDTCTL = WDTPW + WDTHOLD;
 
    USB_write_string("End!\n\r\0");

}

  • Luca,

    I don’t know of any examples of using the WDT in watchdog mode within a SYS/BIOS application.  I have seen usage of the WDT reprogrammed in interval timer mode, but not watchdog mode.

    If the app fails once you disable the disabling by SYS/BIOS… I suspect that the WDT is expiring before you get to main() and try to do it there.  If the app has a lot of initialized data, or added functions invoked before main(), then doing the disable in main() is too late.  You can verify this by setting a breakpoint just after reset, and one at the start of main(), and start running from the first breakpoint and see if it triggers again before the one in main().

    It sounds like you’ll need to let SYS/BIOS disable the WDT coming out of reset (which simply asserts WDTHOLD as you are), and then within main() re-enable the WDT to operate in watchdog mode, and then appropriately service it within your application...

    Scott