How to Software Reboot/Reset Colibri iMX6 both on CE7 and WEC2013

How to Software Reboot/Reset Colibri iMX6?

The following code seems not working for Colibri iMX6 on CE7

SetSystemPowerState(IntPtr.Zero, POWER_STATE_RESET, 0);

I need code examples for software resetting Colibri iMX6 both on CE7 and WEC2013

Using OS 1.1 Beta 4

There is an issue in software reboot that has been partially solved in 1.1 release (we still have issue on a small number of instances when ethernet is connected).
The simplest way is to invoke KernelIoControl using IOCTL_HAL_REBOOT as argument.
Here you can find a sample:

Is this issue both on CE7 and WEC2013? Or this issue is related to Colibri iMX6 hardware?

Issue happens on both releases of the OS and on both Colibri and Apalis modules, even if it seems to be more frequent on Colibri.

Hi,

We use KernelIOControl from C# to reboot.

byte[] OutputBuffer = new byte[256];
Int32 OutputBufferSize, BytesReturned;
OutputBufferSize = OutputBuffer.Length;
BytesReturned = 0;

Int32 IOCTL_HAL_REBOOT = (Int32)CTL_CODE(FILE_DEVICE_HAL, 15, METHOD_BUFFERED, FILE_ANY_ACCESS);

IntPtr something = new IntPtr(0);
KernelIoControl(IOCTL_HAL_REBOOT, something, 0, OutputBuffer, OutputBufferSize, ref BytesReturned);