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: DWWD causes repeated resets

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN, TMDX570LC43HDK

Hello,

I have a problem with the example dwwd code from C:\ti\Hercules\HALCoGen\v04.07.01\examples\TMS570LC43x\example_dwwd.c.

In its original form with Generate_NMI being passed to dwwdInit() it appears to work correctly.

However, I have changed it to pass Generate_Reset to dwwdInit().

Now, after the first reset occurs and the software restarts it reaches the call to dwdCounterEnable(rtiREG1) and resets again.

It then resets when it calls dwdCounterEnable(rtiREG1) indefinitely.

Why does it behave in this way?

How can I stop these repeated resets?

Thank you.

  • Hi Andrew,

    It is the expected behavior. If you don't feed the dog in the defined window, the watchdog will reset the device. 

  • Hi QJ Wang,

    Thank you for your reply.

    I understand that if the watchdog is not fed that the device will reset, but I'm not convinced that this is my problem.

    After booting for the first time my test code calls
        dwwdInit( rtiREG1, Generate_Reset, 0, Size_100_Percent );
        dwdCounterEnable( rtiREG1 );

    Then it feeds the watchdog for a period of five seconds before it stops feeding it and consequently the device resets as expected.

    After the reset the device boots again and I was expecting it to behave in the same way i.e. call dwwdInit() and dwdCounterEnable() and then feed the watchdog for 5 seconds before resetting.

    But it doesn't. It resets as soon as it calls dwdCounterEnable( rtiREG1 ).

    Does a reset due to a watchdog not put the device into it's initial state?

    Is not it possible for the device to recover following a watchdog reset?

    Regards,

    Andrew

  • Hi Andrew,

    The DWWD expiry time is (DWDPRE+1)*2^13/RTICLK. In your configuration, the DWDPRD=0, assume RTICLK=75MHz, the Texpire=2^13/75MHz=109us. 

    So the watchdog has to be serviced within 109us. Otherwise, the NMI or Reset is generated.

  • Hi QJ,

    When running the software on the TMDX570LC43HDK development kit and using the debugger I have noticed that the EXTRST bit in the System Exception Status Register (SYSESR) is not set when the WDRST is set.

    I realise that this is not the correct behaviour but, do you have any idea why it would behave in this way?

    The consequence of EXTRST not being set when WDRST is set is that getResetSource() returns NO_RESET.

    Note that the EXTRST bit is set when the PORST or DBGRST are set.

    Regards,

    Andrew

  • Hi Andrew,

    The EXTRST bit is set after watchdog reset.

    This is the snapshot of my test, the SYSESR=0x2808  --> bit 3 is set

  • Hi QJ,

    In _c_int00() I have a break point on the call to rstSrc = getResetSource() and I run the debugger.
    The first time that the break point is hit.

    SysEsr is 0x00000808 as shown below.

    I then press Resume and my application runs until the Watchdog expires and the break point is hit for a second time.

    Now SysEsr is 0x00002800 as shown below. WDRST is set but EXTRST isn't.

    I was expecting EXTRST  to be set at this point. Am I correct to expect EXTRST  to be set? If not then why not?

     .

    I then press Resume again and my application runs for until the Watchdog expires and the break point is hit again.

    Now SysEsr is 0x00002000 as shown below. WDRST is set but EXTRST isn't (DBGRST has been cleared by getResetSource()).

    If I then restart the debugger, the first time the break point is hit, SysEsr is now 0x00002808.

    Why isn't EXTRST set when WDRST is set for the first time?

    Why is EXTRST only being set after the debugger has been started?

    Thank you.

  • The EXTRST should be set when WDRST occurs. Did you check the SYSESR value before code enters getResetSource() function?

  • Hi QJ,

    Yes.

    My second screenshot above shows the value of SYSESR before the code enters the getResetSource() function.

  • Closing this thread due to inactivity. If the problem still exists or additional questions arise, please open a new thread.