IWDG is enabled by system firmware. It is also kicked in the system tick function. I have done some tests on P1 with system firmware V0.5.0, and it seems to me that the Kick works in system tick function only if the loop time is very short, for example do nothing. and if the execution time of loop is a little bit long, then IWDG reset.
My question is:
Why the kick in system tick does not work if the execution time in loop is long?
If kick is in system tick, so the IWDG is used to protect the system tick?
@JS2017, from what I see in the firmware, the IWDG is only used by the bootloader as a fail-safe for a bad firmware flash. The system firmware doesn’t use the IWDG.
I also believe the IWDG is used as peakay123 described. There is a plan to expand the use in a future system firmware version to help reduce the need to include an external hardware watchdog, but I don’t know the specifics of how that will be implemented.
Thank you for your help. Probably the IWDG enabled is written in the system flag on the device. I will do more test let you know what I can get. Is there a way to erase the flag?
@JS2017, I’m not sure what you are trying to do. The IWDG is ONLY used by the bootloader to ensure recovery in case of a failed or bad firmware flash. What exactly are you trying to do or asking for?
Independent watchdog (IWDG): the IWDG is started by writing to its Key register or by hardware option. Once started it cannot be stopped except by a Reset. See Section 17.3 in Section 17: Independent watchdog (IWDG).
So, again, if all this IWDG stuff is in YOUR application and you modified the system firmware (systick), then I’m not sure what your question is. What I can tell you is that if you don’t start the IWDG, it won’t run. Once you start it, the only way to stop it is with a reset, assuming you don’t start again in your application.
Yes, I think I can remove the IWDG from my application. Does the IWDG have any effect on the OTA firmware update? I mean IWDG enabled in my application helps to reset when my application firmware update fails. or this is taken cared of by the system firmware.
I think the OTA firmware update process will use the bootloader. I just saw that my P1 was stuck during the update. Probably I did not wait some time after the device is online.
@JS2017, if IWDG is running in your application then it could interrupt OTA depending on how often you bump the IDWG. You may want to put the P1 into safe mode, bypassing your application so that the OTA can work without interference from the IWDG.
My application runs on P1 with sytem firmware V0.5.0. I removed the IDWG and even enabled the application watchdog and debug output. The P1 is frozen. My serial output and the Particle console output are as follows. At the same time:
1 My P1 LED does not change, solid cyan
2.the last message on the Particle Console shows that the device is offline
3. Serial output is frozen, my application loop ended perfectly, the system firmware did sock_send, but there is no read_packet_and_dispose calling like in the normal situation.
device went offlineno dataOctober 6th at 1:23:55 pm
{“data”:“offline”,“ttl”:60,“published_at”:“2017-10-06T17:23:55.315Z”,“coreid”:“26003d001547343231323438”,“name”:“spark/status”}