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.

LAUNCHXL-F2800137: F2800137 WATCH DOG TIMER OVERFLOW MCU RESET

Part Number: LAUNCHXL-F2800137

Tool/software:

Hello TI Team,
                                         Currently i am working on watch dog timer. I pick the code from driver library example of F2800137. I am resetting the mcu after watchdog timer overflow. When i used the debug mode for execution of the code, at  watchdog timer overflow time-> debugging is paused. I think mcu should be reset. When i simply power on the launchpad with usb cable & not using the debug mode then mcu do not perform any task like toggle the pin. Is their any method to use the launch pad without debugging mode & mcu work normally only by supply the power to board.
Thanks with regards,
DEEPAK
  • Hi,

    at  watchdog timer overflow time-> debugging is paused. I think mcu should be reset.

    What do you mean by debugging is paused ? Did you pause it ?

    When i simply power on the launchpad with usb cable & not using the debug mode then mcu do not perform any task like toggle the pin

    Have you setup the boot modes properly for the device to go through reset cycle and boot to application ? Refer to bootrom chapter for more details

    Is their any method to use the launch pad without debugging mode & mcu work normally only by supply the power to board.

    With or without debugger Watchdog works like it should. Few considerations to keep in mind for debug mode watchdog behavior below : 

    Thanks

  • Prathan Bhatt said :- What do you mean by debugging is paused ? Did you pause it ?

    Deepak:- no i am not paused the processing. c28xx_CPU1 goes from running state to halted stage automatically when watch dog timer overflow to reset the mcu.

    //#############################################################################
    //
    // FILE:   empty_driverlib_main.c
    //
    //! \addtogroup driver_example_list
    //! <h1>Empty Project Example</h1> 
    //!
    //! This example is an empty project setup for Driverlib development.
    //!
    //
    //#############################################################################
    //
    //
    // $Copyright:
    // Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com/
    //
    // Redistribution and use in source and binary forms, with or without 
    // modification, are permitted provided that the following conditions 
    // are met:
    // 
    //   Redistributions of source code must retain the above copyright 
    //   notice, this list of conditions and the following disclaimer.
    // 
    //   Redistributions in binary form must reproduce the above copyright
    //   notice, this list of conditions and the following disclaimer in the 
    //   documentation and/or other materials provided with the   
    //   distribution.
    // 
    //   Neither the name of Texas Instruments Incorporated nor the names of
    //   its contributors may be used to endorse or promote products derived
    //   from this software without specific prior written permission.
    // 
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    // $
    //#############################################################################
    
    //
    // Included Files
    //
    #include "driverlib.h"
    #include "device.h"
    #include "board.h"
    #include "c2000ware_libraries.h"
    
    //
    // Globals
    //
    uint32_t wakeCount;
    uint32_t loopCount;
    
    //
    // Function Prototypes
    //
    __interrupt void wakeupISR(void);
    //
    // Main
    //
    void main(void)
    {
    
        //
        // Initialize device clock and peripherals
        //
        Device_init();
    
        //
        // Disable pin locks and enable internal pull-ups.
        //
        Device_initGPIO();
    
        //
        // Initialize PIE and clear PIE registers. Disables CPU interrupts.
        //
        Interrupt_initModule();
    
        //
        // Initialize the PIE vector table with pointers to the shell Interrupt
        // Service Routines (ISR).
        //
        Interrupt_initVectorTable();
    
        //
        // PinMux and Peripheral Initialization
        //
        Board_init();
    
        //
        // C2000Ware Library initialization
        //
        C2000Ware_libraries_init();
    
       //
        // Re-map watchdog wake interrupt signal to call the ISR function in this
        // example
        //
        //Interrupt_register(INT_WAKE, &wakeupISR);
    
        //
        // Clear the counters
        //
        wakeCount = 0;
        loopCount = 0;
    
        //
        // Set the watchdog to generate an interrupt signal or a reset signal
        //
        //SysCtl_setWatchdogMode(SYSCTL_WD_MODE_INTERRUPT);
         SysCtl_setWatchdogMode(SYSCTL_WD_MODE_RESET);
    
        //
        // Enable the watchdog wake interrupt signal
        //
        //Interrupt_enable(INT_WAKE);
        //
        // Enable Global Interrupt (INTM) and real time interrupt (DBGM)
        //
        EINT;
        ERTM;
    
        //
        // Reset the watchdog counter
        //
        SysCtl_serviceWatchdog();
    GPIO_writePin(myGPIO_OUT5, 1);
    
        //
        // Enable the watchdog
        //
        SysCtl_enableWatchdog();
    
        while(1)
        {
            loopCount++;
        if(loopCount>500)
          GPIO_writePin(myGPIO_OUT5, 0);  
        //GPIO_togglePin(myGPIO_OUT5);
        if(loopCount<1000)
        {
          DEVICE_DELAY_US(12000);
          SysCtl_serviceWatchdog();
        }
        else if(loopCount>=1000)
          DEVICE_DELAY_US(15000);    
            //
            // Uncomment SysCtl_serviceWatchdog to just loop here.
            // Comment SysCtl_serviceWatchdog to have watchdog timeout and trigger
            // an interrupt signal to execute the wakeupISR
            //
             //SysCtl_serviceWatchdog();        
        }
    }
    
    //
    // Wakeup ISR - The interrupt service routine called when the watchdog
    //              triggers the wake interrupt signal
    //
    /*
    __interrupt void
    wakeupISR(void)
    {
        wakeCount++;
    if(wakeCount>1000)
      SysCtl_setWatchdogMode(SYSCTL_WD_MODE_RESET);
        //
        // Acknowledge this interrupt located in group 1
        //
        Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
    }
    */
    //
    // End of File
    //
    

    Prathan Bhatt said:- Have you setup the boot modes properly for the device to go through reset cycle and boot to application ? Refer to bootrom chapter for more details?

    Deepak:- i am using the boot mode as flash..as i on the both jumper(GPIO24,GPIO32) of S3 switch on launchpad of F2800137.

    Thanks with regrds,

    DEEPAK

  • c28xx_CPU1 goes from running state to halted stage automatically when watch dog timer overflow to reset the mcu.

    Okay is it at the reset vector ?

    This looks like since your debugger is connected you would need to setup your emulation boot mode to flash.

    You can check this e2e post here : https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1416246/tms320f280049c-280049c/5439795?tisearch=e2e-sitesearch&keymatch=emulation%2520boot%2520mode%2520scripts%2520prarthan%2520bhatt#5439795 

    Thanks

  • I resolved the Issue by myself 2 days before.

    Thanks 

    DEEPAK