fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

B+ and max_usb_current

Wed Aug 06, 2014 4:53 pm

I've had my B+ for a couple of weeks now with the intention of replacing an existing B with HD however I cannot get it to boot with

Code: Select all

max_usb_current=1
in config.txt (tried safe_mode_gpio=4 too). It cycles through the rainbow screen, I'm unable to read the console messages before it dies and restarts.

At the moment I'm running Noobs raspbian but I've also tried every other raspbian flavour out there, all fully updated, same result. 4 different PSUs, numerous leads, only ethernet and keyboard plugged in.

I've just tried a voltmeter across Pi pins 2 and 39, showed around 5.1V-5.25V.

Anyone any thoughts please?

User avatar
Burngate
Posts: 6091
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: B+ and max_usb_current

Wed Aug 06, 2014 5:23 pm

Am I right - your B was attached to a disc, using a powered USB hub?
And you want to use your B+ with the same disc, without the hub?

Despite trying 4 different PSUs, and measuring 5.1v-5.25v, (same voltages with every PSU?) I'm going to say it's still power
Does the PWR LED go off when it reboots?

Just 'cos max_usb_current=1 should allow the Pi to let half an amp or more through, doesn't mean the PSU can provide that. Or if it can, that the lead from the PSU can.

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Re: B+ and max_usb_current

Wed Aug 06, 2014 5:43 pm

Yes, the B is attached to a disk, as is another one, but neither are through a hub. HD is attached directly to RPi USB port, OS is on HD, SD is only used for boot. These two HDs are USB 2 devices with additional power inputs.

My intention was to use exisiting HD in a similar setup - however my issue is that I cannot set max_usb_current=1 with nothing at all conected except a keyboard and LAN let alone the HD.

The power LED does flicker. I do realise that a meter will not be sensitive enough to register small glitches so perhaps voltage is an issue. I'm just suprised if it is, all PSUs are 2A and from reputable UK suppliers.

I have a feelng that I'm not really going find anything easily except trying another B+.

drgeoff
Posts: 9915
Joined: Wed Jan 25, 2012 6:39 pm

Re: B+ and max_usb_current

Wed Aug 06, 2014 6:52 pm

https://projects.drogon.net/testing-set ... erry-pi-b/

Are you sure that you have recent enough firmware which implements that rather than the initial 'safe_mode_gpio=4'?

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Re: B+ and max_usb_current

Wed Aug 06, 2014 7:29 pm

Yes, each of the several raspbian installs I have done has been brought fully up to date as soon as installed - and I did another aptitude and rpi update again this afternoon before my latest attempts.

I mentioned in my first post that I have also tried safe_mode_gpio=4. I have them both in config.txt and comment each out in turn.

DirkS
Posts: 10015
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: B+ and max_usb_current

Wed Aug 06, 2014 9:37 pm

The power LED does flicker. I do realise that a meter will not be sensitive enough to register small glitches so perhaps voltage is an issue
Not a good sign. Is this with one or 2 HDDs attached? If 2 then unplug one of them.

BTW: AFAIK you can leave both the old and new setting for higher power in config.txt

Gr.
Dirk.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2152
Joined: Thu Jul 11, 2013 2:37 pm

Re: B+ and max_usb_current

Wed Aug 06, 2014 9:47 pm

The setting is only intended to be used with a power supply of sufficient capacity.

If 1.2A is selected, a high-current load is connected and your PSU craters because of it, then it's very likely that the Pi will crash. If the PWR LED goes out at all, then all bets are off.
Rockets are loud.
https://astro-pi.org

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Re: B+ and max_usb_current

Thu Aug 07, 2014 6:10 am

DirkS wrote: Not a good sign. Is this with one or 2 HDDs attached? If 2 then unplug one of them.
As already said, this is with no HDs attached - nothing but keyboard and LAN
jdb wrote:The setting is only intended to be used with a power supply of sufficient capacity.

If 1.2A is selected, a high-current load is connected and your PSU craters because of it, then it's very likely that the Pi will crash. If the PWR LED goes out at all, then all bets are off.
I was hoping that a 2A PSU would be sufficient, especially with such little load connected to the B+. I believe the PSUs are of reasonable quality, obtained either from ModMyPi or The PiHut, but that des not mean they are not up to the task.

Is there any possiblility that my B+ could just be over-sensitive in this respect?

phelum
Posts: 72
Joined: Thu Jul 17, 2014 7:05 am
Location: Sydney, AUS

Re: B+ and max_usb_current

Thu Aug 07, 2014 11:01 am

fruit-uk wrote: I was hoping that a 2A PSU would be sufficient, especially with such little load connected to the B+. I believe the PSUs are of reasonable quality, obtained either from ModMyPi or The PiHut, but that des not mean they are not up to the task.

Is there any possiblility that my B+ could just be over-sensitive in this respect?
Hi,
With my B+ I found that even with the 1.2A upgrade I can run one HDD and a keyboard and mouse only. I'm also using heavier wires from the power supply and these are connected to the GPIO pins because I don't have a spare micro-B plug to try and solder the wires to. I would be very surprised if a B+ can support two USB-powered HDDs. It might be possible to supply 5V directly to the USB ports but I don't know if this is safe. It seems a shame to defeat the protection circuitry that has been added.

Cheers,
Steven

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Re: B+ and max_usb_current

Thu Aug 07, 2014 11:21 am

I don't intend to bypass the micro USB at all and hope only to be able to use a single HD with a separate power input directly to the drive, not via the RPi - as I have set up with the B at present. (The reference to 'another one' earlier is to another B that also has a HD attached, also containing the OS. It is not that I wish to run two HDs on a single RPi).

My issue at present is that I cannot boot this B+ with this parameter set even with no real load attached - and I have no idea why it is failing. I do however accept that PSUs may be to blame.

I have just ordered another B+. If the new one works OK then it may point to a hradware problem.

User avatar
Burngate
Posts: 6091
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: B+ and max_usb_current

Thu Aug 07, 2014 11:35 am

fruit-uk wrote:As already said, this is with no HDs attached - nothing but keyboard and LAN
So, with only kb & LAN, no suspicious USB dongles, even separately-powered drives, the PWR led flashes
Yet the old B works without a problem (though its led can't flash, so that's not definitive)

The B+ should use slightly less power than the B in the same situation, so be less affected by power problems.
The PSUs may be ok, but the lead from there to the Pi might be a cause for concern, but should affect the B in the same way

It does look like there might be a hardware problem
Let us know how your new B+ fares when it arrives

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12405
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: B+ and max_usb_current

Thu Aug 07, 2014 11:52 am

There is about 120uF of capacitance over the USB ports, its possible that when you do not limit the USB output current your PSU cannot cope with the current consumption needed to charge that capacitance, and the PI crashes because of it, the moment it turns the higher current on. Alternatively the PSU can cope, but the voltage drop across the microUSB cable is large enough to crash the system due to the same surge current.

drgeoff
Posts: 9915
Joined: Wed Jan 25, 2012 6:39 pm

Re: B+ and max_usb_current

Thu Aug 07, 2014 12:06 pm

mahjongg wrote:There is about 120uF of capacitance over the USB ports, its possible that when you do not limit the USB output current your PSU cannot cope with the current consumption needed to charge that capacitance, and the PI crashes because of it, the moment it turns the higher current on. Alternatively the PSU can cope, but the voltage drop across the microUSB cable is large enough to crash the system due to the same surge current.
Both those suppositions are easily put to the test. Power up the RPi for several seconds to let the capacitor charge. Then momentarily short and release the two 'RUN' contacts adjacent to the ACT LED.

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Re: B+ and max_usb_current

Thu Aug 07, 2014 12:55 pm

drgeoff wrote: Both those suppositions are easily put to the test. Power up the RPi for several seconds to let the capacitor charge. Then momentarily short and release the two 'RUN' contacts adjacent to the ACT LED.
Just tried that but not sure what I should be expecting.

With no power parameter set the B+ reboots as expected and reaches login prompt, With either parameter set reboot cycles through rainbow screen.

drgeoff
Posts: 9915
Joined: Wed Jan 25, 2012 6:39 pm

Re: B+ and max_usb_current

Thu Aug 07, 2014 1:05 pm

fruit-uk wrote:
drgeoff wrote: Both those suppositions are easily put to the test. Power up the RPi for several seconds to let the capacitor charge. Then momentarily short and release the two 'RUN' contacts adjacent to the ACT LED.
Just tried that but not sure what I should be expecting..
If the looping RPi then boots OK when the RUN short is removed, mahjongg's postulation has legs. If not, it doesn't.

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Re: B+ and max_usb_current

Thu Aug 07, 2014 1:16 pm

Thanks for the explanation.

I have tried a number of different PSUs as well as leads and OS so I'm still thinking it's hardware but I have no idea at all how it might affect booting it in this way.

I have not been able to find anything similar in extensive searches over the last couple of weeks.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12405
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: B+ and max_usb_current

Thu Aug 07, 2014 2:22 pm

Thats because the B+ is only out for several weeks, and you are the only one with this problem so far :mrgreen: .

All that max_usb_current=1 does is to set GPIO38 high, which in turn turns on a FET, which connects a second 39K resistor in parallel to an existing one, on pin 5 of U13, the AP2553W6 USB power manager, lifting the current limit from 0.6A to double that (1.2A), see no possible scenario there why the PI resets because of that, except in case the gate of the FET Q4 is somehow shorted to GND. Which could be caused by a production fault. Inspect Q4, as look if there is solder shorting pins together. Also R6 (resistor mounted between gate of Q4 and GND) should be 100K not 0 Ohm. U13, Q4 and R6 should be near the USB ports.

If restarting the PI with the RUN jumper, then the capacitors are already charged, and are not the cause/

Do you have USB functionality with the limit not set to 1.2A?

Changing the current limit doesn't mean that more current will run, only that the limit is set higher, unless something behind the power manager indeed tries to draw almost unlimited amounts of power.

Perhaps there is simply a short in the USB connectors.

another explanation is that somehow your install is broken, and crashes when trying to run the code that sets GPIO38 high, but if you tried several OS, thats impossible too.

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Re: B+ and max_usb_current

Thu Aug 07, 2014 3:14 pm

mahjongg wrote:Thats because the B+ is only out for several weeks, and you are the only one with this problem so far :mrgreen: .
I know, in some ways that makes searching easier
All that max_usb_current=1 does is to set GPIO38 high, which in turn turns on a FET, which connects a second 39K resistor in parallel to an existing one, on pin 5 of U13, the AP2553W6 USB power manager, lifting the current limit from 0.6A to double that (1.2A), see no possible scenario there why the PI resets because of that, except in case the gate of the FET Q4 is somehow shorted to GND. Which could be caused by a production fault. Inspect Q4, as look if there is solder shorting pins together. Also R6 (resistor mounted between gate of Q4 and GND) should be 100K not 0 Ohm. U13, Q4 and R6 should be near the USB ports.
My eyes are much too old for this! Thanks for the very detailed explanation.

All looks clean and 99k measured across R6, 38k across R4 and R50
Do you have USB functionality with the limit not set to 1.2A?
Yes, I have done a number of successful installs to USB stick - successful except for the power parameters
Changing the current limit doesn't mean that more current will run, only that the limit is set higher, unless something behind the power manager indeed tries to draw almost unlimited amounts of power.

Perhaps there is simply a short in the USB connectors.
Guessing that's sort of how it worked I couldn't understand why it fails.
another explanation is that somehow your install is broken, and crashes when trying to run the code that sets GPIO38 high, but if you tried several OS, thats impossible too.
My feelings too.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12405
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: B+ and max_usb_current

Thu Aug 07, 2014 9:05 pm

sound to me you should return your B+ under warranty, looks like outputting a "1" on GPIO38 causes a short somehow, that the only reasonable explanation I can think off.
When you have eliminated the impossible, whatever remains, however improbable, must be the truth.

User avatar
Douglas6
Posts: 4781
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: B+ and max_usb_current

Thu Aug 07, 2014 10:35 pm

fruit-uk wrote:With no power parameter set the B+ reboots as expected and reaches login prompt, With either parameter set reboot cycles through rainbow screen.
I hate to jump in with all the knowledge in this thread, but surely one of the parameters should have no effect at all? Is it an invalid syntax problem in config.txt possibly? Or does the newer firmware accept either or?

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Re: B+ and max_usb_current

Fri Aug 08, 2014 5:28 am

mahjongg wrote:sound to me you should return your B+ under warranty, looks like outputting a "1" on GPIO38 causes a short somehow, that the only reasonable explanation I can think off.
I expect to return it but want to confirm that it is a hardware fault first, hence my registering and posting here. The concensus here does seem to be that there is a fault.

I have looked closely over the board with a 10x loupe and can see nothing obvious, nothing fried, no solder whiskers etc. There are no bent or crossed pins in any of the connector sockets. (It occurred to me overnight that perhaps it is a keyboard or even LAN fault, can't be bothered to set it all up now but I will try with just monitor and power later.)

Even so I don't think I can be 100% sure until my new B+ arrives, hopefully later today, and I can test that with my existing SD image. Until then it could still be PSU or even user error - I've been running linux for well over 10 years but I'm probably not unique in making the silliest of mistakes and not being able to see them for looking!
Douglas6 wrote: I hate to jump in with all the knowledge in this thread, but surely one of the parameters should have no effect at all? Is it an invalid syntax problem in config.txt possibly? Or does the newer firmware accept either or?
It's not a syntax issue, I have checked that so many times.

I have tried the parameters, both individually and together, as

Code: Select all

max_usb_current=1
was only introduced in later updates and I wasn't sure whether it applied in my case or whether I should be using the older

Code: Select all

safe_mode_gpio=4
.

When I received my B+ on 19th July, shortly after its release, I couldn't be sure that the various versions of raspbian I was trying were fully up to date - I suspect not - and Im still uncertain of the interaction between a 'raspbian' raspbian install and rpi-update (as opposed to a NOOBS raspbian).

I have not come across anything definitive about it but my guess was that

Code: Select all

max_usb_current=1
might have caused an error in code that didn't support it and that it is likely that

Code: Select all

safe_mode_gpio=4
might be still supported for some time to come.

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Re: B+ and max_usb_current

Fri Aug 08, 2014 10:58 am

A quick update now my new B+ has arrived...

The old B+ behaves no differently with even no LAN or keyboard connected so neither of them at fault.

The new one boots through to login with parameters set and with not a flicker of the LED like the other one. This is using same SD.

Out of curiosity I also tried a 0.5A supply. Behaves exactly as the old one, not that it proves anything - to me anyway.

I need to sort out returning the old one to CPC, not sure what that involves but I'll check their site. As this is such an obscure fault is there anything special I need to do regarding description etc?

User avatar
RaTTuS
Posts: 10498
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: B+ and max_usb_current

Fri Aug 08, 2014 11:02 am

fruit-uk wrote:A quick update now my new B+ has arrived...

The old B+ behaves no differently with even no LAN or keyboard connected so neither of them at fault.

The new one boots through to login with parameters set and with not a flicker of the LED like the other one. This is using same SD.

Out of curiosity I also tried a 0.5A supply. Behaves exactly as the old one, not that it proves anything - to me anyway.

I need to sort out returning the old one to CPC, not sure what that involves but I'll check their site. As this is such an obscure fault is there anything special I need to do regarding description etc?
http://cpc.farnell.com/jsp/bespoke/besp ... _guide.jsp
returns are easy
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

DRFoltz
Posts: 23
Joined: Wed Apr 30, 2014 9:47 am

Re: B+ and max_usb_current

Sat Aug 09, 2014 4:03 am

I kept having the same problem with the rainbow screen being stuck in an infinite loop. I was using 8gb NOOBS running Raspbian that came with starter kit I ordered from Pimoroni. I changed micro usb power cord (6 ft noodle) because I read here http://www.raspberrypi.org/forums/viewt ... 5&p=588945, by mahjongg no less, that a longer thinner cord could be a problem due to quality and wires being thinner and not as effective and 2.1 amp psu would be fine which is what I currently have for my B+.

So I switched to the the micro usb cable I use for my model B that I've used since day one which is round and not as long (about 3ft) and I never had any problem with what so ever and it stopped looping but then anytime I tried connecting an Ext HD (Toshiba 1tb) it would reset. Before I updated my NOOBS Raspbian card (with sudo apt-get update and sudo apt-get upgrade) and adding in the safe_mode_gpio=4 setting to the config.txt, I plugged in the HD and it just didn't recognize it but no reset/no loop either. I later did the raspi-update command to try the max_usb_current=1 setting in the config.txt and after that I got a small rainbow box in the right hand side anytime I plugged in the HD.

Then I wiped the card and cloned my Raspbmc card which I use on my B model and the rainbow box was there again w/o even doing any update. I tried doing the updates still nothing. I then decided to plug the wall adapter directly to the wall rather than through a power strip but to no avail. The only things I've had connected have been wifi dongle and Favi mini wireless keyboard. When I was still using the microSD as a NOOBS card I had a 32gb SanDisk flash drive with movies and games plugged in directly to the B+ too. I was also using a wired hub for the HD and a wired xbox360 controller but those were drawing from the hub of course.
With the HD plugged in on NOOBS Raspbian one setting (safe_mode_gpio=4) the red PWR led blinked at a constant interval. On the other (max_usb_current=1) no red led was present and the green ACT led was faint but blinking in rapid succession. Now on Raspbmc, with the HD plugged in, no lights are present but it is still running. I absolutely have no clue what to do. I've tried to recall and document as much as I could since this morning but I had to work in the evening so I might be a little foggy on some small parts of these occurrences but I wanted to be as thorough as I can as anytime I've come to you guys before with questions I feel like I've been misconstrued and made to feel rather stupid. I'm not a programming wiz nor do I claim to be but regardless I shouldn't be made to feel inferior when I come to the forums for help. It's a learning process for all of us.

I'm a little irritated but I know the B+ model just came out so I expected a whole new set of problems but I will be sorely disappointed if I can't get this issue resolved as the intention of the model B+ was to reduce the bulk needed to run the model B. I already had SD card compatibility issues with the B model. Which it could be a compatiblity issue with HDs as well, some might draw more power than others. Micro SD works great on B+ as I haven't had any problems so far writing and rewriting OS to both the 8gb NOOBS and a 2gb card as well. But they are both Samsung brand too so I don't know how other brands might act. I hope someone from the foundation or it's affiliates who has gotten an HD running successfully would put out a video on youtube documenting the whole process.

DRFoltz
Posts: 23
Joined: Wed Apr 30, 2014 9:47 am

Re: B+ and max_usb_current

Sat Aug 09, 2014 5:32 am

I don't know how accurate this may be but check out this article http://jarjartee.wordpress.com/2014/07/ ... -gpio-fix/ and it might help, specifically the bootcode.bin and part where they mention to use

Code: Select all

uname -a
to determine the firmware version. Mine was something like 3.12.16 but upon further inspection the wall adapter I bought was one of those dual port "1A/2.1A" wall adapters but says 3100mA in very VERY small print so I have to resolve this issue with the company I ordered from (boy is my face red :oops: ) but please let us know if it worked out for you so we can put this issue to rest. Here's Hexxeh's repo https://github.com/Hexxeh/rpi-update also to try to troubleshoot the errors in the article. Apologies to anyone I may have offended.

Return to “Troubleshooting”