LP-EM-CC2340R5: How to wake up from low power mode via GPIO interrupt?

Part Number: LP-EM-CC2340R5

Tool/software:

Hi, TI

I want CAN RX pin to trigger an interrupt and wake up the system from low power mode after receiving any data. How do I configure it?

Is there a parameter setting like wake up function when requesting interrupt? Or need to call the wake function in the interrupt service function?

Best regards

Preston

  • Hello Preston,

    I hope you are doing well. Here we can leverage the SDK example "gpioshutdown" which shows how to configure a button to wakeup from shutdown. In this case you would replace the button with a different GPIO pin. 

    Thanks,
    Alex F

  • Hi, Alex

    I refer to the SDK example "gpioshutdown", it can wakeup from shutdown.

    But I still have two questions:

    1.When I first debugged, I called Power_sleep(PowerLPF3_ENTERING_STANDBY) to put the system in standby mode. However,it can't wake up the system via GPIO interrupt. What's the difference between Power_shutdown(0, 0) and Power_sleep(PowerLPF3_ENTERING_STANDBY)?

    2.I see this in the SDK example:

        PowerLPF3_ResetReason resetReason = PowerLPF3_getResetReason();
    
        /* If we are waking up from shutdown, we do something extra. */
        if (resetReason == PowerLPF3_RESET_SHUTDOWN_IO)
        {
            /* Application code must always disable the IO latches when coming out of shutdown */
            PowerLPF3_releaseLatches();
        }

    What does this code do? I found the system couldn't wake up without this code.

    Please help me with my questions., thank you.

    Best regards

    Preston

  • Hello Preston,

    1. The power state of the device is controlled automatically, so if you call sleep for 10 seconds (and don't have any peripheral that blocks standby) then you will go into standby; Power_sleep is not meant to be called directly by the application, or any drivers, it is specifically used by the power policy. This is why you see the uncontrolled behavior. 

    2. This code snippet will check how the device has woken up, then it will release latches which is needed for device configuration coming out of shutdown (*code is required by device coming out of shutdown, you can't not include this as the device will not wake up correctly and can create other issues). 

    From TRM "The device goes through a full boot when exiting shutdown, but I/Os remain latched and the software is able to discern that the reset cause is I/O wake-up from shutdown." 

    Thanks,
    Alex F

  • Hi, Alex

    call sleep for 10 seconds

    Is that what you mean?

    If I call sleep(10), 10 seconds later if all peripherals are standby, the system will go into standby. This means that other peripherals need to be manually turned off or put to sleep before the system goes into standby mode. Am I understanding this correctly?

    We had the BLE main anchors which needed to go to sleep but was still broadcasting.  Our previous solution on other chips was to go into standby mode, wake up the system with a timer after a certain amount of time, and then broadcast a period of time to go to sleep. Keep repeating this on standby.

    So I want to put the main Anchor into standby mode, and the other anchors just shutdown.

    Best regards

    Preston

  • Hello Preston,

    Yes, you will need to stop the peripherals blocking standby state when trying to enter that power mode, you can read more about our power management in the datasheet (power management section).

    Thanks,
    Alex F