SetSystemPowerState fails when TCP connection active

  • Hello,


    I have a WebServer application running on WIndows CE and 1 browser connection open to the device (the browser runs javascript requesting a screenshot of the device screen)

    Then I have a timer to restart the device every day using SetSystemPowerState (Reset). You normally can use the option to force the powerstate change but I don't think it works on this device (iMX6).

    I see that most of the time this works and occasionally the device screen turns black and doesn't come back (it does not reboot). The application can hang on shutdown, but is it also possible that WinCE hangs (e.g. low level connections not purged)?

    How to force the soft reset?


    best regards

  • Hello,


    which product with IMX6 you are talking about? So i can check it in more detail.

    And which kernel version you are using?


    In NDCUCfg we use SetSystemPowerState(_T("reboot") but assume this will be mapped to the same action as "reset". Optional you can use KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL). Disadvantage is that this procedure does not wait for any driver action completed - but this may be the problem in case of not reboot!

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello,

    you are using the latest kernel?

    WEC7 or WEC2013?

    >> I didn't use SetSystemPowerState with the string as first param. I've used the enum.

    << Means in detail?

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello,

    sorry, unfortunatley i cannot invastigate/resolve this issue in short terms.

    Is posible to use a workaround in the meanwhile?

    - a) KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL).

    - b) Close alll Network ativities before reboot

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.