This is my watchdog initialization configuration:
This is my dog feeding program:
Is there a problem with my timeout? How much timeout setting is appropriate?
Hello,
Looks like you are new to embedded programming.
The SWT is on this device enabled by default ( when it comes from factory) and the default SWT timeout is 20ms.
Your SW is handling SWT configuration.
It looks like your startup is disabling SWT to prevent reset after 20ms. This is usually sooner then your code is able to reach main where users service watchdog.
That is OK.
In you application you have to enable SWT, I expect you are doing it here:
That is OK, but have in mind debuggers by default disable SWTs. So either configure your debug tool to enable SWT, or run tests without debugger. (you should see periodic resests).
Last thing you have to care about is reset escalation counter. I hope you are handling this in your code, otherwise you will run into reset escalation when only Power on Reset can recover the device.
For more details refer to reference manual SWT chapter 52.5 Functional description.
Best regards,
Peter
hi,
Is this right?
If this operation cannot be debugged
What should I do now? Please guide me,thank you
Hello,
thank you for your reply. I tried to update the last three lines in 《turn off swts》. Running my program will still jump to 《sram_loop:》, is there any other solution?