User avatar
joan
Posts: 14200
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 2:28 pm

guzunty wrote:@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?
I just booted a B+ and checked.

There do not appear to be any pull ups on gpios 0/1.

I applied the internal pull downs and gpios 0/1 read as 0. The pull-downs should easily be defeated by an external I2C pull-up if present.

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:34 pm

@Joan,

Are you seeing the spontaneous reboot? Are you saying that enabling pulldowns on those pins fixed the problem?
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? Tying pin 28 to GND seems to solve

Sat Jul 19, 2014 2:35 pm

guzunty wrote: 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?
I had the same thought about possible damage. :o Will look into that. :D

Powered up...
With jumper
5.10 V, 0.23 to 0.24A

Without jumper
5.10 V, 0.23 to 0.24A

Looks like not much if any difference to me, or at least too small to measure with my gear.
Alex Eames RasPi.TV, RasP.iO

User avatar
joan
Posts: 14200
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 2:39 pm

guzunty wrote:@Joan,

Are you seeing the spontaneous reboot? Are you saying that enabling pulldowns on those pins fixed the problem?
I haven't used the B+ to notice these problems. I only enabled the internal pull-downs as a check to see if there were external pull-ups.

I thought this boot EEPROM was an I2C device because of the names ID_SC/ID_SD being suggestive of SCL/SDA. Perhaps if it is I2C it will have it's own pull-ups.

User avatar
joan
Posts: 14200
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 2:40 pm

Re internal pull-ups/pull-downs.

I believe these are disabled when the SOC starts anyhow.

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:45 pm

@Joan,

Those signals are definitely reserved for accessing I2C EEPROMs mounted on peripheral cards.
I believe these are disabled when the SOC starts anyhow.
Undoubtedly, but what happens to them when the Pi enters the Halt state?

But of course, it should be robust for when there are no peripherals present. Hopefully, RPi Towers technical team will take a look into this issue and comment.
Last edited by guzunty on Sat Jul 19, 2014 2:47 pm, edited 1 time in total.
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? Tying pin 28 to GND seems to solve

Sat Jul 19, 2014 2:47 pm

guzunty wrote:But of course, it should be robust for when there are no peripherals present. Hopefully, RPi Towers technical team will take a look into this issue and comment.
I'm sure they will after the weekend :)
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 2:50 pm

@Alex, yes.

Thanks for checking the current, using that link should be safe enough until we know more.

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

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23399
Joined: Sat Jul 30, 2011 7:41 pm

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

Sat Jul 19, 2014 3:04 pm

I've forwarded a link to those who know about this sort of thing...
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

User avatar
jojopi
Posts: 3079
Joined: Tue Oct 11, 2011 8:38 pm

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

Sat Jul 19, 2014 3:32 pm

On Model B, both pairs of I²C lines had hardware pull up resistors to 3V3. Current firmware appears to wake from halt when either GPIO1 or GPIO3 goes low—without regard to which I²C bus is on P1 and which is reserved for camera/display on your particular board revision. Of course, due to the strong hardware pulls, it is very unlikely to happen just by touching a pin.

At SoC power-on, weak pull ups are enabled for GPIO0…3, but it is entirely up to firmware what happens after that, since pulls are preserved over reset and during halt. With strong external pulls on previous revisions, there may have been no need for the firmware to think about it.

From the limited schematics, it does appears that GPIO0…1 no longer have physical pull resistors. Possibly the I²C bus to camera/display now uses GPIO28…29 instead.

User avatar
PeterO
Posts: 4945
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 3:41 pm

alexeames wrote: Powered up...
With jumper
5.10 V, 0.23 to 0.24A
Without jumper
5.10 V, 0.23 to 0.24A
Looks like not much if any difference to me, or at least too small to measure with my gear.
Can you measure the current in the shorting wire when the PI is ON ? IE put you meter on milliamps and connect it between the pin and ground. (Note this is no worse a thing that having the shorting wire in place).

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

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5318
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

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

Sat Jul 19, 2014 4:47 pm

jojopi wrote:On Model B, both pairs of I²C lines had hardware pull up resistors to 3V3. Current firmware appears to wake from halt when either GPIO1 or GPIO3 goes low—without regard to which I²C bus is on P1 and which is reserved for camera/display on your particular board revision. Of course, due to the strong hardware pulls, it is very unlikely to happen just by touching a pin.

At SoC power-on, weak pull ups are enabled for GPIO0…3, but it is entirely up to firmware what happens after that, since pulls are preserved over reset and during halt. With strong external pulls on previous revisions, there may have been no need for the firmware to think about it.

From the limited schematics, it does appears that GPIO0…1 no longer have physical pull resistors. Possibly the I²C bus to camera/display now uses GPIO28…29 instead.
This all sounds plausible. I believe either one of two gpios can wake the Pi (initially one for the rev1 board, then another was added when gpios were shuffled for rev2). External pull-ups avoided false triggering.

If the pull-up has gone from B+ then a floating input could well falsely trigger.
I'll check the code/schematics and either disable one of the gpio checks, or add a software pull-up first.

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? Tying pin 28 to GND seems to solve

Sat Jul 19, 2014 7:06 pm

PeterO wrote:Can you measure the current in the shorting wire when the PI is ON ? IE put you meter on milliamps and connect it between the pin and ground. (Note this is no worse a thing that having the shorting wire in place).
Yes. Using a normal multimeter and 2 jumper wires. Don't know why I didn't think of it :lol: Zero, even on the 200 micro Amp scale.

So either there is no current flowing or I've already toasted that port. Hopefully the former :) (can't be toasted because it still boots up again when I take the jumper off).
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? Tying pin 28 to GND seems to solve

Sat Jul 19, 2014 7:11 pm

dom wrote:This all sounds plausible. I believe either one of two gpios can wake the Pi (initially one for the rev1 board, then another was added when gpios were shuffled for rev2). External pull-ups avoided false triggering.

If the pull-up has gone from B+ then a floating input could well falsely trigger.
I'll check the code/schematics and either disable one of the gpio checks, or add a software pull-up first.
Thanks Dom :)
Alex Eames RasPi.TV, RasP.iO

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5318
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

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

Sat Jul 19, 2014 8:01 pm

(from other thread)

Can anyone test this file:
https://dl.dropboxusercontent.com/u/366 ... otcode.bin

Replace the one on boot partition.

I'd like to know any of the following:
Does B+ still wake from halt?
Does B+ spuriously wake from halt when prodded with fingers?
Does a rev2 model A/B still behave as before?
Does a rev1 model A/B still behave as before?

(edit: link fixed)

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 9:12 pm

Link gives 400 error on both mac and windows

(I have models of all the above, so if you can get me a working link I can answer all the questions)
Guzunty: A fully programmable peripheral you build yourself! https://github.com/Guzunty/Pi/wiki

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

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

Sat Jul 19, 2014 9:24 pm

The URL got malformed during editing I believe the correct address is https://dl.dropboxusercontent.com/u/366 ... otcode.bin :)

Richard S.

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 9:45 pm

Link is good. I can test all other models tomorrow.

Initial test on B+ is 100% positive.

Halt is successful. No reboot.

In addition, I now see the 10 ACT flashes pre-halt (which I have always assumed are disk syncs, right?)

These were previously missing with the B+

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? Tying pin 28 to GND seems to solve

Sun Jul 20, 2014 6:09 am

guzunty wrote:Initial test on B+ is 100% positive.

Halt is successful. No reboot.

In addition, I now see the 10 ACT flashes pre-halt (which I have always assumed are disk syncs, right?)
That's weird. I neither see the ACT flashes nor has the new bootcode.bin fixed the 'finger proximity' restart. Although I haven't yet seen it spontaneously restart. (That hasn't happened consistently though, just intermittently.)

My new bootcode.bin shows...
-rwxr-xr-x 1 root root 17840 Jul 20 06:01 bootcode.bin
I wgetted it from the above dropbox link while in /boot using sudo, but perhaps I've messed something up?
Alex Eames RasPi.TV, RasP.iO

User avatar
jojopi
Posts: 3079
Joined: Tue Oct 11, 2011 8:38 pm

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

Sun Jul 20, 2014 7:43 am

If you are using NOOBS then the active bootcode is the one in partition1, not the one in Raspbian's /boot. You want:

Code: Select all

sudo mount /dev/mmcblk0p1 /mnt
sudo cp bootcode.bin /mnt
sync
sudo reboot

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

Sun Jul 20, 2014 7:56 am

My B+ has always spontaneously rebooted.

I was only able to reproduce the finger proximity effect when an HDMI cable was inserted. (Monitor didn't have to be on, go figure :) )

The patch resolves the reboot issue completely for me, including finger proximity issues both with and without HDMI cable presence.

Thanks guys. I'd be curious to know what was changed to effect the fix.
Guzunty: A fully programmable peripheral you build yourself! https://github.com/Guzunty/Pi/wiki

User avatar
led-bloon
Posts: 11
Joined: Mon Dec 03, 2012 4:48 am
Location: Oz

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

Sun Jul 20, 2014 8:10 am

Using that bootcode.bin ::
Both the Model A 256MB & the Model B 512 MB appear to behave as normal.
The Model B+ seems to have fixed the "proximity switch reboot" feature
including, as noted previously, return of the ten pulse shutdown sequence.

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? Tying pin 28 to GND seems to solve

Sun Jul 20, 2014 8:11 am

jojopi wrote:If you are using NOOBS then the active bootcode is the one in partition1, not the one in Raspbian's /boot. You want:

Code: Select all

sudo mount /dev/mmcblk0p1 /mnt
sudo cp /boot/bootcode.bin /mnt
sync
sudo reboot
Ah. That must be it. Thanks jojopi.
I don't normally use NOOBS, so not used to that. But a NOOBS card came with with the B+ I was sent, so I used it :)

So. I've done all that and can now confirm that the finger proximity issue no longer occurs (and I get the 10 ACT flashes on shutdown too). :D Nice one Dom. Thank you for fixing this so quickly and at the weekend. :ugeek:
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

Sun Jul 20, 2014 8:14 am

I'm curious as to why NOOBS would have a duplicate /boot folder?

Seems like an unnecessary source of confusion?
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? Tying pin 28 to GND seems to solve

Sun Jul 20, 2014 8:22 am

guzunty wrote:I'm curious as to why NOOBS would have a duplicate /boot folder?

Seems like an unnecessary source of confusion?
I don't think NOOBS is really meant for people who'll be hacking around in the boot partition. It's to make things painless for people to get going quickly.

But either way, I no longer have a jumper connecting pins 28 & 30 and the Pi stays down when told to, so it appears to be fixed. :D
Alex Eames RasPi.TV, RasP.iO

Return to “General discussion”