Why won't the Watchdog Timer (WDT) wake the PIC32 from sleep?
The Watchdog Timeout in Sleep (WDTS) bit in the RNMICON register gets set when the PIC32 comes out of sleep. This bit must be cleared by software before the watchdog timer can wake the part again from sleep.
The following code should be run after the device wakes up:
PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
PLIB_RESET_NmiEventClear( RESET_ID_0, WDTS_NMI );
PLIB_DEVCON_SystemLock(DEVCON_ID_0);