Here is my old .NETMF STM32 code for detecting the watchdog fired and restarted the App. I use it to detect whether the watchdog restarted the App or the user power cycled the device. Is there any chance you could add it to TinyCLR’s Watchdog class or give us a Register class so we can do it ourselves?
private const UInt32 PERIPH_BASE = 0x40000000;
private const UInt32 RCC_BASE = PERIPH_BASE + 0x23800; //
private static Register RCC_CSR = new Register(RCC_BASE + 0x74);
private static UInt32 IWDGRSTF = 1 << 29; // bit 29
private static UInt32 RMVF = 1 << 24; // bit 24
UInt32 RccCsr = RCC_CSR.Read();
if ((RccCsr & IWDGRSTF) != 0)
{
RCC_CSR.SetBits(RMVF); // Clear reset flags
return true; // watchdog fired
}
else
return false;