Howto restart WinCE?

  • Hello,


    is there a possibility to restart WinCE after finished a program?
    Or can I after finish a program start it again automatically?


    Example:
    I have my main program started by autostart. I can finish it by network. But it should start after finish again. Is there a possibility?


    Thanks a lot in advance...


    Kaiser

  • Hello,


    a) you may handle the watchdog from your program and reboot by get WM_COSE or an other "error".


    b) call "KernelIoControl(IOCTL_HAL_REBOOT,NULL,0,NULL,0,NULL);" or "ndcucfg.exe" command "reboot harddware" by get WM_CLOSE.


    Is it necessary that you can terminate your program by network?

    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!


    No, the termination by network is optional.
    Application can also be finished by a button.
    May network shutdown cause problems?
    In most cases software and system ist shutdown by power off.



    Kaiser

  • Hello,


    unfortunately both suggestions doesn't work:
    call of

    Code
    1. KernelIoControl(IOCTL_HAL_REBOOT,NULL,0,NULL,0,NULL);


    causes

    Code
    1. D:\Development\Prototyp\Pharmafalzer\GuiUhlmann\Gui.cpp(130) : error C2065: 'KernelIoControl' : undeclared identifier
    2. D:\Development\Prototyp\Pharmafalzer\GuiUhlmann\Gui.cpp(130) : error C2065: 'IOCTL_HAL_REBOOT' : undeclared identifier


    both includes are used:

    C
    1. #include "kfuncs.h"
    2. #include "Winbase.h"



    Call of

    Code
    1. "ndcucfg.exe" command "reboot hardware"


    results in

    Code
    1. ERROR 100: Syntax error


    Any suggestions?


    Thanks a lot - Kaiser

  • Hello,


    ok "ndcucfg" with "reboot hardware" may not work on NetDCU3, try:



    Code
    1. #define IOCTL_HAL_REBOOT 0x101003C
    2. extern "C" BOOL KernelIoControl(DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD);
    3. main()
    4. {
    5. KernelIoControl(IOCTL_HAL_REBOOT,NULL,0,NULL,0,NULL);
    6. }

    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,


    I've mplemented the same code on NetDCU6 as on NetDCU3 but on NetDCU6 after restart the screen stays black and nothing happens.
    Do I have something to change for NetDCU6?
    On NetDCU3 it worked fine!


    Code
    1. #define IOCTL_HAL_REBOOT 0x101003C
    2. extern "C" BOOL KernelIoControl(DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD);
    3. main()
    4. {
    5. KernelIoControl(IOCTL_HAL_REBOOT,NULL,0,NULL,0,NULL);
    6. }


    Thanks a lot


    Andy[/code]

  • Hello again,


    have found some more details:
    1) the same behaviour is detected with ndcucfg and "reboot hardware".
    2) This happens either on kernel V1.12 (with DCOM) and on latest kernel V1.31 (without DCOM).
    3) Following output on serial debug after "reboot hardware" call:


    another output:


    Hope this helps?



    Andy

  • Hello,


    try following:
    1. erase registry
    2. reset to factory settings in the bootloader by using command "C"
    3. do install the new kernel

    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,


    for the "first step" do also use the bootloader. There it is always possible to erase registry.

    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.

  • well i was a little bit wrong.
    system is shut down and boots again, only autostart of my app wont work?!
    wenn i restart the system bei removing power autostart (in registry) works fine...
    its the same whether i use KernelIO or ndcucfg...
    does someone knows what to do?


    cu andreas

  • Strange, the link still works perfectly for me. Are you sure that it does not bring you to another thread of the forum?


    H. Keller

    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 again,


    now it works - but only when I press on the second link directly (...php?t=821)!
    When I press your link (here click), then I will be linked to index page as before.



    Regards, Kaiser