User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2848
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Pi B+ won't shutdown? Tying pin 28 to GND seems to solve it

Fri Jul 18, 2014 4:31 pm

Having done my "all the ports" GPIO test today, I found something strange happening on my B+.

I have all the ports wired up to leds powered with 5V through Darlington array chips. Here's what it looks like http://youtu.be/03_WJsGqDs0

When I shutdown with sudo halt, it shuts down normally, but as soon as my hand or wireless keyboard goes anywhere near the wires, the Pi comes back up again.

Just curious. Is there a GPIO port that's activated to bring the Pi back up aside from the RUN header? Otherwise wondering why this is happening. It's repeatable so could get video evidence if needed.

I'm sure if I pull all the wires off it'll stop, but it's curious. :lol:
Last edited by alexeames on Sat Jul 19, 2014 11:35 am, edited 2 times in total.
Alex Eames RasPi.TV, RasP.iO

User avatar
ukscone
Forum Moderator
Forum Moderator
Posts: 4103
Joined: Fri Jul 29, 2011 2:51 pm
Contact: Website

Re: Pi B+ won't shutdown. Which Port brings it back up?

Fri Jul 18, 2014 4:34 pm

anything plugged into the USB that could be supplying power? I seem to recall one of the James's saying that you can't back power unless it's been boot strapped from the mucro usb so maybe it's something related to that

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2848
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Pi B+ won't shutdown. Which Port brings it back up?

Fri Jul 18, 2014 4:41 pm

I have Edimax wifi dongle, kbd dongle and a Memory stick plugged in, none of which provides power, so no. Not really. The LED power comes from the Pi itself, but that's isolated from the Pi by Darlington array chips. I'm figuring it must be floating ports, one of which, when triggered brings the Pi back up.

It doesn't always happen immediately, which kind of supports that theory too.
Alex Eames RasPi.TV, RasP.iO

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2848
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Pi B+ won't shutdown. Which Port brings it back up?

Fri Jul 18, 2014 5:33 pm

Pulling out the wifi dongle and the USB memory stick makes a difference.

Now when I sudo halt, I still get 10 LED flashes on port 16, then, about half a second later, port 14 lights and stays lit and the Pi boots. I don't need to do anything. It just happens.
Alex Eames RasPi.TV, RasP.iO

PiGraham
Posts: 3567
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Pi B+ won't shutdown. Which Port brings it back up?

Fri Jul 18, 2014 5:41 pm

alexeames wrote:Pulling out the wifi dongle and the USB memory stick makes a difference.

Now when I sudo halt, I still get 10 LED flashes on port 16, then, about half a second later, port 14 lights and stays lit and the Pi boots. I don't need to do anything. It just happens.
So, when you remove the USB peripherals, leaving only your keyboard dongle, the Pi restarts every time after a halt?

The two possibilities that occur to me are:
1. Something slugs the power rail as it shuts down, triggering the reset circuit.
2. Some noise during shut-down couples to the RUN (reset) lines causing a reset.

Do you have anything connected to the RUN pins?

I haven;t noticed my my B+ doing this.

Does it still happen if you remove the keyboard dongle and do the halt via USB keyboard or SSH?

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Pi B+ won't shutdown. Which Port brings it back up?

Fri Jul 18, 2014 5:42 pm

One of my Bs has started to do the same. sudo halt or poweroff results in a reboot. Only way to shut it down is pull the plug.

Details:

Code: Select all

[email protected] ~ $ uname -a
Linux sandford 3.12.24+ #694 PREEMPT Tue Jul 15 17:34:35 BST 2014 armv6l GNU/Linux
[email protected] ~ $

PiGraham
Posts: 3567
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Pi B+ won't shutdown. Which Port brings it back up?

Fri Jul 18, 2014 6:05 pm

asandford wrote:One of my Bs has started to do the same. sudo halt or poweroff results in a reboot. Only way to shut it down is pull the plug.

Details:

Code: Select all

[email protected] ~ $ uname -a
Linux sandford 3.12.24+ #694 PREEMPT Tue Jul 15 17:34:35 BST 2014 armv6l GNU/Linux
[email protected] ~ $
Interesting. A B, not a B+?
What do you have attached to it?

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2848
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Pi B+ won't shutdown. Which Port brings it back up?

Fri Jul 18, 2014 6:12 pm

PiGraham wrote:
So, when you remove the USB peripherals, leaving only your keyboard dongle, the Pi restarts every time after a halt?
Yep. Exactly that.
PiGraham wrote: The two possibilities that occur to me are:
1. Something slugs the power rail as it shuts down, triggering the reset circuit.
2. Some noise during shut-down couples to the RUN (reset) lines causing a reset.

Do you have anything connected to the RUN pins?
No
PiGraham wrote: Does it still happen if you remove the keyboard dongle and do the halt via USB keyboard or SSH?
Don't have a USB keyboard over here. Will plug the wifi dongle back in a try by ssh. Shutting it down by SSH with no keyboard dongle seems stable. I've grabbed the bunch of GPIO connected wires and it still doesn't restart. Some kind of interaction with the keyboard dongle then?
Alex Eames RasPi.TV, RasP.iO

asandford
Posts: 1997
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Pi B+ won't shutdown. Which Port brings it back up?

Fri Jul 18, 2014 6:13 pm

PiGraham wrote:What do you have attached to it?
Nothing on GPIO, just a (powered) HDD on USB (no hub):

Code: Select all

[email protected] ~ $ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 0bc2:3320 Seagate RSS LLC
[email protected] ~ $

User avatar
ukscone
Forum Moderator
Forum Moderator
Posts: 4103
Joined: Fri Jul 29, 2011 2:51 pm
Contact: Website

Re: Pi B+ won't shutdown. Which Port brings it back up?

Fri Jul 18, 2014 6:29 pm

alexeames wrote:
PiGraham wrote:
So, when you remove the USB peripherals, leaving only your keyboard dongle, the Pi restarts every time after a halt?
Yep. Exactly that.
PiGraham wrote: The two possibilities that occur to me are:
1. Something slugs the power rail as it shuts down, triggering the reset circuit.
2. Some noise during shut-down couples to the RUN (reset) lines causing a reset.

Do you have anything connected to the RUN pins?
No
PiGraham wrote: Does it still happen if you remove the keyboard dongle and do the halt via USB keyboard or SSH?
Don't have a USB keyboard over here. Will plug the wifi dongle back in a try by ssh. Shutting it down by SSH with no keyboard dongle seems stable. I've grabbed the bunch of GPIO connected wires and it still doesn't restart. Some kind of interaction with the keyboard dongle then?
you've invented a pressure based charger for the raspi. do you get more current the faster you type? :)

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2848
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Pi B+ won't shutdown. Which Port brings it back up?

Fri Jul 18, 2014 6:54 pm

ukscone wrote:you've invented a pressure based charger for the raspi. do you get more current the faster you type? :)
If I plug the dongle back in and type really fast it still doesn't come back on. :lol: So it might be related to that dongle somehow interacting with something.

But now I've rearranged the dongles, it doesn't seem to happen any more. Will keep an eye on it and see if it happens again.

Weird though. It happened repeatably at least 6 or 7 times.
Alex Eames RasPi.TV, RasP.iO

PiGraham
Posts: 3567
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Pi B+ won't shutdown. Which Port brings it back up?

Fri Jul 18, 2014 8:25 pm

alexeames wrote:
PiGraham wrote:
So, when you remove the USB peripherals, leaving only your keyboard dongle, the Pi restarts every time after a halt?
Yep. Exactly that.
PiGraham wrote: The two possibilities that occur to me are:
1. Something slugs the power rail as it shuts down, triggering the reset circuit.
2. Some noise during shut-down couples to the RUN (reset) lines causing a reset.

Do you have anything connected to the RUN pins?
No
PiGraham wrote: Does it still happen if you remove the keyboard dongle and do the halt via USB keyboard or SSH?
Don't have a USB keyboard over here. Will plug the wifi dongle back in a try by ssh. Shutting it down by SSH with no keyboard dongle seems stable. I've grabbed the bunch of GPIO connected wires and it still doesn't restart. Some kind of interaction with the keyboard dongle then?
Maybe. I assume you used this keyboard dongle with your model Bs without seeing this.
I have seem Pis reboot when plugging devices into USB, due to the initial current dipping the supply voltage.
Now the USB sockets will source a lot more current that should be less likely, but, your PSU still has to be able to source that current surge (if any, at halt).

It might be worth trying a beefier PSU.

It is surprising, given that the new switch-mode on-board will run as low as 2.6V. It's hard to believe the keyboard dongle could be pulling enough juice to glitch the supply below that.

I wonder if it's a swing the other way. At halt, it the load drops suddenly, the PSU might glitch high and trip a crowbar protection that trips the reset. That doesn't seem likely

Hopefully somebody who knows the circuit will have some ideas.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2848
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Pi B+ won't shutdown. Which Port brings it back up?

Fri Jul 18, 2014 8:34 pm

It must be my electric personality. :lol:

Having taken off all the GPIO wires, all the USB dongles, I can still get the Pi to come back up again from halt by touching my finger on the GPIO pins. Sometimes, even just getting close to them is enough. It seems to be GPIO16&20 when I touch those two it comes right back up. But sometimes, just getting close is enough.

It's no good me touching a radiator or tap as the darned house over here isn't earthed anyway.
Alex Eames RasPi.TV, RasP.iO

User avatar
jbeale
Posts: 3469
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Pi B+ won't shutdown. Which Port brings it back up?

Fri Jul 18, 2014 10:25 pm

alexeames wrote:It's no good me touching a radiator or tap as the darned house over here isn't earthed anyway.
My guess- if you have static charge (dry day, rubbing against carpet, fabric etc.? high local field from imminent thunderstorm?) and get near the Pi, you could change the logic level of any floating / high impedance lines. So it sounds like whatever state the Pi is in shutdown, it is leaving some important GPIO line in a high-impedance state, and without an external pullup/pulldown resistor, so susceptible to voltage change from external field.

If you have a high-power RF transmitter in the area, the same argument applies except that your body acts as an antenna for the RF signal, instead of DC static charge.

Milliways
Posts: 425
Joined: Fri Apr 25, 2014 12:18 am
Location: Sydney, Australia

Re: Pi B+ won't shutdown. Which Port brings it back up?

Sat Jul 19, 2014 4:51 am

When the pi is halted using sudo halt or similar, pulling pin 5 low will make it boot up again.

This is implemented in bootcode.bin as documented
http://elinux.org/RPI_safe_mode#Wake_from_Halt.5B1.5D

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2848
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Pi B+ won't shutdown. Which Port brings it back up?

Sat Jul 19, 2014 6:21 am

jbeale wrote:
alexeames wrote:It's no good me touching a radiator or tap as the darned house over here isn't earthed anyway.
My guess- if you have static charge (dry day, rubbing against carpet, fabric etc.? high local field from imminent thunderstorm?) and get near the Pi, you could change the logic level of any floating / high impedance lines. So it sounds like whatever state the Pi is in shutdown, it is leaving some important GPIO line in a high-impedance state, and without an external pullup/pulldown resistor, so susceptible to voltage change from external field.

If you have a high-power RF transmitter in the area, the same argument applies except that your body acts as an antenna for the RF signal, instead of DC static charge.
Yes. I think that must be what it is. Although we have no carpets here (laminate panel floor). I have been barefoot most of the time as it's hot here. I'll try it with shoes on.

Still happens with shoes on. Must be static. I was wondering which pins it might be due to. Could be the pin 5 thing? But it happens when I get close to the pins at the USB end of the B+
Alex Eames RasPi.TV, RasP.iO

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2848
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Pi B+ won't shutdown. Which Port brings it back up?

Sat Jul 19, 2014 7:23 am

Here's the issue...

http://youtu.be/PV8P-KnGXGg
Alex Eames RasPi.TV, RasP.iO

guzunty
Posts: 276
Joined: Mon Jan 14, 2013 10:13 am

Re: Pi B+ won't shutdown. Which Port brings it back up?

Sat Jul 19, 2014 8:12 am

Yes, I have been seeing this issue too. I first reported it in the 'Who's received their B+' topic, but everyone there shrugged their shoulders.

Well, it appears to be real. I believe I have traced it to pin 28 - ID_SC. Pulling that to ground prevents the issue, for me anyway.

Alex, can you try that and see if it fixes the problem for you too?

Since that pin is reserved for future use, it is possible that there is a bad (or more likely, uninitialised) vector for it, should be easy enough to fix

HTH,

Derek
Guzunty: A fully programmable peripheral you build yourself! https://github.com/Guzunty/Pi/wiki

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2848
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Pi B+ won't shutdown. Which Port brings it back up?

Sat Jul 19, 2014 8:21 am

OK. Running from a battery and with ESD protection measures in place eliminated the issue. It's quite likely the communist era wiring in the house here.

https://twitter.com/RasPiTV/statuses/490406307112161280
Alex Eames RasPi.TV, RasP.iO

User avatar
PeterO
Posts: 4873
Joined: Sun Jul 22, 2012 4:14 pm

Re: Pi B+ won't shutdown. Which Port brings it back up?

Sat Jul 19, 2014 8:32 am

guzunty wrote: Since that pin is reserved for future use, it is possible that there is a bad (or more likely, uninitialised) vector for it, should be easy enough to fix
HTH,
Derek
That sounds plausible Derek,good catch !
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2848
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Pi B+ won't shutdown. Which Port brings it back up?

Sat Jul 19, 2014 8:50 am

guzunty wrote:
Well, it appears to be real. I believe I have traced it to pin 28 - ID_SC. Pulling that to ground prevents the issue, for me anyway.

Alex, can you try that and see if it fixes the problem for you too?
That seems to work for me (quick n=1 test) even on 'commie' mains wiring.

Tried again without ESD protective measures and it still works. Looking at the pinouts, there's a GND pin (pin 30) next to pin 28. Happy days :)
(Although I feel like a naughty boy connecting something to a DNC pin :o )

Digs in parts box for a jumper :lol:
Alex Eames RasPi.TV, RasP.iO

guzunty
Posts: 276
Joined: Mon Jan 14, 2013 10:13 am

Re: Pi B+ won't shutdown? Tying pin 28 to GND seems to solve

Sat Jul 19, 2014 1:38 pm

I have a refinement to the pin 28 theory.

Since the board does not reboot during normal use, even when touching pin 28, I believe that one of 2 possibilities remain;

- There is a pull down resistor on that pin that gets disabled during halt and/or
- The vector that is supposed to handle transitions on that pin is invalidated during halt

both eventualities should be easy to fix in software.
Guzunty: A fully programmable peripheral you build yourself! https://github.com/Guzunty/Pi/wiki

User avatar
joan
Posts: 14077
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Pi B+ won't shutdown? Tying pin 28 to GND seems to solve

Sat Jul 19, 2014 1:46 pm

Isn't pin 28 connected to gpio1 or SCL for I2C bus 0 in old money. Shouldn't that have a hard pull-up to 3.3V? Or does this new boot device not use I2C.

User avatar
PeterO
Posts: 4873
Joined: Sun Jul 22, 2012 4:14 pm

Re: Pi B+ won't shutdown? Tying pin 28 to GND seems to solve

Sat Jul 19, 2014 2:02 pm

joan wrote:Isn't pin 28 connected to gpio1 or SCL for I2C bus 0 in old money. Shouldn't that have a hard pull-up to 3.3V? Or does this new boot device not use I2C.
Yes it is the I2C bus pin, but the suspicion is that something changes when the system enters the halted state. Level transitions on this pin then cause something to happen that has the unintended/unexpected consequence of restarting the system.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

guzunty
Posts: 276
Joined: Mon Jan 14, 2013 10:13 am

Re: Pi B+ won't shutdown? Tying pin 28 to GND seems to solve

Sat Jul 19, 2014 2:18 pm

@Joan, could be.

The ID_SC is not a signal defined in the Broadcom Peripherals manual, so I assume it is a signal defined on the RPi Schematic. Thus I couldn't find out more.

Pull-up or not, the current configuration is demonstrably insufficient to prevent re-booting on some RPi's during halt. I'm hoping to find that a simple software change will suffice to fix this.

If there is a pull-up there, a jumper to ground is going to be sinking some current (possibly damaging the SOC). It would be good to know if this is the case so we can abandon our workaround.

Alex, you're set up for measuring RPi current consumption, can you check the effect of running with that jumper in place?

Edit: Thinking about it, the link is probably ok, but better safe than sorry.
Last edited by guzunty on Sat Jul 19, 2014 2:31 pm, edited 1 time in total.
Guzunty: A fully programmable peripheral you build yourself! https://github.com/Guzunty/Pi/wiki

Return to “General discussion”