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.

GPIO Key and Android Suspend/Wakeup

I found in AM335x EVM Starter Kit, only one gpio key (GPIO_KEY1, GPIO0_30) are connected to GPIO bank 0, the other three gpio keys are connected to gpio bank 2, which are NOT supposed to be capable of waking up system when system suspends to OFF state. However, in Android (Jelly Bean 4.2.2, official TI release), all keys do wake up the system after screen off.

My questions:

1. Does AM335xEVM_SK suspend to lowest possible power state (OFF, only GPIO bank 0 can wake up the system)or not?

2. If not, and I want to put the system to OFF state when screen off (and no wakelock held), and I can wake up system with GPIO keys (I can do this on our custom board), is there any bad impact on user experience, say, the wake-up latency? or perhaps when the user just press the power button many times in a short sequence and the system responds slowly? Is there any published test results on the latencies when suspending into / wakeup from different suspend states?

We are designing an industrial handheld device based on AM335x. The power consumption budget for system suspend (screen off) is hopefully below 5mA (at most not more than 10mA). We hope the screen on/off operation should be responsive as possible as it can. What is your adviced suspend state configuration? 

  • Hi,

    first you are right, AM335x integrates an ARM Cortex M3 core that manages entry and exit of various stand-by and deep-sleep modes.
    There is a firmware called am335x-pm-firmware.bin (which enabled in am335x_evm_android_defconfig CONFIG_EXTRA_FIRMWARE) for M3 that will handle it. the Cortex M3 will wakeup the CPU from "DeepSleep0" mode. Only GPIO from bank 0 should be able to wake up the system.
    FYI: http://processors.wiki.ti.com/index.php/AM335x_Linux_Power_Management_User_Guide

    Therefore, it should not be possible to wake up from GPIO other than 0 to 31..

     regarding your questions:
    1) It should, but the behavior you describe seems strange, we are in the process on validating it on our hardware.
    2) We will do measurement on the time spent for wake up and share our observation with you. 

    We do not have any figures regarding power consumption in deepsleep mode or with only display off. You might need to considere a trade off between low power and fast wake up. We can probably talk a bit more about this once we have some figures to share with you.

    Regards

  • We did a trial of AM335x EVM Starter Kit using TI_Android_JB_4.2.2_DevKit_4.1.1.
    Please notice that with microusb connected, the system will not suspend, i.e. the CPU is still keep running but screen blank as see from the console:

    [  124.317932] pm_op(): platform_pm_suspend+0x0/0x6c returns -16
    [  124.317993] PM: Device musb-hdrc.0 failed to suspend: error -16

    With the microusb unplugged, the system will enter suspend and only SW3 hard key (GPIO0_30) will wake the system up. (Remember to disable "Stay awake" in Developer options too)
    <6>[  496.884735] PM: Syncing filesystems ... done.
    <7>[  496.890533] PM: Preparing system for mem sleep
    <4>[  496.895904] Freezing user space processes ... (elapsed 0.01 seconds) done.
    <4>[  496.916259] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
    <7>[  496.936065] PM: Entering mem sleep
    <4>[  496.936126] Suspending console(s) (use no_console_suspend to debug)
    <6>[  496.979797] PM: suspend of devices complete after 36.193 msecs
    <6>[  496.981933] PM: late suspend of devices complete after 2.044 msecs

    <6>[  607.742584] GFX domain entered low power state
    <6>[  607.742645] Successfully transitioned all domains to low power state
    <6>[  607.954742] PM: early resume of devices complete after 211.639 msecs
    <6>[  607.976470] android_work: sent uevent USB_STATE=DISCONNECTED
    <6>[  608.105957] android_work: did not send uevent (0 0   (null))
    <6>[  608.138793] android_work: sent uevent USB_STATE=CONNECTED
    <6>[  608.139862]  gadget: high-speed config #1: android
    <6>[  608.140045] android_work: sent uevent USB_STATE=CONFIGURED
    <6>[  608.170532] net eth0: CPSW phy found : id is : 0x4dd074
    <6>[  608.173187] net eth0: CPSW phy found : id is : 0x4dd074
    <6>[  608.176635] wakeup wake lock: event1-328
    <6>[  608.178802] PM: resume of devices complete after 223.552 msecs
    <7>[  608.260284] PM: Finishing wakeup.

    From the log, the wakeup total time (kernel + userspace) is around 500-700ms.
    For the power consumption for whole board @ 5V, we measured some figures here (all with usb/console detached):
    - AM335x_EVM_SK
      CPU Running (Screen on - brightness level 40%, in home screen) - 350mA
      CPU Running (Screen blank) - 255mA
      CPU Suspend - 48mA

    - AM335x_EVM
      CPU Running (Screen on - brightness level 40%, in home screen) - 978mA
      CPU Running (Screen blank) - 600mA
      CPU Suspend - 375mA
    But above figures can probably still be optimized.

    Regards