Watchdog and IFU does not work together

@ Dat -

G120 / G120HDR

@ Sambo -

unclear to me :'(. You meant if you are deploying an application G120 is reset and you think that because of watchdog?

@ Dat -

Quoting from : https://www.ghielectronics.com/docs/31/watchdog

[quote]Warning

Do NOT set the Watchdog Reset time too short during the Debug phase. If it is shorter than the time taken to deploy your code then your device will reboot and the new code never gets loaded.

The only way to get out of the problem is to erase the device and reflash the firmware.[/quote]

As I indicated before, the Max timeout you can specify when using the GHI.Premium.Hardware.LowLevel.Watchdog with G120 is 16 secs which is not sufficient to re-program the unit again after the watchdog been enabled on the target. The G120/LPC178x/7x resets itself in the middle of downloading a new program! So you have to reset the device manually and reprogram again, which annoying. But you could also end up with an unstable unit and have to reflash it a it happened to me a few times already!

My point is the Max timeout allowed by LPC178x/7x is 130 seconds and we are not able to set it that high - an exception will occur of you go beyond 16 secs!

:frowning:

@ Sambo -
Understand !

Right, you can not set higher than 16s in current version. I tested Olif’ code and it really works fine, you can use that if you want a higher value.

We will fix this in next version.

1 Like

@ Dat -

That’s all I wanted to hear!

Thanks
:slight_smile:

I have added the custom watchdog to codeshare
https://www.ghielectronics.com/community/codeshare/entry/886

1 Like

From LPC178x/7x User’s Manual:

[quote]3.8.4 Watchdog oscillator
The Watchdog Timer has a dedicated oscillator that provides a 500 kHz clock to the
Watchdog Timer that is always running if the Watchdog Timer is enabled. The Watchdog
oscillator clock can be output on the CLKOUT pin in order to allow observe its frequency.
In order to allow Watchdog Timer operation with minimum power consumption, which can
be important in reduced power modes, the Watchdog oscillator frequency is not tightly
controlled. The Watchdog oscillator frequency will vary over temperature and power
supply within a particular part, and may vary by processing across different parts. This
variation should be taken into account when determining Watchdog reload values.
Within a particular part, temperature and power supply variations can produce up to a
Âą17% frequency variation. Frequency variation between devices under the same
operating conditions can be up to Âą30%.[/quote]

From LPC178x/7x datasheet:

[quote]7.30 Windowed WatchDog Timer (WWDT)
• Selectable time period from (Tcy(WDCLK) x 256 x 4) to (Tcy(WDCLK) x 2^24 x 4) in
multiples of Tcy(WDCLK) x 4.
• The Watchdog Clock (WDCLK) source is a dedicated watchdog oscillator, which is
always running if the watchdog timer is enabled.

7.33.1.4 Watchdog oscillator
The Watchdog Timer has a dedicated watchdog oscillator that provides a 500 kHz clock to
the Watchdog Timer.[/quote]

So I recommend that the we don’t exceed 70% of the max calculated time period = 0.7 * 1/500KHz x 2^24 x 4 = 94 secs

Warning: GHI’s Watchdog.LastResetCause will not be correct on start-up when olif’s LowLevelWatchdog.Enable() is used in place of GHI’s Watchdog.Enable().

I just posted More Complete G120 Custom Watchdog on Codeshare.

I just posted More Complete G120 Custom Watchdog + RLP on Codeshare.