Discussion:
Programmatically reset the board
(too old to reply)
SteM
2010-04-27 09:36:07 UTC
Permalink
Hi all,
i need to reset the board from my application.
I tried with:
KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);
but nothin happens.
Do i need something else ???
----
SteM
Bill T
2010-04-27 12:11:01 UTC
Permalink
It depends. What version of CE are you using and are you building your image
or using one provided by the hardware vendor?
Post by SteM
Hi all,
i need to reset the board from my application.
KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);
but nothin happens.
Do i need something else ???
----
SteM
SteM
2010-04-27 12:46:11 UTC
Permalink
I'm using WinCE6.00 R2.
I'm compiling my own image but it is cloned from the Freescale one.
I checked into the _SOCDIR folder and i found a file called reboot.c and it
contains a function named OALIoctlHalReboot that should be the
IOCTL_HAL_REBOOT handler ...
--
SteM
Post by Bill T
It depends. What version of CE are you using and are you building your image
or using one provided by the hardware vendor?
Post by SteM
Hi all,
i need to reset the board from my application.
KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);
but nothin happens.
Do i need something else ???
----
SteM
Bruce Eitman [eMVP]
2010-04-27 12:53:13 UTC
Permalink
Assuming that you have the correct definition for IOCTL_HAL_REBOOT, that is
all your application needs. Well other than checking the return value and
maybe calling GetLastError().

That suggests that the problem is in your kernel, you may want to take this
to the Platform Builder newsgroup where others using the Freescale BSP may
be able to offer assistance.
--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT Eurotech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

Eurotech Inc.
www.Eurotech.com
Post by SteM
I'm using WinCE6.00 R2.
I'm compiling my own image but it is cloned from the Freescale one.
I checked into the _SOCDIR folder and i found a file called reboot.c and it
contains a function named OALIoctlHalReboot that should be the
IOCTL_HAL_REBOOT handler ...
--
SteM
Post by Bill T
It depends. What version of CE are you using and are you building your
image
Post by Bill T
or using one provided by the hardware vendor?
Post by SteM
Hi all,
i need to reset the board from my application.
KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);
but nothin happens.
Do i need something else ???
----
SteM
Bill T
2010-04-27 13:51:01 UTC
Permalink
Check to see if your BSP has a oalioctl.cpp file or similar and if the
IOControl() function passes the IOCTL_HAL_REBOOT ioctl through.
Post by SteM
I'm using WinCE6.00 R2.
I'm compiling my own image but it is cloned from the Freescale one.
I checked into the _SOCDIR folder and i found a file called reboot.c and it
contains a function named OALIoctlHalReboot that should be the
IOCTL_HAL_REBOOT handler ...
--
SteM
Post by Bill T
It depends. What version of CE are you using and are you building your
image
Post by Bill T
or using one provided by the hardware vendor?
Post by SteM
Hi all,
i need to reset the board from my application.
KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);
but nothin happens.
Do i need something else ???
----
SteM
.
SteM
2010-04-27 14:14:00 UTC
Permalink
No, my BSP doesn't have the file .. but none of the BSP i have (under
PLATFORM) have it !!

KernelIoControl always return 0.

I'm trying with SetSystemPowerState(...) but the only thing i see is the
WinCE Sync item on the DeviceManager that disappear.
The screen (nad the board) is not resetting.
--
SteM
Post by Bill T
Check to see if your BSP has a oalioctl.cpp file or similar and if the
IOControl() function passes the IOCTL_HAL_REBOOT ioctl through.
Post by SteM
I'm using WinCE6.00 R2.
I'm compiling my own image but it is cloned from the Freescale one.
I checked into the _SOCDIR folder and i found a file called reboot.c and it
contains a function named OALIoctlHalReboot that should be the
IOCTL_HAL_REBOOT handler ...
--
SteM
Post by Bill T
It depends. What version of CE are you using and are you building your
image
Post by Bill T
or using one provided by the hardware vendor?
Post by SteM
Hi all,
i need to reset the board from my application.
KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);
but nothin happens.
Do i need something else ???
----
SteM
.
SteM
2010-04-28 09:55:36 UTC
Permalink
Other tests: i compiled a debug version of the OS.

If i call:
SetSystemPowerState (NULL, POWER_STATE_RESET, 0 );
in Release mode i see nothing but in Debug i got a crash the following debug
output:

135325 PID:400002 TID:3b00012 FS: Got Power notif 0x00000002
135336 PID:400002 TID:3b00012 FSREG: Flushing registry
135336 PID:400002 TID:3b00012 FSRAM: Flushing cached file data
135336 PID:400002 TID:3b00012 Powering Off system:
135336 PID:400002 TID:3b00012 Calling GWES power proc.
135336 PID:400002 TID:3b00012 Calling device manager power proc.
135336 PID:400002 TID:3b00012 Calling OEMPowerOff...

The crash is into the function OALI2cEnable ?!?!?!?

If i call
ret = KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);

57895 PID:3a90012 TID:3ab0012 rebooting... ...
57895 PID:3a90012 TID:3ab0012 KernelIoControl returns 0
and nothing happens and the application stays there ...
Then i'm not so sure that the code in the OAL is compiled in the image.
--
SteM
Post by SteM
No, my BSP doesn't have the file .. but none of the BSP i have (under
PLATFORM) have it !!
KernelIoControl always return 0.
I'm trying with SetSystemPowerState(...) but the only thing i see is the
WinCE Sync item on the DeviceManager that disappear.
The screen (nad the board) is not resetting.
--
SteM
Post by Bill T
Check to see if your BSP has a oalioctl.cpp file or similar and if the
IOControl() function passes the IOCTL_HAL_REBOOT ioctl through.
Post by SteM
I'm using WinCE6.00 R2.
I'm compiling my own image but it is cloned from the Freescale one.
I checked into the _SOCDIR folder and i found a file called reboot.c
and
Post by SteM
it
Post by Bill T
Post by SteM
contains a function named OALIoctlHalReboot that should be the
IOCTL_HAL_REBOOT handler ...
--
SteM
Post by Bill T
It depends. What version of CE are you using and are you building
your
Post by Bill T
Post by SteM
image
Post by Bill T
or using one provided by the hardware vendor?
Post by SteM
Hi all,
i need to reset the board from my application.
KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);
but nothin happens.
Do i need something else ???
----
SteM
.
karthikkubendiran
2010-04-28 12:27:22 UTC
Permalink
Include the below lines for hardware reset.

__asm
{
cli ; Disable Interrupts.
mov al, 0FEh ; Reset CPU.
out 064h, al ;
jmp near $ ; Should not get here.
}

It will reboot the board immediately without any calls to power manager,
other drivers etc.
So take care.

--
Karthik Kubendiran
SteM
2010-04-28 14:06:42 UTC
Permalink
Mine is an ARM micro, not an x86, i guess this is a x86 code ...
--
SteM
Post by karthikkubendiran
Include the below lines for hardware reset.
__asm
{
cli ; Disable Interrupts.
mov al, 0FEh ; Reset CPU.
out 064h, al ;
jmp near $ ; Should not get here.
}
It will reboot the board immediately without any calls to power manager,
other drivers etc.
So take care.
--
Karthik Kubendiran
Paul G. Tobey [eMVP]
2010-04-28 16:57:01 UTC
Permalink
Yes, that's x86. The take-away from this is that YOUR BSP is responsible for
implementing any sort of board reset that it might have. No implementation
in the BSP for doing a reset ==> no reset for your calls. The method of
achieving the reset is entirely dependent on the hardware, YOUR HARDWARE. We
can tell you that the BSP needs to implement IOCTL_HAL_REBOOT, but we can't
tell you where your BSP might try to do that. It could be in any file in
your BSP...

Paul T.
Post by SteM
Mine is an ARM micro, not an x86, i guess this is a x86 code ...
--
SteM
Post by karthikkubendiran
Include the below lines for hardware reset.
__asm
{
cli ; Disable Interrupts.
mov al, 0FEh ; Reset CPU.
out 064h, al ;
jmp near $ ; Should not get here.
}
It will reboot the board immediately without any calls to power manager,
other drivers etc.
So take care.
--
Karthik Kubendiran
.
Bruce Eitman [eMVP]
2010-04-28 20:38:44 UTC
Permalink
Post by Paul G. Tobey [eMVP]
can tell you that the BSP needs to implement IOCTL_HAL_REBOOT, but we can't
tell you where your BSP might try to do that. It could be in any file in
your BSP...
Or not at all.
--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT Eurotech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

Eurotech Inc.
www.Eurotech.com
Post by Paul G. Tobey [eMVP]
Yes, that's x86. The take-away from this is that YOUR BSP is responsible for
implementing any sort of board reset that it might have. No
implementation
in the BSP for doing a reset ==> no reset for your calls. The method of
achieving the reset is entirely dependent on the hardware, YOUR HARDWARE.
We
can tell you that the BSP needs to implement IOCTL_HAL_REBOOT, but we can't
tell you where your BSP might try to do that. It could be in any file in
your BSP...
Paul T.
Post by SteM
Mine is an ARM micro, not an x86, i guess this is a x86 code ...
--
SteM
Post by karthikkubendiran
Include the below lines for hardware reset.
__asm
{
cli ; Disable Interrupts.
mov al, 0FEh ; Reset CPU.
out 064h, al ;
jmp near $ ; Should not get here.
}
It will reboot the board immediately without any calls to power manager,
other drivers etc.
So take care.
--
Karthik Kubendiran
.
Loading...