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.

CC3220SF-LAUNCHXL: Wakeup from Hibernation/Shutdown

Part Number: CC3220SF-LAUNCHXL

SWRU465, page 504:

void PRCMHibernateWakeupSourceEnable(unsigned long ulHIBWakupSrc)
Description: This function enables the specified HIB wake-up sources.
Parameter: ulHIBWakupSrc: Bit-packed representation of valid wake-up sources. ulHIBWakupSrc is
bitwise or one or more of the following:
• PRCM_HIB_SLOW_CLK_CTR: Slow clock counter
• PRCM_HIB_GPIO2: GPIO 2
• PRCM_HIB_GPIO4: GPIO 4
• PRCM_HIB_GPIO13: GPIO 13
• PRCM_HIB_GPIO17: GPIO 17
• PRCM_HIB_GPIO11: GPIO 11
• PRCM_HIB_GPIO24: GPIO 24

PowerCC32XX.h, typedef struct PowerCC32XX_ConfigV1:

/*!
* @brief The GPIO sources for wakeup from shutdown
*
* Only one GPIO {2,4,11,13,17,24,26} can be specified as a wake source
* for Shutdown. The GPIO must be specified as one of the following (as
* defined in driverlib/prcm.h): PRCM_HIB_GPIO2, PRCM_HIB_GPIO4,
* PRCM_HIB_GPIO11, PRCM_HIB_GPIO13, PRCM_HIB_GPIO17, PRCM_HIB_GPIO24,
* PRCM_HIB_GPIO26
*/

 uint32_t wakeupGPIOSourceShutdown;

Questions:

  1. I don't understand the differences between Shutdown and Hibernation. In Figure 15-2 and related paragraphs you talk about Hibernation mode, but in the functions appear both words. Have they the same meaning?
  2. Why one document says I can select one or more GPIO for wakeup (among the six defined as "wake") and the source code says only ONE? Who is right?

  • Hi Mark,

    1. Shutdown is lowest power mode system-wise. Everything is turned off and the MCU can wake up using the nReset line only.
    Hibernate keeps the RTC enabled and faster wake up is supported from RTC or GPIO.
    See more details in chapter 5.7 of the datasheet (www.ti.com/.../cc3220.pdf).

    2. Only one GPIO can serve as a wake-up source.

    Br,
    Kobi
  • Thanks, but the confusion is still there:

    •  I'm definitely using the hibernation mode because the startup time is very short (dozen of ms), the MCU says it exited the HIB mode and both RTC and GPIO interrupts are enabled, BUT I'm using the Power_shutdown() function from Power.h!

    • or-ing two GPIO (i.e. .wakeupGPIOSourceShutdown = PRCM_HIB_GPIO2 | PRCM_HIB_GPIO13; ) leads to wake-up the MCU with either one! This should not work as per your answer.

  • Hi Mark,

    Power_shutdown is indeed a misleading name - it means entering into Hibernate (which is the lowest power mode that you can get with software control. The actual Shutdown mode requires toggling the nReset pin).

    Having 2 GPIOs as wake-up sources is very interesting. To my knowledge this is not possible but I will double check.
    Are you using any of the SDK example to test this? Did you just add the second bit to the wakeupGPIOSourceShutdown mask?
    Have you verified (measured) that the device gets into the low-power mode?

    br,
    Kobi
  • Tomorrow I might do further tests, anyway I'm using a modified version of OTACloud example.
    To enable the GPIO wakeup sources I just changed the PowerPolicy as follow:

    const PowerCC32XX_ConfigV1 PowerCC32XX_config = {
    .policyInitFxn = &PowerCC32XX_initPolicy,
    .policyFxn = &PowerCC32XX_sleepPolicy,
    .enterLPDSHookFxn = NULL,
    .resumeLPDSHookFxn = NULL,
    .enablePolicy = true,
    .enableGPIOWakeupLPDS = true,
    .enableGPIOWakeupShutdown = true,
    .enableNetworkWakeupLPDS = true,
    .wakeupGPIOSourceLPDS = PRCM_LPDS_GPIO13,
    .wakeupGPIOTypeLPDS = PRCM_LPDS_RISE_EDGE,
    .wakeupGPIOFxnLPDS = NULL,
    .wakeupGPIOFxnLPDSArg = 0,
    .wakeupGPIOSourceShutdown = PRCM_HIB_GPIO2 | PRCM_HIB_GPIO13,
    .wakeupGPIOTypeShutdown = PRCM_HIB_RISE_EDGE,
    .ramRetentionMaskLPDS = PRCM_SRAM_COL_1 | PRCM_SRAM_COL_2 | PRCM_SRAM_COL_3 | PRCM_SRAM_COL_4,
    .keepDebugActiveDuringLPDS = true,
    .ioRetentionShutdown = PRCM_IO_RET_GRP_1,
    .pinParkDefs = parkInfo,
    .numPins = sizeof(parkInfo) / sizeof(PowerCC32XX_ParkInfo)
    };

    I'm pretty sure it enters in hibernation because:

    - I read 0,0 mA on my current meter (I cannot reliable measure uA but in active mode the current is much higher)
    - on wakeup (RTC or GPIOs) the code starts again from entry point
    - PRCMSysResetCauseGet() returns PRCM_HIB_EXIT
    - PRCMHibernateWakeupCauseGet() return either PRCM_HIB_WAKEUP_CAUSE_GPIO or PRCM_HIB_WAKEUP_CAUSE_SLOW_CLOCK
  • Can you place your code, which wakes up from HIB by GPIO, here? i dodn't understand this moment
  • I've already sent my code, please look at the previous answer.