Hello,
i've been trying to hibernate tm4c123gh6pmi. So here's my code which is called when some condition is valid.:
hib_setup(SysCtlClockGet()); // setup hib module function
if (status_value & 0x01){ // if status_val indicate its ok to sleep go sleep
UARTprintf("\033[2J"); // clear screen
UARTprintf("\033[0;0H"); // setup cursor
UARTprintf("Preparing to Hibernation");
SysCtlDelay(64000000); // delay
HibernateRequest(); // hib request
while(1){ // while which will indicate if device is not sleeping it will togle diode.
MAP_GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_6,GPIO_PIN_6);
SysCtlDelay(1000000);
MAP_GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_6, 0);
SysCtlDelay(1000000);
}
}
heres setup function:
void hib_setup(unsigned int clock){
MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE); // enable hibernation
ROM_HibernateEnableExpClk(clock); //setup clock
UARTprintf("\033[2J"); // indicate procedure
UARTprintf("\033[0;0H");
UARTprintf("Hib Setup"); // indicate procedure
SysCtlDelay(10000000);
ROM_HibernateWakeSet(HIBERNATE_WAKE_RESET); // set reset to wake
SysCtlDelay(10000000);
The result is that when program goes to hibernation request it's not hibernating the micro, diodes are toggling and all events (timer, systick, gpio int) are still working. Could you point me form where to start digging?