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.

CCS/CC3220SF-LAUNCHXL: Doesn't wake up from hib.

Part Number: CC3220SF-LAUNCHXL
Other Parts Discussed in Thread: CC3220SF

Tool/software: Code Composer Studio

Ok, i just found a code an do like this:


#define NOT_ACTIVE_DURATION_MSEC    (60000)  /* 60 seconds */
#define LPDS_IDLE_TIME              (60000)  /* 60 seconds */


void gpioButtonFxn1(uint8_t index)
{
    UART_PRINT("\n\rWoke up from GPIO button .. \n\r");

    return;
}

void *Power_on_switcher(void)

{
    int32_t             status = 0;
    int16_t             slStarted = 0;
    ClockP_Params lpdsParams;

    // init gpio for leds and buttons
    // will include for PRODUCTION code
    Board_initGPIO();
    Board_initSPI();
    /* Configure the UART. Options in the */
    // TEST code
    InitTerm();



    PowerCC32XX_Wakeup wakeup;
    PowerCC32XX_getWakeup(&wakeup);
    wakeup.wakeupGPIOFxnLPDS = gpioButtonFxn1;
    PowerCC32XX_configureWakeup(&wakeup);
    Power_enablePolicy();


    /* install Button callback and enable it */
    GPIO_setCallback(Board_GPIO_BUTTON1, gpioButtonFxn1);
    GPIO_enableInt(Board_GPIO_BUTTON1);



    /* Turn on user LED */
    GPIO_write(Board_LED0, Board_LED_ON);
    powerShutdown(NOT_ACTIVE_DURATION_MSEC);

}

every minute write "i am alive' and go hib.

but, when i push button is nothing happen! it have to write "oke up from GPIO button"

where i am wrong?

  • ok, i found sprui18f and e2e.ti.com/.../648404
    i have edited const PowerCC32XX_ConfigV1 PowerCC32XX_config in CC3220SF_LAUNCHXL.c and now cc3220sf is wakes up on button pushed!! YES!!
    BUT!! it doesn't do callback cade gpioButtonFxn1. it just look like power on from hib.
    what i have to do to do callback code?
  • Hi Shamil,

    The state of the application is not retained in hibernate. The GPIO can wake the device from hib, but the application will resume from the reset vector (jump to the ROM bootloader) rather than jump into the GPIO interrupt handler. I recommend checking the restart cause when the device comes out of hibernate at the beginning of your application to distinguish between hibernate exit and power on reset. You will have to build a scheme into your application to see the actual reset cause if you want to try to distinguish between a timer or GPIO wake-up from hibernate.

    Best Regards,
    Ben M
  •     //check previous state
        if (isWokenFromHib()) //if from hibernate was previous state
           {
                UART_PRINT("isWokenFromHib true\n\r");
                //Do "No problem!" code;
    
            }
    
        else
            {
                UART_PRINT("isWokenFromHib false\n\r");
                status = configSimplelinkToUseCase();
                status = sl_Start(0,0,0);
                // TODO do connect by wps next
                status = wlanConnect();
    
                status =  sl_Stop(SL_STOP_TIMEOUT);
            }

    in this section check? ok i'll try. Where can i read about reset causes?

  • I did it!

    bool isWokenFromHibByGPIO(void)
    {
        if(PRCMHibernateWakeupCauseGet() == PRCM_HIB_WAKEUP_CAUSE_GPIO)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    bool isWokenFromHibByTimer(void)
    {
        if(PRCMHibernateWakeupCauseGet() == PRCM_HIB_WAKEUP_CAUSE_SLOW_CLOCK)
        {
            return true;
        }
        else
        {
            return false;
        }
    }