This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GPIO Wake up in hibernation mode on a TM4C129 doesn't seem to work.

Other Parts Discussed in Thread: TM4C129LNCZAD, EK-TM4C1294XL

Hi All

I'm using a TM4C129LNCZAD, using TI-RTOS 2.12.1.33.

I'm trying to get the hibernation mode for GPIO wakeup working but with no avail. I have tried RTC to prove the setup is ok and this is fine.

It goes into hibernation but immediately comes out, over and over. I have tried different pin configurations but it always has the same behaviour.

Here is my setup:

We are using an external 32kHz crystal while in hibernation, not using the main clock. I have proven it is ok by using a 30 second RTC wake up, which works.

SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000); 
SysCtlDelay(1500);

SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
SysCtlDelay(1500);

HibernateEnableExpClk(32768);

//simple counter delay to allow time to pass and for safety if we get stuck in hibernate
while
(delay_count < 15000000)
{
    delay_count++;
}

delay_count = 0;

HibernateGPIORetentionDisable();
SysCtlDelay(1500);

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK); // enable Port K GPIO
SysCtlDelay(1500);

//Port K pin 4 is a button on our board, it is Active low.
GPIOPinTypeGPIOInput
(GPIO_PORTK_BASE, GPIO_PIN_4);
GPIOPadConfigSet(GPIO_PORTK_BASE, GPIO_PIN_4, GPIO_STRENGTH_12MA, GPIO_PIN_TYPE_STD_WPU);

HibernateClockConfig(HIBERNATE_OSC_HIGHDRIVE);
resetCause = HibernateIntStatus(false);
SysCtlDelay(500);

if ((resetCause & HIBERNATE_INT_GPIO_WAKE) == HIBERNATE_INT_GPIO_WAKE)
{
    while(1);
}

//Port L is an LED which is blinked on and off after a large counter
SysCtlPeripheralEnable
(SYSCTL_PERIPH_GPIOL); // enable Port L GPIO
SysCtlDelay(500);
GPIOPinTypeGPIOOutput(GPIO_PORTL_BASE, GPIO_PIN_4);
SysCtlDelay(500);

LED_On(TM4C129x_WLAN_LED); 

while (delay_count < 30000000)
{
    delay_count++;
} 

//wake on active low
GPIOPinTypeWakeLow
(GPIO_PORTK_BASE, GPIO_PIN_4);
LED_Off(TM4C129x_WLAN_LED);


HibernateGPIORetentionEnable();
SysCtlDelay(500);
HibernateIntClear(HibernateIntStatus(0));
SysCtlDelay(500);

HibernateWakeSet(HIBERNATE_WAKE_GPIO); // set wake condition to wake pin
SysCtlDelay(500);


HibernateRequest();

//Wait till hibernate
while(1)
{
    ;
}

Any help is greatly appreciated. Thanks.