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.

GEL file to service the watchdog

Hi!

In my code I service the watchdog in the main loop, only if some conditions are fulfilled. As the conditions depend on some interrupts, when the DSP is put in HALT, the interrupts are not serviced, right? So the watchdog is not serviced. Every time I connect to the board while it's running, it is put in HALT and when I hit RUN, I get a watchdog reset. Is there a possibility to change the GEL file to avoid this?

For the moment I've changed the watchdog ISR to make a reset after 2 INTs, but if there is another solution that doesn't involve changing my code would be great.

Thanks,

Monica

  • Hi Monica,

    You could enable the Watchdog interrupt in the DBGIER Register. Interrupt that are enabled in this register are seviced during real-time emulation even when you are in halt mode. Find more information in System Control and Interrupt Guide for your target.

    Best regards

    Andreas

  • Hi Andreas!

    I've just tried what you've told me. When I'm in halt I can see the interrupts are serviced. But if I close the debug session and try to connect again (unintrusive connect), I get the watchdog reset.

    The interrupts are from INT1, so WAKEINT is also enabled. But WAKEINT was triggered anyway, in the interrupt I force a watchdog reset after saving in RAM what caused the reset.

    Thanks,

    Monica

  • Hi Monica,

    OK I see your problem now. You could change the GEL Funtion OnTargetConnect and disable the Watchdog ISR there, if this is a workaround for you. I remeber doing something like this some time ago. Unfortunately I don't have the time to test it rightaway, but give it a try. This wiki article probably helps you a bit

    Best regards

    Andreas

  • Thanks Andreas!

    On a first view it seems it's working, no watchdog reset and no code change needed.

    I've changed the GEL file:

    OnTargetConnect()
    {
        ...

        if (GEL_IsInRealtimeMode())     /* Do real-time mode target initialization */
        {
            *0x0CE2 = 0x0009;                         // Disable Wathcdog INT -> PIEIER1.8
            GEL_Halt();       
            Unlock_CSM();
            *0x7025 = 0x0055;                          /* Service the WD    */
            *0x7025 = 0x00AA;                          /* once to be safe.  */
            *0x0CE3 = *0x0CE3  & 0x0009;    // clear WAKEINT flag, don't change ADCINT1 and XINT1 flags -> PIEIFR1.8
            *0x0CE2 = 0x0089;                          // Enable Wathcdog INT -> PIEIER1.8
        }
       ......
    }

    Best regards,

    Monica