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.

  • It is worth noting that it never enters the while loop if the reset cause was GPIO.
  • Hello Mark,

    Did you check the example which uses the GPIO PK6 to do the same on your board?

    D:\ti\TivaWare_C_Series-2.1.1.71\examples\boards\ek-tm4c1294xl\hibernate

    Regards
    Amit
  • Hi Amit

    Thanks for the quick response.

    I had not seen this example before and it is useful. I cannot see anything for the configuration of the GPIO that is vastly different though and I've now modified mine to be the same in the places where it differs:

    GPIOPadConfigSet(GPIO_PORTK_BASE, GPIO_PIN_6, GPIO_STRENGTH_2MA,
    (GPIO_PIN_TYPE_WAKE_LOW | GPIO_PIN_TYPE_STD_WPU));

    and I have removed GPIOPinTypeWakeLow(GPIO_PORTK_BASE, GPIO_PIN_4);

    But it still just wakes up immediately.

    Can you spot any mistakes that I have made that could make it act this way?

    Thanks.
  • Hello Mark,

    Since I do not have your board would like to know if the regulator on your board configured for VDD3ON mode. i.e. The VDD supply always is 3.3V or does the regulator have an enable pin connected to HIB signal from the uC.

    Regards
    Amit
  • Hi Amit

    There is a permanent VDD supply, so the VDD3ON mode should be working fine. I've passed it to the electronics guy to investigate more as it seems to point to a hardware issue. I'll let you know if there is a problem.

    I see that when GPIO wakeup is set, it sets the same register to also listen for the wake pin (PINWEN in HIBCTL), I also see the wake pin is being toggled when it goes in and out of hibernation, we don't have this grounded.. Maybe this is causing the problem as it immediately sees this and wakes up?

    Thanks.
  • Hello Mark

    Yes, that could be the issue that the WAKE_n pin is toggling. What is the WAKE_n pin connected to?

    Regards
    Amit
  • Hi Amit

    It's not connected to anything other than a test point. It's floating. It's high when the processor is running and low when the processor goes into hibernate, which we believe is waking it back up again when PINWEN is set. Would that be the issue?

    Thanks.
  • Hello Mark,

    Can you connect WAKE_n pin to the VBAT supply via a 10K pull up and see if the issue persists. If yes, then it could be that the WAKE_n pin has been damaged or the VBAT switch has been damaged causing the WAKE_n pin to toggle

    Regards
    Amit