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.

CC3235MODASF: Device comes out of hibernate at random times

Part Number: CC3235MODASF


Tool/software:

Once the firmware puts the device into Hibernate, the device exits Hibernate after anywhere from 164 microseconds to 30 seconds. This occurs randomly, around 1 in 1000 times. When this occurs, PRCMSysResetCauseGet() returns PRCM_HIB_EXIT (7) and PRCMHibernateWakeupCauseGet() returns 0.

The firmware does this before entering Hibernate mode. 

PRCMHibernateWakeUpGPIOSelect(PRCM_HIB_GPIO13 , PRCM_HIB_FALL_EDGE);
PRCMHibernateWakeUpGPIOSelect(PRCM_HIB_GPIO17 , PRCM_HIB_FALL_EDGE);
PRCMHibernateIntervalSet((32768 * 2));
PRCMHibernateWakeUpGPIOSelect(PRCM_HIB_GPIO11 , PRCM_HIB_FALL_EDGE);
PRCMHibernateWakeUpGPIOSelect(PRCM_HIB_GPIO4 , PRCM_HIB_FALL_EDGE);
PRCMHibernateWakeupSourceEnable(PRCM_HIB_GPIO4 | PRCM_HIB_GPIO13 | PRCM_HIB_GPIO17 | PRCM_HIB_GPIO11 | PRCM_HIB_SLOW_CLK_CTR);
uint32_t hibReg = HibRegRead();
Display_printf(gDisplayHandle, "HibReg %x Hibernate Now!\n", hibReg);
Display_printf(gDisplayHandle, 0, 0, "vvvvvvv");
PRCMHibernateEnter();

With this code we usually see the device exit Hibernate after 2 minutes, and PRCMSysResetCauseGet() returns PRCM_HIB_EXIT (7) and PRCMHibernateWakeupCauseGet() returns PRCM_HIB_WAKEUP_CAUSE_SLOW_CLOCK (2).

Do you have any ideas about how to fix/troubleshoot this issue?

  • Hi,

    I would expect to get either 0x2 for slow clock wakeup or 0x4 for GPIO wakeup.

    0x0 means that it woke up unexpectingly.

    I am less familiar with this area in the code (and really harder to debug it as the device is in hibernate).

    I will try to check internally.

    Shlomi

  • Hi,

    In the code, you can see that it returns 0 according to the following condition:

      if( (HWREG(0x00000400) & 0xFFFF) >= 2 )

      {

          return ((PRCMHIBRegRead((OCP_SHARED_BASE + OCP_SHARED_O_SPARE_REG_8))>>2)&0x7);

      }

      else

      {

          return(0);

      }

    Browsing through the code, this condition refers to the ROM version of the device and means it is earlier than ES2.0.

    It does not correlate with the fact that it works most of the times so I would assume the ROM version is OK.

    In this case, since it is not due to slow clock (wakeup does match the period set), I would assume this is due to GPIO.

    Maybe you can try to rule out some GPIOs since many GPIOs are included as wakeup sources and see if it makes any difference.

    Shlomi

  • Shlomi,

    We have modified these lines from the above code excerpt. Unfortunately we are still seeing the same occurrence of intermittent random resets 

    // PRCMHibernateWakeUpGPIOSelect(PRCM_HIB_GPIO13 , PRCM_HIB_FALL_EDGE);
    // PRCMHibernateWakeUpGPIOSelect(PRCM_HIB_GPIO17 , PRCM_HIB_FALL_EDGE);
    PRCMHibernateIntervalSet((32768 * 2));
    // PRCMHibernateWakeUpGPIOSelect(PRCM_HIB_GPIO11 , PRCM_HIB_FALL_EDGE);
    PRCMHibernateWakeUpGPIOSelect(PRCM_HIB_GPIO4 , PRCM_HIB_FALL_EDGE);
    PRCMHibernateWakeupSourceEnable(PRCM_HIB_GPIO4 | PRCM_HIB_SLOW_CLK_CTR);
    PRCMHibernateWakeupSourceDisable(PRCM_HIB_GPIO13 | PRCM_HIB_GPIO17 | PRCM_HIB_GPIO11);
    // PRCMHibernateWakeupSourceEnable(PRCM_HIB_GPIO4 | PRCM_HIB_GPIO13 | PRCM_HIB_GPIO17 | PRCM_HIB_GPIO11 | PRCM_HIB_SLOW_CLK_CTR);

    uint32_t hibReg = HibRegRead();
    Display_printf(gDisplayHandle, "HibReg %x Hibernate Now!\n", hibReg);
    Display_printf(gDisplayHandle, 0, 0, "vvvvvvv");
    PRCMHibernateEnter();

  • Hi,

    When looking into the power_measurement example in the SDK, and specifically into the UseCase_HIB case, you can see that it uses APIs in platform.c to wrap power related operations. Specifically, if you look into powerShutdown(), you can see that few additional steps are taken before actually using the PRCM APIs you use. For example, notifying registered clients, shutting down the SFLASH, etc.

    Any reason you call directly APIs instead using this wrapper?

    Can you use it and retest?

    Also, you didn't remove GPIO4. Can you keep only the RTC?

    Shlomi

  • Shlomi,

    We need GPIO4 for WiFi configuration, so I cannot remove that one without making major changes to the FW.

    As for using the powerShutdown wrapper, looking at the SDK code for Power_shutdown() function it does not seem to support enabling GPIOs as wakeup sources. I tried using it but could not get the GPIO4 to function. Also I am not sure which functions shut down the SFLASH in powerShutdown().   

  • can't you still use the GPIO4 settings and then call powerShutdown()?