Dual boot
Chris Hall (132) 3558 posts |
Is it possible to dual boot a Raspberry Pi without dedicating a GPIO pin for that purpose? Using this circuit, pressing the ‘reset’ button momentarily will cause the Pi to reboot with GP5 detected high. Pressing the reset button and holding it for 5s will cause the Pi to reboot with GP5 detected low. Using GPIO 5 either as an input or an output for whatever purpose (and setting it to pull low) is also OK as the GP5 signal does not cause a reset due to the relatively high impedance of 22k, low enough to pull GP5 low (the pull up is about 60k) but high enough so that the reset line cannot ‘see’ the signal on GP5. In config.txt you can put something like:
so that it boots into RISC OS 5.28 normally but boots into RISC OS 5.29 if you hold the reset button for 5s. |
John WILLIAMS (8368) 495 posts |
Ingenious! Now you’ve got people thinking, I’ll just mention that I bought a little hardware solution which provides 2 SD sockets switchable with a slide switch which replaces the existing card slot. Pi Hut and others. Haven’t used it yet! But then, I haven’t got around to fitting my reset buttons yet either. |
Erich Kraehenbuehl (1634) 181 posts |
This dual SD-card switch WAS nice. So that is obsolete. It is working only from Pi1 to Pi3 (I know, because i got tons of this devices. An tried it ) |
John WILLIAMS (8368) 495 posts |
Very useful to know! |
Chris Hall (132) 3558 posts |
On some models of Pi, you have to increase the value of C1 to 680nF. It then works on Pi0, Pi1, Pi2, Pi3 and Pi4. Pre-2012 the Pi1 did not have a RUN header. So that is obsolete. Refuted. The circuitry on different models of Pi for the ‘RUN’ signal differs: Pi Zero is as shown (just 10k pull up to 3.3V) Pi models 2B and 3B have a pull up from a resistor divider chain from 5V through a series resistor to a 100n capacitor to ground. Pi models 3A+ and 3B+ have a 470R series resistor and a 100n capacitor to ground as well as a 10k pull up resistor. Pi model 4B has a 10k pull up to 3.3V, a 100n capacitor to ground and a 100R series resistor. |
Erich Kraehenbuehl (1634) 181 posts |
On Pi4/400 it begins to boot, but stops with read errors at diferent stages of booting. All other Pis are working. |
Erich Kraehenbuehl (1634) 181 posts |
Btw, there is no capacitor on the board, only 402 size resistors.? |
Chris Hall (132) 3558 posts |
I don’t understand your comments. I have tested it on the Pi 4 and it works. There are many capacitors on the Pi 4 circuit board. The bit of circuitry on the Pi 4 PCB relevant to the reset header is shown below – I had shown the simpler circuit on the Pi Zero – just a single 10k resistor to 3.3V (inside the dotted line marked ‘Pi’). Connecting pin 2 to pin 3 on J2 resets the Pi and it starts up when you remove the connection. My method provides a short pulse (about 1ms with 100nF and about 6ms with 680nF) on the reset line but a low signal on GP5 for as long as you hold down the push button. Five seconds should be enough for the GPIO line GP5 to be seen low in CONFIG.TXT. The presence of C118 (100nF) on the Pi 4 means that the pulse may not be powerful enough to reset the Pi when using a 100nF for C1 but increasing C1 to 680nF gave it enough oomph. My original test was on a Pi3B and 100nF was enough. On a Pi Zero I needed a little more oomph and 680nF works on all models. Adding a small capacitor and a 22k resistor on an external circuit board, connected to ‘RUN’ on J2 and to ‘GND’ and ‘GP5’ on the 40 pin header should have no effect on SDFS or on the reading of the firmware. |
Erich Kraehenbuehl (1634) 181 posts |
@Chris Hall: I was speaking about the mentioned |