Zero w/WDT Going into Reset Loop

I have a Zero with the watchdog timer set. After about a day, the Zero locks up and the watchdog resets the board. However, no code is actually executed and the board just continues in a reset loop. Pressing the reset button has no effect. I have to unplug the USB to have the board boot back up normally again.

On some other boards, it appears to take a few days before the lockup but the effect is the same. Any idea what could be happening?

I found the command that is locking up the board:

//============= systemReset ================================================== systemReset ============
void systemReset() {
  // use the WDT watchdog timer to force a system reset.
  // WDT MUST be running for this to work
  WDT->CLEAR.reg= 0x00; // system reset via WDT
  WDTsync(); 
}

I’m going to just put the board in a while loop and just let the watchdog timer do it’s thing.

I don't understand your problem with Watchdog. "no code is actually executed and the board just continues in a reset loop"?

but for system reset on ARM is a function NVIC_SystemReset()

Ok, so most of the time, the board works fine. If I sense something in the application where I want to manually call the watchdog reset, I use the systemReset() function. For now, I've commented out that code and just have a never ending while loop to let the watchdog set itself off. I have the code running now waiting to see what happens.

The "Usual" problem on AVRs is that a hardware reset (eg, the watchdog firing) doesn't disable the watchdog, and then the bootloader neither disables nor resets watchdog, and then the bootloader runs long enough checking for new "upload" attempts that the watchdog expires, causing a reset loop in just the bootloader code.

Most of the AVR bootloaders have fixed this, a long time ago. I'd be surprised if the SAMD bootloaders have a similar problem, but ... it's possible.

The odd thing is that the watchdog is set for 16 seconds so you'd think that would be plenty of time to boot. I'll try shutting off the watchdog before calling the reboot and see what happens.

When the chip resets, while the WDT stays ON, it does not (on AVR, at least) retain the configured timeout. Instead reverting to the “post reset” value (which is the minimum time!)

Then how do you manually reset the board if you think it locked up? I did modify my sketch so the first line of code disables the watchdog.