Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

RebootDevice(false) doesn't reenter Main

SPOT Hardware PowerState RebootDevice

  • Please log in to reply
6 replies to this topic

#1 Tobias Vandenbempt

Tobias Vandenbempt

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts
  • LocationGenth, Belgium

Posted 10 May 2014 - 11:16 AM

Hi guys, 

 

I tried to use the following statement on my Netduino Plus 2 today and it didn't enter the Program Main() function after restarting. You happen to know why this is? 

            Microsoft.SPOT.Hardware.PowerState.RebootDevice(false);

The False parameter is described as 'Soft', what does this imply? 

 

As usual, thanks in advance!

Tobias



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 May 2014 - 03:57 AM

Hi Tobias,

Netduino Plus 2 supports the more robust hard reboot (which completely resets the micro and restarts NETMF). The soft reboot feature was useful on older boards like Netduino 1 which couldn't re-enumerate after a hard reset.

Does RebootDevice(true) work for you?

Chris

#3 Tobias Vandenbempt

Tobias Vandenbempt

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts
  • LocationGenth, Belgium

Posted 13 May 2014 - 07:06 AM

Hi Tobias,

Netduino Plus 2 supports the more robust hard reboot (which completely resets the micro and restarts NETMF). The soft reboot feature was useful on older boards like Netduino 1 which couldn't re-enumerate after a hard reset.

Does RebootDevice(true) work for you?

Chris

I will try that when I get back home. But still wouldn't be logical if the soft reboot did work, would it?

But normal behavior would be that the Main method gets called after reboot?

 

Thanks, 

Tobias



#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 May 2014 - 09:30 PM

Hi Tobias,

The "soft reboot" is a bit tricky, since it requires that all peripheral drivers close down perfectly--including re-enumeration with USB. That should happen in theory...but when you're rebooting a board the "hard reboot" is a very simple and fairly foolproof reset.

Chris

#5 Tobias Vandenbempt

Tobias Vandenbempt

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts
  • LocationGenth, Belgium

Posted 24 May 2014 - 05:13 PM

While trying to simplify the main method for testing BMP085 and the above mentioned restart problem I've uploaded some code that continiously restarts the netduino causing me to not be able to upload new code. 

 

Error 1 An error has occurred: please check your hardware.

 

Last codeset:

        public static void Main()
        {
            Debug.Print("Welcome to Netduino");
            LedController.BlinkAllLights(3, 50);
            DateTimeController.UpdateInternalClock();
            SystemController.RestartNetduino();
            while (true)
            {
                Tick(null);
                Thread.Sleep(1000 * 60 * 1); //sleep 1 minutes
            }
        }

Each time I press Start in my solution it blinks the lights and gives me the error message when "Preparing to deploy assemblies to the device. " and then displaying "Deploy failed".

 

Positive thing in this situation is the proof that the restart function does something at least. 

 

(The tick method is empty.)

 

Hope it's fixable, 

Tobias



#6 Tobias Vandenbempt

Tobias Vandenbempt

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts
  • LocationGenth, Belgium

Posted 24 May 2014 - 05:21 PM

Fieuw, fixed it. I reconnected USB, like I tried before, but this time I disconnected the LAN Cable causing the DateTimeController to timeout which gave Visual Studio enough time to upload the new assemblies which solved my problem.

Good thing that DateTimeController line was still in there.



#7 Tobias Vandenbempt

Tobias Vandenbempt

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts
  • LocationGenth, Belgium

Posted 24 May 2014 - 05:24 PM

Concerning the post topic, I think the Netduino Reboot does work, it just loses the connection with visual studio which doesn't display any more log lines in the debug window. Which, when I think of it, is perfectly logical. 







Also tagged with one or more of these keywords: SPOT, Hardware, PowerState, RebootDevice

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.