Hello all,
i'm trying to get the hibernation module to work on my tiva launchpad TM4C123. The problem is:
When I try to enable the hibernation module clock source, the Write Complete/Capable Bit will not be set after trying to access the hibernation control register (HIB_CTL).
This is what my code looks like. I have tried it using the TI Peripheral Library as well as implementing it with the CMSIS driver.
The code using the CMSIS driver:
SystemInit(); SYSCTL->RCGCHIB = 0x01; // Provide clock to HIB while((SYSCTL->PRHIB & 0x01) == 0); // wait for hib module to be accessible while((HIB->CTL & 0x80000000) == 0); // check if hib interface is ready to accept write HIB->CTL = 0x40; // Enable hib module clock source while((HIB->CTL & 0x80000000) == 0); // <-- infinite while loop HIB->CTL |= 0x0100; while((HIB->CTL & 0x80000000) == 0);
Code using the peripheral library:
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE); HibernateEnableExpClk(SysCtlClockGet()); // this is where it's stuck in the while loop HibernateGPIORetentionEnable();
The HibernateEnableExpClk()-Function calls the _HibernateWriteComplete(), which just waits for the HIB_CTL_WRC bit to be set (and does not happen).
While debugging both methods the hibernation control register HIB_CTL is equal to 0x00000000, after setting the CK32EN bit.
Am i missing something in my code or do you have any ideas why the initialization of the hibernation module is not working?
Best regards,
Mike