Harmony 3, PIC32MX174, Watchdog question [SOLVED]
I'm using an PIC32MX147256B under Harmony V3 and FreeRTOS and am trying to setup the watchdog and have run into a couple of issues.
First, I tried to enable the watchdog in Harmony configurator as follows:
1) Select "System" in the project graph
2) Under device & Project Configuration -> PIC2MX174F256B Device Configuration -> DEVCFG1
2a) WDTPS is set to PS2048 (2 second interval)
2b) WDTSPGM is ON
2c) WINDIS is OFF
2d) FWDTEN is ON
2f) FWDTWINSZ is WINSZ_25 (default, not relevant as WINDIS is OFF)
After generating the code, the plib_wdt.h and plib_wdt.c files are included in the project but trying to compile it generates a syntax error in plib_wdt.c:
../src/config/default/peripheral/wdt/plib_wdt.c:73:15: error: '__WDTCONbits_t' has no member named 'WDTCLR'
Next, I am trying to do it in software, so I set the Harmony settings to disable the watchdog.
Under device & Project Configuration -> PIC2MX174F256B Device Configuration -> DEVCFG1
FWDTEN is now OFF
I can now activate the watchdog by placing the following in the code.
WDTCONSET = 0x8000;
As expected, if I do nothing else, the system reboots every two seconds or so (the WDTPS is set to PS2048)
To reset the watchdog, I use this line
WDTCONSET = 0x01;
However, the system continuously reboots and RCON properly indicates the reboot was due to the watchdog. I am positive the line supposed to reset the watchdog executes as it is flanked by blinking LED code.
Any idea on either how to coax Harmony to enable the watchdog in a functional way, or to reset the watchdog when enabled in software?
post edited by yp66 - 2020/09/26 20:44:05