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.

TM4C123GE6PM: TM4C123gxl deep sleep mode issue

Part Number: TM4C123GE6PM
Other Parts Discussed in Thread: EK-TM4C123GXL,

Dear Experts

I got an urgent issue and can be duplicated on TM4C123G Launch Pad.
Could you help me to verify it?

My customer found the TM4C123G (on his PCB) sometimes cannot be wake up after it goes into deep sleep mode.
So we try to duplicate this issue on TM4C123G Launch Pad.
Based on the attached example code, we make TM4C123G goes into deep sleep mode for 60 seconds then wake it up for around 18 seconds.
It is strange that TM4C123G really cannot be wake up in 9th times.
Did you got this kind of issue before?
Could you help me to check if it is any mistake we made on the attached example code or this is really an issue on TM4C123G?
Thanks for your support.

qs-rgb.rar

  • Jefferey said:
    It is strange that TM4C123G really cannot be wake up in 9th times.

    Are you stating that,  "8 times - the MCU (both client's & your LPad) successfully "wakes up" - and that (only) upon the 9th attempt - wake-up fails?

    (no representation of any such "expertise" is made - the intent is to "clarify your writing" - to speed & ease the response of those meeting your specification...)

  • Jefferey said:
    Did you got this kind of issue before?

    The code might be impacted by an errata - see RTC will sometimes miss waking from hibernate for a previous investigation into a similar problem.

  • Still though - poster's claim of failure during the "9th successive attempt" - appears notable.     (while being unlikely (possibly language issue)...)
    Pity that both vendor poster - and client - could not equal your "time/effort" in searching/finding & then presenting, "known errata!"

    Issues such as this should "always" drive a quick, in-depth, "Search for the errata" - to fail in that regard proves most telling...     (both to client & vendor poster)

  • cb1_mobile said:
    Still though - poster's claim of failure during the "9th successive attempt" - appears notable.

    Running that program in a EK-TM4C123GXL repeated the failure, in that the program entered deep sleep for a ninth time  and then never woke up:

    Welcome to the Tiva C Series TM4C123G LaunchPad!
    Type 'help' for a list of commands
    > External or other reset
    > 
    >Entering Deep Sleep...
    RTC Count: (18 / 600)
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (79 / 600)
    Entering Deep Sleep...
    RTC Count: (97 / 600)
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (157 / 600)
    Entering Deep Sleep...
    RTC Count: (175 / 600)
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (235 / 600)
    Entering Deep Sleep...
    RTC Count: (253 / 600)
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (313 / 600)
    Entering Deep Sleep...
    RTC Count: (331 / 600)
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (392 / 600)
    Entering Deep Sleep...
    RTC Count: (410 / 600)
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (470 / 600)
    Entering Deep Sleep...
    RTC Count: (488 / 600)
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (548 / 600)
    Entering Deep Sleep...
    RTC Count: (566 / 600)
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (626 / 600)
    Entering Deep Sleep...
    RTC Count: (644 / 600)

    To investigate added a dump of Hibernation Module registers prior to entering deep sleep:

        ui32RtcMatch = HibernateRTCGet() + 60;
        UARTprintf("Entering Hibernate with wakeTime=0x%x HIB_RTCC=0x%x HIB_RTCSS(count)=0x%x\nHIB_RTCM0=0x%x HIB_RTCSS=0x%x HIB_RTCT=0x%x\n",
                   ui32RtcMatch, HibernateRTCGet(), HibernateRTCSSGet(),
                   HibernateRTCMatchGet(0), HibernateRTCSSMatchGet(0),
                   HibernateRTCTrimGet ());
        HibernateRTCMatchSet(0, ui32RtcMatch);	// HC

    The results were the following, where never woke up after entering deep sleep for the ninth time:

    Welcome to the Tiva C Series TM4C123G LaunchPad!
    Type 'help' for a list of commands
    > External or other reset
    > 
    >Entering Deep Sleep...
    RTC Count: (18 / 600)
    Entering Hibernate with wakeTime=0x4f HIB_RTCC=0x13 HIB_RTCSS(count)=0x406e
    HIB_RTCM0=0x2c1 HIB_RTCSS=0x0 HIB_RTCT=0x2040
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (79 / 600)
    Entering Deep Sleep...
    RTC Count: (97 / 600)
    Entering Hibernate with wakeTime=0x9d HIB_RTCC=0x61 HIB_RTCSS(count)=0x5d9f
    HIB_RTCM0=0x4f HIB_RTCSS=0x0 HIB_RTCT=0x2040
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (157 / 600)
    Entering Deep Sleep...
    RTC Count: (175 / 600)
    Entering Hibernate with wakeTime=0xeb HIB_RTCC=0xaf HIB_RTCSS(count)=0x5d9f
    HIB_RTCM0=0x9d HIB_RTCSS=0x0 HIB_RTCT=0x2040
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (235 / 600)
    Entering Deep Sleep...
    RTC Count: (253 / 600)
    Entering Hibernate with wakeTime=0x139 HIB_RTCC=0xfd HIB_RTCSS(count)=0x5d9f
    HIB_RTCM0=0xeb HIB_RTCSS=0x0 HIB_RTCT=0x2040
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (313 / 600)
    Entering Deep Sleep...
    RTC Count: (331 / 600)
    Entering Hibernate with wakeTime=0x188 HIB_RTCC=0x14c HIB_RTCSS(count)=0x3d5e
    HIB_RTCM0=0x139 HIB_RTCSS=0x0 HIB_RTCT=0x2040
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (392 / 600)
    Entering Deep Sleep...
    RTC Count: (410 / 600)
    Entering Hibernate with wakeTime=0x1d6 HIB_RTCC=0x19a HIB_RTCSS(count)=0x5d9f
    HIB_RTCM0=0x188 HIB_RTCSS=0x0 HIB_RTCT=0x2040
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (470 / 600)
    Entering Deep Sleep...
    RTC Count: (488 / 600)
    Entering Hibernate with wakeTime=0x224 HIB_RTCC=0x1e8 HIB_RTCSS(count)=0x5d9d
    HIB_RTCM0=0x1d6 HIB_RTCSS=0x0 HIB_RTCT=0x2040
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (548 / 600)
    Entering Deep Sleep...
    RTC Count: (566 / 600)
    Entering Hibernate with wakeTime=0x272 HIB_RTCC=0x236 HIB_RTCSS(count)=0x5d9e
    HIB_RTCM0=0x224 HIB_RTCSS=0x0 HIB_RTCT=0x2040
    RTC MATCH INT...
    Wake Up from Deep sleep...
    RTC Count: (626 / 600)
    Entering Deep Sleep...
    RTC Count: (644 / 600)
    Entering Hibernate with wakeTime=0x2c1 HIB_RTCC=0x285 HIB_RTCSS(count)=0x3d5d
    HIB_RTCM0=0x272 HIB_RTCSS=0x0 HIB_RTCT=0x2040

    Analysis of the diagnostic output, TM4C123GE6PM datasheet and TM4C123GE6PM errata shows:

    1) The Hibernation RTC Trim (HIBRTCT) register has the value of 0x2040, rather than the reset value of 0x7FFF. The code isn't writing to HIBRTCT, but due to errata HIB#01 Some Hibernation module registers may not have the correct value in two situations, the HIBRTCT register value gets corrupted. See RTC counting too fast on lm4f120xl launchpad for some more investigation into this errata.

    Another side effect of the RTC Trim register having the value of 0x2040 is that the RTC will be ~1.2% faster than the actual frequency of the crystal.

    2) The RTC Sub Seconds Match is set to zero, which is the reset value.

    3) When failed to wake up on a RTC match the 6 least significant bits of the Hibernation RTC Match 0 register were set to 0x01 (and the RTC Sub Seconds Match is zero as above). Since the RTC Trim value of 0x2040 is less that 0x7FFF, as explained by the RTC Trim section of the datasheet when least 6 significant bits of RTCC (seconds count) change from 0x00 to 0x01 the RTCSSC (sub seconds count) will skip the value zero (and other values). Therefore, the RTC wake event doesn't happen because the RTC Sub Seconds Match condition isn't met.

    A solution is to apply the work-around for errata HIB#01 to ensure the Hibernation RTC Trim register has the reset value of 0x7fff which means there will be no RTC trim and therefore won't miss the RTC wakeup.

    If the program needs to apply a RTC trim then the logic which sets the RTC wakeup time would need to account for the possibility of missed /  duplicate wakeup interrupts.

  • I stand amazed:

    • at the depth & clear excellence of your analysis
    • at the fact that "upon the 9th "wake" - failure indeed occurs

    Never would I have expected that - yet again - wonderful investigatory work on your part...

    (of course I've "Liked" your most excellent analysis - that "Like" should be duplicated by those (most) benefiting from your findings...)