Snippet - More Complete G120 Custom Watchdog

I just posted More Complete G120 Custom Watchdog on Codeshare. Feel free to discuss and make suggestions here.


Hi thanks for the share…
In regards to catching WDWARNINT in c#, to my understanding this won’t help you because the watch dog kicks in when the runtime locks up, and you are no longer able to reset the counter in c# so even catching the WDWARNINT would not help since c# is unresponsive at that point… it could be helpful if used in RLP maybe… or am I wrong?

Thanks Jay Jay for your input.

I guess I did not make myself clear enough the first time! I hope I have a better luck the second round:

Let’s assume that the watchdog timer limit is setup @ 30 secs, meaning if the code locks up (stops resetting the WDT timer), the WDT hardware will kick in and reset the hardware 30 seconds from the last reset of its counter. The thread that resets the WDT is setup to reset it every (timeout - 10 secs) = 20 secs.

WDWARNINT is setup to fire @ 25 seconds from the last reset of the WDT counter, this means we have 5 secs still before the WDT kicks in.

I agree with you on RLP. I have noticed from my preliminary testing that when NETMF locks up all of its threads lock up. So as you indicated, it’s most likely impossible to capture WDWARNINT in C#. Believe it or not, that’s what I have been reading on, the past couple of days: Handling interrupts in RLP.

In other words I am back to my familiar territory of C/C++, the old way! But getting started w/ RLP isn’t as easy as I thought! A good Ex.: Trying to install RLP interrupt on G400… With no luck

The good news is GHI team is very supportive and will get us out of trouble when the need arises as they did in the aforementioned link.


A good article (actually 2 since this one points to another important) relevant to the WDWARNINT interrupt handling, which I am trying to solve:

Journey under the hood of .NET Micro Framework

While I was researching the architecture of the .NETMF trying to figure out the best approach to find a solution for Version 2, mentioned on my Codeshare release, I was wondering if RLP is going to really get me there?

When the managed .NETMF environment locks up and say I managed to capture WDWARNINT in RLP, how am I going to be able to do a graceful shutdown of the .NETMF environment? like closing files and calling ReleaseStorage(). I know I can use callback functions to get back to that environment, but it’s already locked up?

Maybe since we can pass info the the RLP environment, I can close the files and flush them there? But can it be done? That still remains to be answered!

Any feedback will be greatly appreciated.

My latest update: Problem w/ Interrupt.Install(WDT_IRQn, … in RLP

Good News: Version 2 mission accomplished!

Please refer to the above link for details.

The second Version is posted in a new post for a reason explained there:
More Complete G120 Custom Watchdog + RLP

Happy Coding!

1 Like