andrew700andrew
Posts: 62
Joined: Thu Dec 19, 2013 10:26 pm

What happens to GPIO when Raspberry pi crashes?

Sat Feb 07, 2015 8:28 am

Hi, I'm going to be using the GPIO pin of my raspberry pi with either a BJT or MOSFET transistor to control a critical circuit. However, I'm worried that if the raspberry pi freezes or crashes it might affect the external circuit. In this case, will the GPIO pin remain at it's previous value, return to being ground or something in between (hopefully not the last one)?
Thanks.

User avatar
aTao
Posts: 1093
Joined: Wed Dec 12, 2012 10:41 am
Location: Howlin Eigg

Re: What happens to GPIO when Raspberry pi crashes?

Sat Feb 07, 2015 9:10 am

The GPIO output and control circuits are latched, so unless something very unlikely happens during the crash then the output will freeze. If the crash occurs during the GPIO operation then the pin could be in any of its normal states, in, out high, out low, pullup or pulldown.
>)))'><'(((<

User avatar
solar3000
Posts: 1051
Joined: Sat May 18, 2013 12:14 am

Re: What happens to GPIO when Raspberry pi crashes?

Sat Feb 07, 2015 12:06 pm

I'll second that.
I built an LED clock with pi B.
I simply forgot about the running device when one day it froze. I've neglected it. I would just reboot it everytime it freezes. The output stays the same even when my GPIO program had not been started. Its been a year that I haven't run my script and the output remained the same.
Antikythera

User avatar
davidcoton
Posts: 5026
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: What happens to GPIO when Raspberry pi crashes?

Sat Feb 07, 2015 5:08 pm

If it matters what happens when the Pi crashes, you need a hardware watchdog that will externally force the outputs to a known state -- for example, if using relay outputs remove the coil drive supply so the replays are de-energised whatever the Pi says.

In some cases (such as access control) it is difficult to arrange a safe mode -- doors must be available for emergency exit, but kept secure. Tricky.

In any case a Pi is probably not the appropriate controller for systems that could cause injury if the Pi outputs go bananas.
Signature retired

Return to “General discussion”