0

Using two external field-effect transistors and a couple of resistors it is possible to have 1 or 2 buttons for a Power ON/OFF logic.

(see https://www.mikrocontroller.net/topic/333969#3659055)

Now I have the following:

  1. After a power cycle the system will autoboot into Linux
  2. Pressing the Shutdown button or calling halt will enter halt mode
  3. Pressing the Power button (in halt mode only) will boot the system into Linux

So this is almost what I wanted to get.

Is it possible to configure the bootloader in a way that the system will not autoboot into Linux but entering halt mode? This way it would be explicitly required to power on using the Power button.

2

No, it's not possible with the stock bootloader code that's on the boot partition. This code is designed to load and boot an OS kernel, so it has no intermediate halt to the best of my knowledge.

You would probably need to modify the bootcode.bin file which is an opaque blob, as it forms the Raspberry Pi's closed "firmware".

  • Might it be possible then to build a single Instruction "os kernel" which will just call halt? – Sven Geggus Jun 9 '17 at 14:23
  • 1
    You will then require a staged boot, in order to continue into the real kernel boot. Basically, you could modify the start of Linux kernel to contain an idle loop, but then the hardware system would already be in power up idle mode with onky the CPU halted and waiting for GPIO. You would need to modify and build your own kernel. Wouldn't it be better to have dedicated switch hardware? But then, how do you differentiate a cold boot from a power-on reboot due to power loss? I don't see how to differentiate, so you may probably go with autostart on power on anyway. – TheDiveO Jun 9 '17 at 14:28
  • After building my own Power-logic on a breadboard, I figured, that there is the £6 OnOff SHIM from Pimoroni which does exactly what I needed. – Sven Geggus Dec 10 '17 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.