I'm attempting to initialize the hibernation module in order to use the RTC functionality on the TM4C1290NCPDT and running into a lot of trouble.
Our design incorporates an external 32.768 kHz oscillator. However, while debugging my issues I discovered that our board fab had some quality issues and during my initial struggles what I really had was a 3V VBAT short to XOSC0. I've since removed the oscillator and the short such that XOSC0 and XOSC1 are now floating (no connection).
The relevant code is below. In the current state of things, the processor gets stuck in an infinite loop in the HibernateEnableExpClk(sys_clock) call. I've stepped through the assembly and can see that it attempts to flag CLK32EN in the HIBCTL register and wait for the write complete flag (WRC). However, all the write ends up doing is resetting the WRC bit which never goes high again leading to the code getting stuck waiting for the WRC bit and thus the infinite loop.
What am I doing wrong here?
sys_clock = SysCtlClockFreqSet(SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480, 25000000); SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE); while(!SysCtlPeripheralReady(SYSCTL_PERIPH_HIBERNATE)) { // wait for hibernate module to initialize } if(!HibernateIsActive()) { HibernateEnableExpClk(sys_clock); HibernateClockConfig(HIBERNATE_OSC_DISABLE); HibernateRTCEnable(); HibernateCounterMode(HIBERNATE_COUNTER_24HR); }