Today I finally got it working, using Netduino Plus firmware 4.1.0.6 with the Microsoft porting kit 4.1, compiling with RVDS 3.1.
I have attached the binaries and the source changes on top of the 4.1.0.6 source.
Instructions:
- Install the TinyBooterDecompressor.bin with SAM-BA
- Disconnect ND+ and reconnect while PRESSING THE ONBOARD BUTTON at the same time -> the onboard led should turn off (to signal that the watchdog has been turned off for this bootup)
- Deploy the firmware images using MFDeploy
To prove the watchdog works, I added a way to cause the soffware to get stuck. That happens now if you query the value of Watchdog.Timeout. Here's a sample program to prove this works. Note that the watchdog reset only works when the debugger is not connected, i.e. you need to stop debugging in Visual Studio to see the watchdog reset restarting the program:
using System; using System.Net; using System.Threading; using System.Text; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.NetduinoPlus; namespace NetduinoPlusApplication1 { public class Program { public static void Main() { int i = 0; int delay = 250; OutputPort led = new OutputPort(Pins.ONBOARD_LED, false); Watchdog.Enabled = true; // Watchdog.Enabled = false; // If the watchdog is disabled, the software will just get stuck while (true) { Debug.Print("Round " + i++); Debug.Print("Watchdog enabled: " + Watchdog.Enabled.ToString()); led.Write(true); Thread.Sleep(delay); led.Write(false); Thread.Sleep(delay); // This simulates the case when the software gets stuck if (i > 20) { TimeSpan foo = Watchdog.Timeout; } } } } }