Hi,
I've set up a watchdog timer on my LAUNCHXL2-RM46 that initiates a system restart when it expires. I'm having trouble making the system behave differently when it encounters a restart initiated by the watchdog timer.
I've tried reading systemREG1->SYSESR. This looks like it is assigned a value to indicate the reason for restart was due to watchdog timer, but the value is cleared by SYS_EXCEPTION = WATCHDOG_RESET in sys_startup.c. By the time my main code runs, the evidence of the reason for restart is gone.
I'm also finding that if I call a function I define elsewhere in my code from sys_startup.c, the program hangs once it reaches that function. For instance, trying to blink an LED from this function doesn't work.
What is intended best practice for dealing with a system restart due to watchdog expiry?
Is the intention for me to modify the sys_startup.c file such that it doesn't clear the exception status register so I can read and clear it from my main? Would I be introducing problems into the rest of the startup sequence if I modify this file?
Am I encountering failure when trying to blink the LED from a function called from sys_startup.c because the proper initialization on the board hasn't occurred following the restart?
Thanks,
Paul