Other Parts Discussed in Thread: ENERGIA,
We are facing issue while using the hibernate module.
void init_rtc(){
SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
HibernateEnableExpClk(F_CPU);
HibernateClockConfig(HIBERNATE_OSC_HIGHDRIVE);
HibernateRTCTrimSet(32767);
HibernateRTCEnable();
HibernateRTCMatchSet(0,HibernateRTCGet()+5);
HibernateIntRegister(HibernateHandler);
HibernateIntEnable(HIBERNATE_INT_RTC_MATCH_0);
//Set up calender mode. HibernateCounterMode() is always needed but can be set to 12hr mode
HibernateCounterMode(HIBERNATE_COUNTER_24HR);
if(!HibernateIsActive()){
// put your setup code here, to run once:
//setup_time();
//Enable Hibernate peripheral. I'm using Energia so i use F_CPU for geting the clock frequency
HibernateRTCSet(1475489985);
//We set a interrupt for the RTC after second. You can change the value
debug_info("/-------------------RTC Initialization Code Executed.......---------/");
}
else{
debug_info("/--------------Hibernation Mode was already Active---------------/");
}
}
Above is our initialization code for Hibernate and rtc.
Information:
1. 3.3V Battery is attached to the device.
2. Custom Board using TM4c123BE6PZ
The system works fine most of the time, but sometimes get stuck infinitely at:
HibernateEnableExpClk(F_CPU); (Problem #1)
This forces watchdog trigger and the same thing keeps happening over and over again.
Problem #2:
Sometimes the devices fails to detect hibernate state after waking up from hibernate, so the default time get activated:
HibernateRTCSet(1475489985); <- This gets executed and the default time gets loaded.
Need urgent suggestions.
Regards,
Suchit Patel