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: Waking up from LPDS mode triggered by GPIO

Part Number: CC3220SF
Other Parts Discussed in Thread: SYSCONFIG

Hi,

   Is there any example project that demonstrate waking up from LPDS mode triggered by GPIO ? It's better based on AWS demo project. Thanks.

Regards,

Martin

  • Hi Martin,

    There's no example that I'm aware of but luckily it's easy to setup. There's two ways to get this setup:

    1. If you have CCS v9.x installed and at least SDK v3.4 you can use the sysconfig file in whichever example you're working from and in the power interface configured your GPIO for LPDS
    2. Second option is using the PRCM APIs described in section 15.3 in the TRM. Once you enable your power policy (which most examples do) and you configure your wake-up sources uses the APIs it should work

    Jesu

  • Hi Jesu,

       Thanks a lot for your quick response.

       I tried to follow the style of AWS demo project. Press SW2 of LaunchPad board result in a crash instead of expected LED toggle. Is there any mistake I made ?

       Secondly because GPIO13 is also defined in gpioPinConfigs[], should I modify the code in gpioPinConfigs[] for enabling LPDS wakeup ?

    Here is my code based on original AWS demo project :

    1.  replace the Demo function with a LED blinking loop :

    // DEMO_RUNNER_RunDemos();

    Power_enablePolicy();
    PRCMLPDSWakeupSourceEnable(PRCM_LPDS_GPIO);

    while(true)

    {
    GPIO_toggle(GPIOCC32XX_GPIO_10);
    vTaskDelay(pdMS_TO_TICKS( 1000 ));
    }

    2. Modify PowerCC32XX_config :

    const PowerCC32XX_ConfigV1 PowerCC32XX_config = {
    .policyInitFxn = &PowerCC32XX_initPolicy,
    .policyFxn = &PowerCC32XX_sleepPolicy,
    .enterLPDSHookFxn = NULL,
    .resumeLPDSHookFxn = NULL,
    .enablePolicy = false,
    .enableGPIOWakeupLPDS = true,
    .enableGPIOWakeupShutdown = true,
    .enableNetworkWakeupLPDS = true,
    .wakeupGPIOSourceLPDS = PRCM_LPDS_GPIO13,
    .wakeupGPIOTypeLPDS = PRCM_LPDS_FALL_EDGE,
    .wakeupGPIOFxnLPDS = gpioButtonFxn0,
    .wakeupGPIOFxnLPDSArg = 0,
    .wakeupGPIOSourceShutdown = 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 = false,
    .ioRetentionShutdown = PRCM_IO_RET_GRP_1,
    .pinParkDefs = parkInfo,
    .numPins = sizeof(parkInfo) / sizeof(PowerCC32XX_ParkInfo)
    };

    3. Call back function :

    void myButtonFxn0()
    {
    /* Clear the GPIO interrupt and toggle an LED */
    GPIO_toggle(GPIOCC32XX_GPIO_09);

    }

  • Hi Martin,

    Is the MCU ever going to sleep? The while loop code above shows a delay. Keep in mind your callback function is triggered after wakeup and when you enter sleep mode your LEDs will turn off if they're being driven by GPIOs on the device.

    Jesu

  • Hi Jesu,

       You are right, the LEDs turn off after entering sleep. This make me thought that my code crashed. Actually, my code is working. Thanks a lot for your help !

    Regards,

    Martin