The problem is as follows:
- In our bootloader we have initialized the watchdog to a time of (SysCtlClockGet() * 30 seconds) so that it resets the system when the application FW does not start and run correctly and service the watchdog Interrupt.
- To test this behavior we loaded the bootloader with watchdog initialized and an application FW which has the Watchdog Servicing Routine disabled to check if the reset triggered by the Watchdog correctly.
- When we Power On the device (Cold Reset) we see that it resets the system after 60 seconds as expected since the Watchdog Interrupt is not serviced in the application FW.
- But after the Watchdog resets the system for the first time after power on (Cold Reset) we see that it then continues to reset (Warm Reset, I think) the system every 15 seconds (60seconds/4) and not after 60secs.
Observations:
- Every Cold Reset (external power off and then power on) triggers the Reset as expected after 60 secs but after that the successive resets triggered by the Watchdog are at 15 secs.
- We found that this was because the SysCtlClockGet()returns 15000000 for Warm Resets and 53693160 for the Cold Resets and hence the reset times of 60secs and 15 secs.
- Adding a delay before OR after the SysCtlClockFreqSet() does not help as well.
- Tried to find answers in the TM4C1294NCPDT data sheet and Tivaware ROM Info sheet but could not find any credible source.
Could you help us out in understanding why we see this difference in the behavior?
Also is there any operation that we need to do before the SysCtlClockFreqSet() is called again in Warm Reset scenarios so that we get a consistent value with SysCtlClockGet() in both Cold and Warm Resets?