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.

CC3235S: No Wakeup from Hibernate Slow Clock 32KHz Wakeup

Part Number: CC3235S
Other Parts Discussed in Thread: SYSCONFIG, CC3200, UNIFLASH

Hello,

I am trying to hibernate my CC3235S, and I see the PRCM API where I can Enable the Wakeup source as SlowClock and How I can set the interval. However, in practice this doesn't work.
I say it doesn't work because I only see my LED blink once and never again. This tells me that Hibernation Mode is not being exited (MCU rebooted essentially).

I included Power_init(), but I am actually not using a power policy, because my options do not include Hibernation with Clock Wakeup. All I see are Hibernation GPIO Wakeup.
There seems to be a mismatch between SysConfig Power menu and PRCM Source code.

        Power_init();
        While(1){
            LED_Blink();
            PRCMHibernateWakeupSourceEnable(PRCM_HIB_SLOW_CLK_CTR);
            PRCMHibernateIntervalSet(32768); // should set up the HIB timer for x amount of ticks, 32,768 per second
            PRCMHibernateEnter();
            }

I tried also using Power_Shutdown, but I was unable to get Power_shutdown(0, 1000); to work.

I see in the power_measurement example, Power_shutdown(0, milliseconds); is used and this works to Enter Hibernation mode, but it never Exits Hibernation mode even when I change the time interval to 2000 milliseconds.  Therefore, I have used Power_shutdown(0, milliseconds) in two instances with the same result.

I see documentation talking about Hibernation mode being woken by RTC/SlowClock but nothing actually works.

I have viewed CC32xx API docs which is how I came to use the PRCM functions sited above.

I have also viewed CC32xx Power Management documentation, but the functions used in the document don't exist in my library. There is not one app note or document that shows me how to do this.

This example given doesn't exist:

// Setting up timer as a wake source

/* Setup the RTC initial value - This can be obtained from NTP too */
init_time.secs = 0;
init_time.nsec = 0;
cc_rtc_set(&init_time);

/* Create a real time timer */
realtime_timer.source = HW_REALTIME_CLK;
realtime_timer.timeout_cb = timer_intr_hndlr;
realtime_timer.cb_param = NULL;

timer_hndl = cc_timer_create(&realtime_timer);

/* Configure the timer for a periodic wakeup */
interval_time.secs = LPDS_DUR_SEC;
interval_time.nsec = LPDS_DUR_NSEC;
cc_timer_start(timer_hndl, &interval_time, OPT_TIMER_PERIODIC);


Is there something I am missing? All I want to do is Wake from Hibernation with SlowClock like documentation states.

Thank you.

Edit: I Should mention that I'm using the Launchpad Development Board which does have an external 32kHz Oscillator for RTC. 

  • Hi,

    Your code for putting the device in hibernate and waking up from the slow clock appears to be correct:

    PRCMHibernateWakeupSourceEnable(PRCM_HIB_SLOW_CLK_CTR);
    PRCMHibernateIntervalSet(32768); // should set up the HIB timer for x amount of ticks, 32,768 per second
    PRCMHibernateEnter();

    To verify, I used the power_management example to put the device in hibernate mode. The application calls powerShutdown(), which then calls Power_shutdown(). I edited powerShutdown() in platform.c by adding the lines of code above to enter hibernate and have the device wake up based on the slow clock, and commented out Power_shutdown(), as shown at the bottom of the code snippet below:

    void powerShutdown(uint32_t shutdownTime)
    {
    #ifdef CC32XX
        Power_NotifyObj hibSignal;
    #endif
    
    #ifdef __MSP432P401R__
    #if 0
        Power_registerNotify(&hibSignal, PowerMSP432_ENTERING_SHUTDOWN,
                             preHibConfig,
                             (uintptr_t)NULL);
        if(shutdownTime != MAX_INT)
        {
            /* config gpio to wakeup from hib */
        }
        /*
         *    PowerMSP432_SHUTDOWN_0 => PCM_LPM35_VCORE0
         *    PowerMSP432_SHUTDOWN_1 => PCM_LPM45
         */
        Power_shutdown(PowerMSP432_SHUTDOWN_0,0);
    #else
        if(shutdownTime != MAX_INT)
        {
            if(shutdownTime >= 1000)
            {
                sleep(shutdownTime / 1000);
            }
            usleep((shutdownTime % 1000) * 1000);
        }
    #endif
    #elif CC32XX
        Power_registerNotify(&hibSignal, PowerCC32XX_ENTERING_SHUTDOWN,
                             preHibConfig,
                             (uintptr_t)NULL);
        //Power_shutdown(0,shutdownTime);
        PRCMHibernateWakeupSourceEnable(PRCM_HIB_SLOW_CLK_CTR);
        PRCMHibernateIntervalSet(32768);
        PRCMHibernateEnter();
    #endif
    }

    The hibernate and wakeup also worked when I added the same lines of code to the buttonled example.

    Are PRCMCC3200MCUInit() and Power_init() the first functions executed by your application code? They are typically called by Board_init().

    Best regards,

    Jesse

  • Also, just an FYI, the CC32xx Power Management documentation you had linked above is for the older gen 1 CC3200. Here's the link to the CC3x3x Networking Subsystem Power Management document

  • Thank you for the suggestion and your link.

    I modified power_measurement precisely as you did, but did not achieve your result. When the device goes into Hibernate, I never see another print statement ever again. I should see the Banner print again after Hib Wake (because of MCU rebooting), and I also put a UART print in after shutdown() just in case.

    By not seeing the UART Prints, I am assuming this means I am not waking. However, when I run the program again, I do see that the Wake Reason is HibWake, its just that the debugger / CCS woke it up, not my Slow Clock.

    So what does this mean? What could be different about my situation?

    I am using the Launchpad with default jumpers set. Is there some sort of prep that I missed?

    SDK 5.20.00 (I'm not updating because I have a complex project this is for that has issues on other SDKs. I'll debug that later, but for now 5.20 is staying).

    I did confirm that PRCMCC3200MCUInit() and Power_Init() are being called in Board_Init().


    Your time and effort is appreciated.

    Tom

  • Hey Tom,

    If you just edited the power_measurement example like I did, you won't see the banner ("Power Measurement Example Ver...") printed again because when the device reboots from hibernate, it will enter the intermittently connected state due to the section of code shown below in power_measure.c, which is called before displayBanner(). When I run the application on my end, I see the device enter hibernate and then after 1 second the device wakes from hibernate and prints the lines "Woken from Hib." and "Intermittently Connecting..." on the terminal. I tested with v5.20.00 of the SDK and it worked so I don't think SDK version is the issue. What service pack are you using?

    if (isWokenFromHib())
        {
            /* When waking from Hibernate we need to determine
               what use case the app exercises */
            if (getHibRetentionReg() == (uint8_t) UseCase_Transceiver)
            {
                PowerMeasure_appData.useCase = UseCase_Transceiver;
            }
            else
            {
                PowerMeasure_appData.useCase = UseCase_IntermittentlyConnected;
            }
        }

    Are you running the application from the debugger in CCS? If so, can you try flashing the program to the device and running it instead? When running from the debugger, the debugger will disconnect when entering hibernate and then whatever application was previously flashed to the device would run when the device wakes from hibernate.

    Best regards,

    Jesse

  • Jesse,

    This solved my issue thank you. After the Debugger was cut off / disconnected, My "burned" image was being ran, which was just a bunch of NOPs I put in.

    Short story, the previous image was an AWS project that tested MQTT client, so when I left it unattended while not in debug, guess how many MQTT publishes I found on my AWS MQTT test client!  So I burned in an image that didn't puke out MQTT messages every 2-3 seconds, my NOP image.

    Thanks for the info, I can't believe something that simple was my problem. In the future, is there a way to get my CCS-Created Debugged images to "Stick" without using Image Creator feature in UniFlash?

    I see there are two ways to use UniFlash. I have success using the Image Creator feature, but it's slow. I try using Auto-Detect (Top Option), but my image verification always fails, so I just give up and use Image Creator.

    I want my images to stay when the debugger is disconnected, but Image Creator takes a hot minute to flash. Maybe this is my only option. 

    When working on 16 bit MSP430 projects, I don't have this issue, so this is a result of my CC3235S ignorance I suppose.

    Thanks again.

    Tom

  • Hi Tom,

    Using Image Creator in UniFlash may be your best/fastest option for burning the image to the device.

    If you started your project from an example project from the CC32xx SDK, you may see "MCU+Image" as a build configuration option in CCS as shown here: https://dev.ti.com/tirex/content/simplelink_cc32xx_sdk_6_10_00_05/docs/simplelink_mcu_sdk/sysconfig_imagecreator.html#code-composer-studio, in which case you should be able to build and flash the image via CCS.

    Otherwise, Image Creator through UniFlash will be your best option for getting your image to stick (see user's guide here: https://www.ti.com/lit/ug/swru469h/swru469h.pdf?ts=1652128413663

    Best regards,

    Jesse

  • Thank you for all your help. I, and others appreciate it.