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.

How to setup watchdog ISR with SYS/BIOS

Expert 1960 points
Other Parts Discussed in Thread: CONTROLSUITE

Hi, I tried to setup watchdog timer ISR for my app which is running under SYS/BIOS on F28377x board.  It works fine before BIOS_start(), if I added code to wait in a while loop after WDT is enabled and linked to an ISR.  But if I simply enable WDT and call BIOS_start(), nothing will happens even I don't service the dog. I suspect that SYS/BIOS disables the watchdog (although the manua says that watchdoog is enabled by default).  I checked app.cfg but not sure where to set up watchdog in UI. There is a setting in Boot->xdc.runtime called "disableWatchdog" which is set to false (as default). Do I have to use Hwi and Swi to setup watchdog instead of simply linking it to an ISR (interrupt function)? Is there any example code or app note to use watchdog with SYS/BIOS? Thanks in advance! 

  • Shef,

    What do you mean by "linked to an ISR"? And when you enable the WDT, what exactly are you doing in your code?

    Can you share the code in main() that works? And the corresponding code that doesn't work?

    Which versions of TI-RTOS, SYS/BIOS, and XDC tools are you using?

    Alan
  • Hi Alan,
    Thanks for your quick reply. I just followed the example code in controlSuite to setup WDT, i.e. assign an interrupt function to the WAKE_INT

    __interrupt void wakeint_isr(void)
    {
    WakeCount++;

    // Acknowledge this interrupt to get more from group 1
    PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
    }

    and then link it to WAKE_INT, and enable WDT in main:

    PieVectTable.WAKE_INT = &wakeint_isr; // assign ISR

    WdRegs.WDCR.all = 0x0028;

    for(;;)
    {
    LoopCount++;

    // Uncomment ServiceDog to just loop here
    // Comment ServiceDog to take the WAKEINT instead
    // ServiceDog();
    }

    This works fine and the code jumps to wakeint_isr(). But if I replace the for loop with BIOS_start(), nothing will happens. I checked app.cfg which has a line:

    Boot.disableWatchdog = false;

    So I assume that WDT is enabled by default in BIOS. What else do I need to do to get WDT working with BIOS? Once it's working I plan to ServiceDog in a task. But I need to see WDT time-out working first. WOndering if I need to use Hwi ans Swi to set it instead of in the code. If so, any example procedures to use? Thanks!
  • I couldn't find anything in the BIOS_start() thread that would disable the WTD.
    Are you sure you are not refreshing the WTD periodically in one of your tasks?
    Please share the content of your .cfg file if possible.

    Alan
  • Alan, you are exactly right!!!  I did a global search and found a hidden serviceDog in one of tasks. I should have searched the code before I posted this question. This shows my lack of confidence or understanding on sys/bios. :-(

    By the way, there used to be a checkbox in .cfg to disable WDT but it's not there anymore. Do you know where it is now and why it is moved? Since there are UI to set timers and clock in sys/bios cfg, I'd expect to have a counterpart for WDT in cfg.  But it's nowhere to be found. Any thought on this?

  • Which versions of SYS/BIOS and XDC Tools are you using?
    What does the Boot module's config screen look like now?

    Alan
  • I'm using latest sys/bios 6.41.2.41, and XDC 3.30.4.52_vore in CCS 6.0.

    The module cfg screen looks like below:

  • Hmm.

    This appears to be a bug.
    The Boot.disableWatchdog config parameter exists but it is not being shown in the config tool.
    I'll file a bug to get this repaired.

    Alan