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.

TMS570LS1227: Watchdog timer stops the MCU but does not restart

Part Number: TMS570LS1227
Other Parts Discussed in Thread: HALCOGEN

Hello, 

I am trying to implement a simple watchdog timer in my code and I want my code to reset and restart from the beginning if I don't "pet" the watchdog, but it just stops working all together and doesn't restart. 

I am using FreeRTOS and configure all settings in Halcogen. As a consequence of the OS, there is no RTI settings page so I have to access its registers manually in my CCS code. 

I need to implement a watchdog timer, but not a windowed one. I am assuming "Digital Windowed Watchdog Reaction Control Register" (RTIWWDRXNCTRL) controls the reaction to non-windowed watchdog timer as well.

  • Hello,

    We don't have an example of using DWD in freeRTOS. Did you make the DWD work without freeRTOS? 

    You can use the DWWD example in HALCoGen. When the window size is 100%, it acts as DWD time-out-only watchdog.

  • To be able to use that example, I need the rti.h file that would be generated by halcogen but enabling the rti driver isn't not an option because of the freeRTOS. So instead I access the registers directly in my code with these functions:

    void S0G1_WDT_Init(uint16 preload)
    {
      /* T_exp = (PRELOAD + 1) x 2^13 / RTICLK1 */
      wdtREG->WWDRXNCTRL = 0x05; /* Reset after expiration */
      wdtREG->WDSTATUS = 0xFF;	/* Clear status register */
      wdtREG->DWDPRLD = preload; /* Set expiration time */
    }
    
    void S0G1_WDT_Start(void)
    {
      wdtREG->DWDCTRL = 0xA98559DA;
    }
    
    void S0G1_WDT_Reset(void)
    {
      wdtREG->WDKEY = 0x0000E51A;
      wdtREG->WDKEY = 0x0000A35C;
    }

    I think the watchdog is really enabled (I can't debug the code - there is no jtag) since it stops my program if not petted, but doesn't restart it. Any suggestions?

  • An update:

    I want to try to generate an NMI when the watchdog timer reaches zero instead of generating a system reset. However I cannot find the interrupt number generated by watchdog neither in the user manual nor in halcogen. 

    Can you give some information about the NMI generated by the watchdog?

  • The interrupt from the Windowed Watchdog is mapped to ESM group 2 channel 24. You need to configure the windowed watchdog (DWWD) reaction to be an interrupt instead of a system reset on any watchdog violation. The ESM group2 flag will then generate a non-maskable interrupt to the CPU via the VIM interrupt channel 0 (mapped to ESM high-priority interrupt).