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.

TM4C123 Hibernation issue

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?

  • Hello Matthew,

    Reset is not a source of wakeup on the TM4C123 devices. The valid sources are RTC Match, WAKEn pin assertion or LOW Battery Detection

    Regards
    Amit
  • Hi thank you for answer.

    I put the changes with no effect. It looks like something is still holding micro to hibernate. In trace window i can see that in HIBCTRL register PINWEN bit is on, CLK32EN is on, WRC is on, and HIB_REQ bit is also on. Micro is in while loop so i can see that systick is still working, and micro is responding for externa interupts like gpio.

  • Hello Matthew,

    Can you please send a snasphot of the Hibernate Registers? Also is this the LaunchPad you are using or a custom board. if a custom board please send a snapshot of the board. If the LaunchPad note that VDD3ON bit has to be set.

    Regards
    A,ot
  •  VDD3ON bit should be set also before the Hib request or its setup automaticaly by some of API function?I'm using custom board. HIB pin is not used (floating), Wake is connected to button. VBAT pin of micro is connected to BATTERY. I'm using 16MHz xtal and 32.784KHz oscil.

  • Hello Matthew

    Thanks for the data and information

    1. WAKEn pin must be connected to a Pull Up resistor to VBAT supply
    2. If HIB pin is not being used to control the LDO that powers VDDS and VDDA supply rail then VDD3ON must be set in the HIBCTL registers by explicitly configuring the register bit

    Regards
    Amit