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.

TMS570LC4357: Hooking up an interrupt to the Digital Watchdog

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hey,

I am currently working with the RTI Digital Watchdog Module and struggle to find, how to hook a specified interrupt routine to the DWD. I am working with a freeRTOS System which is why I have the RTI Driver disabled in Halcogen and I could not find any helpful info about it in any manual.

So my question would be, how do I specify an interrupt routine and hook it up to the digital watchdog?

Cheers, Alex 

  • Hello Alex,

    HalCoGen FreeRTOS template doesn’t allow to setup 1-3 RTI compare modules. The second RTI compare will need to be enabled manually. The RTI configuration is in the function of prvSetupTimerInterrupt(void) in os_port.c. The complete procedure of manually adding a additional timer (for example a 5 ms timer) in addition to a 1ms timer gernated by HalCoGen FreeRTOS is:

    1. In HalCoGen “VIM RAM” rename to “rtiCompare1Interrupt” interrupt 0x00000010:03

    2. In HalCoGen “VIM CHANNEL 0-31” enable interrupt 3 RTI Compare 1

    3. In HalCoGen generate code

    4. added HL_RTI.h

    5. added HL_reg_RTI.h

    6. added HL_RTI.c

    7. in os_port.c add the following lines at the end of method prvSetupTimerInterrupt

      /* Enable 5ms compare1 timer */
      portRTI_CNT0_COMP1_REG = portRTI_CNT0_COMP0_REG * 5; //5ms
      portRTI_CNT0_UDCP1_REG = portRTI_CNT0_UDCP0_REG * 5; //5ms
      portRTI_SETINTENA_REG = 0x03;
      

      add the following lines inside /* USER CODE BEGIN (2) */

      #define portRTI_CNT0_COMP1_REG ( * ( ( volatile uint32_t * ) 0xFFFFFC58 ) )
      #define portRTI_CNT0_UDCP1_REG ( * ( ( volatile uint32_t * ) 0xFFFFFC5C ) )
      
    8. where is needed in your code, add:

      #include "HL_reg_rti.h"
      #include "HL_rti.h"
      
      void rtiNotification(rtiBASE_t *rtiREG, uint32 notification)
      {
           dwdReset(rtiREG1);
      }
  • Thanks a lot but I realized I should have been more specific in my question. I am trying to let the Watchdog trigger an non-maskabe Interupt as stated in the ref manual and not reset the dwd through another interrupt..

    How do I specify an Interrupt that is triggered once the watchdog is not served correctly? 

  • The watchdog violation will set the ESM 2.24 channel and generate ESM high interrupt (VIM channel 0). If the watchdog is not serviced in the rtiNootification() ISR, the ESM high ISR will be called:

    main()

    {

        ....
        dwwdInit(Generate_NMI, 200, Size_100_Percent);

        dwdCounterEnable();

        rtiDisableNotification(rtiNOTIFICATION_COMPARE0);

        while(1);

        return 0;
    }


    void rtiNotification(uint32 notification)
    {
        //dwdReset();
    }

    void esmGroup2Notification(uint32 channel)
    {
        asm(" nop");   //Watchdog Violation 
    }