none
Power Management suspend timeout issue RRS feed

  • Question

  • Hi all,

    I have a strange issue that I hope someone can help me with. I am attempting to get the SuspendTimeout to work on my iMX25 device using WinCE6 R3. I am using the default full power management catalog item and the only modification to the power routines I have made is to set the following registry values:

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\Timeouts]
        "ACUserIdle"=dword:3C       ; in seconds
        "ACSystemIdle"=dword:3C   ; in seconds
        "ACSuspend"=dword:3C       ; in seconds
        "BattUserIdle"=dword:3C      ; in seconds (60 secs)
        "BattSystemIdle"=dword:3C  ; in seconds (60 secs)
        "BattSuspend"=dword:3C      ; in seconds (60 secs)

    [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\State\UserIdle]
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\State\UserIdle]
        "Default"=dword:0               ; D0
        "Flags"=dword:1000000       ; POWER_STATE_USERIDLE

    ; Leave the LCD on during SystemIdle
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\State\SystemIdle\{EB91C7C9-8BF6-4a2d-9AB8-69724EED97D1}]
        "Default"=dword:0           ; D0

    From the above setttings I am attempting to keep all the devices active in UserIdle, then leave the screen on but at a reduced backlight setting during SystemIdle but also power down the other components.

    From my observations everything except the suspend timeout is working. After 1 minute the device enters UserIdle, 1 minute from that the device enters SystemIdle and the display dims, but the system never enters suspend. I have tried this with the device in a dock (on AC) and running off the battery with the values specified above in [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\Timeouts].

    I enabled USB Serial KITL and started to debug the image in PB, after 1 minute the device entered UserIdle, 1 minute more the device entered SystemIdle and then 1 minute later the device entered suspend!?!? But would not wake from the power button. I removed the USB driver from the build as when USB KITL is active I receive messages in the log that the USB FN driver won't run as KITL is enabled on the port, but the device still wont enter suspend from the timers, but is happy to enter the other states, unless I connect KITL to PB.

    The only other thing I can add is that my BSP doesn't seem to support USB Serial KITL in interrupt mode (the source only supported interrupts on USB RNDIS KITL) and I have to run it in polling mode as RNDIS doesn't work with CE6 - could that point to an interrupt keeping the system awake? But if I remove the USB driver from the image the interrupt shouldn't be going off to cause the issue...

    Any help or ideas would be appreciated.

    Cheers,

    Barak

    Tuesday, September 7, 2010 8:32 AM

All replies

  • Sounds like 2 things could be the cause:
     
    1. You forgot to put ;HIVE BOOT SECTION tags around the timeout
    settings: The power manager loads in phase 0 and reads the timeout
    values at that time, so these settings need to be in the boot hive.
     
    2. Something is active and trips the system idle timer, preventing the
    system to go into suspend. The combination with USB might indicate
    ActiveSync is active? That would prevent the device from going into suspend.
     
    It's quite easy to copy the interrupt code from the RNDIS driver to the
    USB serial driver so that the USB serial driver can make use of interrupts.
     
    Are you sure you've configured the power button driver correctly to use
    the correct GPIO? The GPIO has to be a wakesource of course.
     

    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: http://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.
    Tuesday, September 7, 2010 9:43 AM
    Moderator
  • 1. I had actually put ;HIVE BOOT SECTION flags around it as I had read the following article about power manager timeouts and hive registries:

    http://e-consystems.com/blog/tag/windows-ce-power-manager/

    And have implemented the reload of the activity timers when my powerbutton driver starts in my OS design.

    2 It seems that something does trip the timers but I'm not sure how to go about debugging it. In release mode the device only enters the suspend state when Activesync is ACTIVE or I am using KITL!? I was copying an application to the device via activesync and the unit switched off mid-transfer. If I remove the USB cable it never enters the suspend state but does get to SystemIdle. I just removed KITL from the release build and the device went into suspend on time... Arrgghhhh!!! Must be something to do with the USB driver and KITL conflicting or something. Maybe it's a non-issue as it works in Release - but it would be nice to be able to test all this stuff with KITL etc in case I need to debug something.

    I can suspend/resume using the power button correctly, and it is configured as a wake source.

    3. The way Freescale allocate the interrupts for USB conflict with KITL - the public source for KITL only allocates 1 interrupt buffer to request the interrupt but as we are using the USB OTG port for the USBFN connection the interrupt setup source requires a count of at least 2 and will fail:

    case CSP_BASE_REG_PA_USB: // USB RNDIS<br/>
    // Check if output array can hold all IRQs
          if (*pCount >= 2)
          {
            *pIrqs = IRQ_USB_HOST;
            *(pIrqs + 1) = IRQ_USB_OTG;
            *pCount = 2;
            rc = TRUE;
          }
          break;
    
    But *pCount will be 1 from KitlInit. I added the following for the handling the USB serial interrupt as the USB serial address is defined as USB +1

    case (CSP_BASE_REG_PA_USB+0x1): // USB Serial
          pIrqs[0] = IRQ_USB_OTG;
          *pCount = 1;
          rc = TRUE;
          break;
    
    But then the system hangs when kitl goes to enable the interrupt. If I attempt to use USB RNDIS it fails with *pCount = 1 and I am back to polling mode.

    Friday, September 24, 2010 7:09 AM
  • can you check the following :-

    To over write earlier settings in common.reg follow this

    [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\Timeouts]
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\Timeouts]

     

    Make sure you have configured for system ideal with proper power state.

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\State\SystemIdle]
        "Default"=dword:2           ; D2
        "Flags"=dword:0             ;

     

    Thanks

    Misbah

    Friday, September 24, 2010 10:40 AM