locked
HORM Question on WES7 RRS feed

  • Question

  • Hello folks,

    I have a WES7 image with EWF and HORM activated. The device that runs this image is located in an unattended environment. From time to time, I have to do updates to the image. After my updates are commited to the EWF protected partition, I proceed to create the hibernation file. The way I create the hibernation file is by using shutdown.exe with /h option. The issue is that the device is shut down by this and there is no one to power it back on. There is a switch /r for the shutdown.exe but it doesn't have any effect when used with /h switch. The question is how do I reboot the device after creating the hibernation file unattended. Are there other ways of creating the hibernation file other than using shutdown.exe?

    Your help is greatly appreciated.

    Thanks.

    Thursday, March 1, 2012 3:42 PM

All replies

  • If the device is connected to a network, a Wake-on-lan event could be triggered over the network to boot the system so long as the network card supports wake-on-lan.

    -Sean


    www.sjjmicro.com / www.seanliming.com / www.annabooks.com, Book Author - Pro Guide to WES 7, XP Embedded Advanced, Pro Guide to POS for .NET


    Saturday, March 10, 2012 5:12 AM
  • I'm interested in another solution to this as well.  Our software is updated in an attended environment, so we put up a screen that forces the user to press a button to initiate the hibernate after the software update (when the button is pushed, we call shutdown /h).  It instructs them to manually restart the system after the screen goes black, which is just a bad solution and a source of confusion for the user.

    I suppose we could use our hardware watchdog to trigger a hard reset like 30 seconds after the hibernate is initiated, but this could be unreliable if the hibernate takes longer than expected.


    Thursday, April 12, 2012 5:03 PM
  • In general, I tried to avoid HORM all together. There is no benifit to it. A WES7 cold boot is faster than a resume from hibernation. If you get rid of HORM, i think your solution becomes much simpler.

    -Sean


    www.sjjmicro.com / www.seanliming.com / www.annabooks.com, Book Author - Pro Guide to WES 7, XP Embedded Advanced, Pro Guide to POS for .NET

    Thursday, April 12, 2012 5:12 PM
  • I'd ditch HORM in an instant if I could, but it saved about 20 seconds vs. a cold boot for our hardware.  We're running a 1.8 GHz Atom D525 with 2 GB of RAM on an Intel SSD.  It was the only way we could meet our boot-time spec.  I think something could be wrong with our hardware/BIOS because it takes about a minute to cold-boot.


    Thursday, April 12, 2012 5:24 PM
  • Just heads up, I got this to work by creating a wake up task using Task Scheduler.  I used the Task Scheduler Managed Wrapper library from Codeplex  to create the task:

            /// <summary>
            /// Hibernates the system and automatically restarts
            /// after hibernation is complete. Intended use is for
            /// hibernating in order to capture HORM state in WES7.
            /// </summary>
            /// <author>Ben Schoepke</author>
            public static void Hibernate()
            {
                // Create a Windows Task Scheduler task that will automatically
                // resume the system from Hibernate after Hibernate is initiated.
                // Otherwise the user would have to manually power on the system after
                // hibernating.
                using (var taskService = new TaskService())
                {
                    var taskDefinition = taskService.NewTask();
                    taskDefinition.RegistrationInfo.Description = "Wakes system from hibernate";
    
                    // Want task to trigger once a short time after it is created.
                    var trigger = new RegistrationTrigger {Delay = TimeSpan.FromSeconds(15)};
                    taskDefinition.Triggers.Add(trigger);
    
                    // The task action cannot be null, but it doesn't need to actually do anything.
                    var action = new ExecAction("echo");
                    taskDefinition.Actions.Add(action);
    
                    // Very important: task must be allowed to wake the system.
                    taskDefinition.Settings.WakeToRun = true;
    
                    taskService.RootFolder.RegisterTaskDefinition(
                        Path: null, // path must be unique; task scheduler will generate a GUID if null is used as Path.
                        definition: taskDefinition
                        );
                }
    
                // Use the shutdown.exe app to initiate hibernation
                Process.Start(new ProcessStartInfo
                {
                    FileName = "shutdown",
                    Arguments = "/h",
                    UseShellExecute = false,
                    CreateNoWindow = true
                });
            }


    I think you also need to enable wake timers in your WES7 image for this to work.

    Control Panel > Power Options > Edit Plan Settings > Advanced power settings > Sleep > Allow wake timers = Enable.


    Friday, July 6, 2012 3:30 PM