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: How to configure NMI interrupt handler for watchdog?

Part Number: TMS570LC4357

Dear IT support,

We want to use NMI instead of reset in watch dog.

 dwwdInit(rtiREG1, Generate_NMI, 3900, Size_100_Percent);

How to configure NMI interrupt handler?

where NMI interrupt API will be created?

Which VIM channel shall be used?

  • Hi Manoraj,

    Please refer below FAQ that i created very recently:

    (+) [FAQ] TMS570LC4357: How to use Digital Watchdog - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    In above FAQ i discussed about how to create NMI and RESET using internal digital watchdog.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    Thanks for the reply

    WatchDog_NMI is not updated during run time.

    it is only updated if i put breakpoint at line no 105

    why WatchDog_NMI is not updated during run time?

    is there any compiler optimization?

  • Hi Manoraj Selvaraj,

    I understood the issue, the below highlighted line was wrong:

    This is wrong because the SR1[1] (ESMSR2 register) status is already clearing in "vimECCErrorHandler" function before calling "esmGroup2Notification". So, we should not check SR1[1] register to find out the ESM error.

    This is clearing by following lines:

    The either of the above line can clear the SR1[1] register. At second line you can see we are forcefully writing to clearing the corresponding bit in SR1[1] register, but on my testing i also found that reading IOFFHR will also clear the SR1[1] register.

    The right way to do is the below thing:

    Just verify the "channel" argument passing to this function with 24 (i.e. RTI_WWD_NMI).

    But you might get a doubt that, why you got the SR1[1] flag SET if you kept the breakpoint? This is because this is not the old status this is new status created due to the breakpoint, i mean if we set a breakpoint then watchdog timeout will get expire again right, that will again SET the SR1[1] register.

    And thanks for pointing out this mistake, i will upload the modified code into the FAQ again.

    And also remember the following thing:

    Even after above modification also the variables will not update while running the code even though you set "continuous refresh" in expression window, to see the status you just need to pause it. The "continuous refresh" can only do continuous refresh while pausing the code only.

    The difference you can see in the code is now you can directly set the breakpoint at below line

    No need to SET the breakpoint before this line and no need to do step by step debugging because now variable "WatchDog_NMI" will get SET everytime.

     --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    Thanks a lot for detailed explanation.