siriusfox
Posts: 8
Joined: Sat Nov 26, 2011 6:15 am

Re: Details of board power, startup and shutdown

Sun Dec 04, 2011 12:34 am

As I understand it, the Raspberry Pi (at least currently) does not have any pins controlling the power to the main board like most generic PC motherboards. As such, I assume when power is applied to the board, the system starts to boot immediately if possible.

If this is the case, how does the system respond to a shutdown or restart request? Does it halt and need to have power cycled manually, does every shutdown become a restart, does it ignore the request?

bradburts
Posts: 341
Joined: Sun Oct 02, 2011 7:07 am

Re: Details of board power, startup and shutdown

Sun Dec 04, 2011 1:15 am

Thats an interesting question.
The PI will be powered by USB plug and so there is no ATX style on/of button.
I would guess that the SoC is meant to be embedded and so on/off is by the wall, its also low power and \'off\' happens whenever idle.
Guess you would have to add a button to a GPIO pin to perform an orderly shutdown or \"sudo shutdown -h now\".
Would like to add: Is orderly shutdown needed or is this flavour of Linux power-fail safe?

siriusfox
Posts: 8
Joined: Sat Nov 26, 2011 6:15 am

Re: Details of board power, startup and shutdown

Sun Dec 04, 2011 1:39 am

But how would the CPU even respond? If the on/off state is based upon applied power, what would the hardware even do if the software tried to send a shutdown signal?

nullstring
Posts: 178
Joined: Sun Oct 02, 2011 3:05 pm

Re: Details of board power, startup and shutdown

Sun Dec 04, 2011 3:48 am

My understanding is that the CPU will halt and the rest of the hardware will likely remain on.

I\'ve been thinking/working on a circuit that would allow you to use a simple power button like on a cell phone. An ATtiny or maybe just some latches would control a relay that would turn the device on or off.

You would press the power button which would switch on the relay and start up the device.

When the device is shutdown, at the last step, it would signal to the circuit that is ready to be shutdown. I assume that there is a way to do this since ATX does this. At this point the relay would switch off and therefore completely power-down the device.

attiatte
Posts: 18
Joined: Sat Nov 12, 2011 6:07 pm
Contact: Website

Re: Details of board power, startup and shutdown

Sun Dec 04, 2011 4:40 am

[quote]Quote from siriusfox on December 4, 2011, 01:39
But how would the CPU even respond? If the on/off state is based upon applied power, what would the hardware even do if the software tried to send a shutdown signal?[/quote]

I may be completely wrong with this, but it should be able to respond to an interrupt. This is how TI-83\'s and some other calculators work - they never really shut off, \"Off\" is it running a HaLT until it receives an interrupt. It uses power, but it\'s an insignificant amount.

attiatte
Posts: 18
Joined: Sat Nov 12, 2011 6:07 pm
Contact: Website

Re: Details of board power, startup and shutdown

Sun Dec 04, 2011 5:34 am

For a more detailed look at power management, check the PDF detailing the processor on the wiki.
Sector 10.2 details several power modes - Run, Standby, Shutdown, and Dormant.

Shutdown: [quote]Shutdown mode has the entire device powered down, and you must externally save all state, including cache and TCM state. The processor is returned to Run mode by the assertion of Reset. The state saving must be performed with interrupts disabled, and finish with a Data Synchronization Barrier operation. When all the state of the processor is saved the processor must execute a Wait For Interrupt operation. The signal STANDBYWFI is asserted to indicate that the processor can enter Shutdown mode[/quote]

Return to “General discussion”