I am developing an application using hibernation on an LM4F232H5QD using an XDS560V2. To emulate I have to connect to the target. So the target has to be powered on. When I power on the target, the hib module is enabled. Because of input conditions, the app does not request a hibernation. So I connect with the emulator.
When I reach code that checks for reset from hibernation or not, HibernateIsActive always returns true. Suspending emulation, resetting the processor, restarting and then resuming (buttons Suspend -> CPU Reset -> Restart -> Resume), does not get HibernateIsActive to return false.
I have tried to go to the HIB control register and try to reset some bits by hand, but some enable bits stick at 1.
How do I get the HIB module to get to a power on state in emulation?
The code I use to check for warm start is (where useWake and useRTC are tBooleans set to indicate whether the interrupts are of interest):
SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
// From C:\StellarisWare\boards\ek-lm3s1968\qs_ek-lm3s1968\qs_ek-lm3s1968.c
// Check to see if this is a wake from hibernation. If so, return true
// indicating a warm start
// For monitors, this is likely going to mean jumping right to the application
// For applications, probably nothing as we need to reinitialize anyway.
if (HibernateIsActive() &&
(useWake && ( (HibernateIntStatus(0) & HIBERNATE_INT_PIN_WAKE)) ||
(useRTC && (HibernateIntStatus(0) & HIBERNATE_INT_RTC_MATCH_0))) )
{
rv = true;
}