Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

Hibernate module losing RTC value on startup

Other Parts Discussed in Thread: TM4C129XNCZAD

We've spend the day troubleshooting an issue with the hibernation module in the TM4C129XNCZAD micro that we are using.  As you may recall, for this revision of our hardware we connected the HIB output pin to the 3.3V enable so the hibernation module controls the 3.3V rail.

 

Here is what we have learned about the issue we are seeing:

  • If an RTC match value is set before going to hibernation, the micro wakes up after the desired duration, but the RTC value is zero after wake-up.
  • If the power button is used manually enable the 3.3V rail before an RTC match, the micro wakes up, but the RTC value is zero.
  • In both cases, the RTC sometimes stops ticking and remains at zero until all power is removed from the micro (3.3V and VBAT).  In the other cases, it continues to count from zero. 

 

Here is our function for entering hibernation.  Are we doing something wrong when we enter hibernation that would cause the RTC to reset when the micro wakes up?  Note that we have previously been using the RTC wake-up feature with the 3.3V rail on, and it works as expected.  The datasheet mentions that the micro performs a POR when the 3.3V rails are applied…could this have something to do with it?  Thanks for your help!

 

void HIB_EnterHibernation(uint32_t rtcWakeSec)

{

   uint32_t ui32Status;

  

   dprint(DB_HIBERNATE, "Preparing to hibernate with Rails OFF");

  

   // a little delay to make sure the db messages go out

   SysCtlDelay(4000000);  

 

   if (rtcWakeSec != 0)

   {

      // Wake up in rtcWakeSec seconds

      HibernateRTCMatchSet(0, HibernateRTCGet() + rtcWakeSec);

      HibernateWakeSet(HIBERNATE_WAKE_RTC);

   }

   else

   {

      // Never wake up from RTC (set duration to be way in the future)

      // TODO – Ask Rob if there is a better way to hibernate without ever waking up?

      HibernateRTCMatchSet(0, HibernateRTCGet() + 1000000);

      HibernateWakeSet(HIBERNATE_WAKE_RTC);

   }

     

   // Clear any pending status.

   ui32Status = HibernateIntStatus(0);

   HibernateIntClear(ui32Status);

  

   // Request hibernation

   HibernateRequest();

   

   // We may return from the above call. Need a loop here in case we're still executing.

   while (1);

}

  • Hello Ryan,

    How has the configuration of the Hibernate module been done? And what is the configuration of the VBAT+VDD+VDDA connectivity on the board.?

    Regards
    Amit
  • I assume you are asking for the schematic implementation... see below.

    HIB output controls a cut-throat circuit that applies VBATT to a 3.3V switcher that runs the micro.   

    Let me know if you need any other info.

  • Hello Ryan,

    As I see there is a 2 Diode drop on the VBATT_A to VBAT. if the voltage falls before the trip point then when VDD is disabled the VBAT switchover may be failing as VBATT may be low.

    Regards
    Amit
  • Amit,

    We were worried about that as well and verified that VBATT does not drop too low.  The battery voltage is from 3.0 - 3.8V during operation and the small current draw from the hibernate module causes a very small voltage drop across the diodes.  

    Ryan

  • Hello Ryan,

    Can you please share the Hibernate Module configuration code (not the final setting to make it go into hibernate)?

    Regards
    Amit
  • Amit, here is the configuration code we are using.  This is done on every power up and every time we wake-up from Hibernate.

    void HIB_Init(void)
    {
       uint32_t sysClockFreq;
       uint32_t ui32Status;
    
       // see what woke us up
       HIB_FindWakeCause();
    
       // enable the hibernation module
       sysClockFreq = GetClockFrequency();
       HibernateEnableExpClk(sysClockFreq);
    
       // Configure the clock source for Hibernation module and enable the RTC feature.
       HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE);
       HibernateRTCEnable();
    
       // if we have taken control of the GPIO during hibernate, return it to GPIO
       if(HibernateGPIORetentionGet() == true)
       {
          HibernateGPIORetentionDisable();
       }
    
       // get and print the RTC time, re-use sysClockFreq
       sysClockFreq = HibernateRTCGet();
       dprint(DB_HIBERNATE, "Hibernate init: RTC time = %lld", sysClockFreq);
    
       // Clear any pending status.
       ui32Status = HibernateIntStatus(0);
       HibernateIntClear(ui32Status);
    }

    Also, here is a plot of the HIB output pin, 3.3V Rail, and VBAT.  VBAT dips to 3.0 when HIB is entered, and spikes up to 3.5V when exiting HIB.

  • Hello Matt,

    The switchover looks nasty. I haven't seen such a switchover in my testing so far.

    However a couple of things.

    1. HIB_FindWakeCause(); is called but not used. if Hibernate is indeed the cause then the re-init is not required
    2. If the 32K Osc stops then it would be worth looking at the VBAT rail when it stops. My suspicion is the hibernate VBAT supply is falling too low.

    Regards
    Amit
  • Hi Amit,

    We have done a bit more testing and think we understand more about what is happening.  It seems that the hibernate module does not report valid RTCC and RTCCTL register values if the processor is powered by applying the 3.3V rail while in hibernation.  Note that we have a power button that manually applies 3.3V to the micro even if the HIB pin is low and does not trigger the WAKE pin.  See scope plot below and event descriptions for what we are seeing.  Why are these registers reading zero?  We know the RTC is still running because it wakes up again on WAKEUP D.  Thanks for your help!

  • Hello Matt,

    Can you instead use the VDD3ON Mode? Supplying the power when in VDD3OFF mode is configured is not a valid configuration.

    Regards
    Amit
  • Amit, thanks for the quick response.  Our circuit draws too much current if we leave the 3.3V rail on.  Is there a way to have the processor wake up the hibernate module when VDD is applied?

  • Hello Matt,

    Unfortunately no. The 3.3V must be connected via a switch or a regulator (latter if a higher voltage supply is being used) and the ENable pin must be controlled via the HIB_N for VDD3OFF mode.

    Regards
    Amit