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.

How to set up variable counters that are not reset by hibernation mode

Hi everyone,

I am thinking of using hibernation in my design. However, every time, the tiva board wakes up from hibernation mode, it runs through the entire code and resetting all the variables.

Is there a way that I could set up a variable that could save its state, even after hibernation? e.g. setting a variable that counts the number of hibernation cycles, the device has been through?

  • Hello Michael,

    In Hibernate the core domain including SRAM is shut down, which will cause the counters to be reset and on wake up it will work as if it is a POR condition.

    There are two options

    1. You can use the HIBDATA registers which are backed up in VBAT domain

    2. You can use EEPROM as a NVM memory to set up larger counter size,

    Do make sure that to initialize the counter you use the check if Hibernate Module Clock has been enabled by reading the register HIBCTL Bit-6

    Regards

    Amit