22 Replies Latest reply on Nov 24, 2012 9:49 AM by John Beetem

    USB device connect resets 512M Raspberry Pi (most USB devices).

    JanHolstJensen

      Hi,

       

      I got my batch of 3 brand-new 512M Raspberry Pi-s today (hardware revision "000f" according to /proc/cpuinfo). Every single one of them exhibits the same instability: They reset when I connect certain USB devices. If I have such an offending USB device connected on power-on and leave it in, it will work just fine. Which means that hot-plugging USB devices does not work - a critical bug.

       

      I have a couple of USB devices that I can connect without resetting a running 512M Pi:

       

      * A SanDisk Cruzer Micro 16 GB memory stick.

      * A handful of non-descript memory sticks (give-away advertising gifts from various vendors).

      * My USB keyboard.

       

      But every single time that I plug any of the following devices into a 512M Pi it resets:

       

      * D-Link N Nano Wi-Fi dongle DWA-131.

      * Kingston Data Traveller II, 2 GB memory stick.

      * An old IBM 64 MB memory stick.

      * A pair of USB-powered loudspeakers (speakers with a mini-jack and an analog built-in amplifier powered by 5V USB).

       

      I suspect that the USB power surge when an offending device is connected and powers up, is causing the Pi to reset. This did not happen on a previous revision of the Pi - I have three older 256M Pi's and they can all have all of the above USB devices hot-plugged without resetting (as you would expect).

       

      The power rail on the 512M Pi's USB port is quite dirty. If I power my USB loudspeakers from a 512M Pi's USB port then I have just as much background noise as I have sound. The noise sounds like power supply switching noise, a 2-4 kHz steady tone with high-frequent chirps as soon as there is activity, e.g. the SD card is active. This leaves the audio output completely unusable. If I do the same setup on a 256M Pi there is still too much background noise for comfort but it is clearly less than on a 512M Pi. If I power the USB loudspeakers from elsewhere, e.g. my laptop, and connect the loudspeakers to the Pi's audio jack then the sound is fine - the noise level is at least low enough for casual listening.

       

      I have two different types of 1000 mA 5V power supplies that I have tested with. There is no difference in behavior. I have even tried to buffer the on-board 5V by connecting a flat-ribbon cable to the P1 connector and then, via the ribbon cable wires, connect a 4700 uF capacitor across 5V and GND (pin 2 -> pin 6). No effect.

       

      I have seen a report on thermal instability with the new 512M Pi's [1] but that issue is not seen here. I have left one of the 512M Pi's running for 3.5 hours straight without any problems - this one was idling and was not overclocked. I then overclocked it to max "Turbo" mode, re-booted, and started a python script that burns 100% CPU. The /sys/class/thermal/thermal_zone0/temp reported 45 degrees C (45000 raw number) when I started the script and stabilized at 53 degrees C after a minute or so. I left it running for more than 20 minutes straight - no problems.

       

      [1] http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=22281&p=215444

       

      There has also been a report on a bad USB controller connection [2]. We can rule that out. The issue occurs with specific USB devices and cannot be triggered by mechanically exciting the USB connector. Plus, it is the same pattern on all 3 boards.

       

      [2] http://www.element14.com/community/message/64061

       

      Unfortunately this sounds like an RMA on all three boards. Please advise me on how to proceed and when I can expect a new batch of 512M Pi's where the USB interface is stable again.

       

        Kind regards

      -- Jan Holst Jensen

        • Re: USB device connect resets 512M Raspberry Pi (most USB devices).
          wallarug

          Is it only the top port?  That is the same issue I am having... as you have pointed out above [2].  What batch number are you?  Mine does not have a batch number (which I think could be a problem) but does have a sticker with a date on it. "12/09" is the date on it.

           

          I would also like to know what this issue is...I recieved another RPi as a replacement yesterday...I am yet to test it and see if it has the same problem.

           

          Please let me know if you find anything new on this issue as it could help a lot of people.

          • Re: USB device connect resets 512M Raspberry Pi (most USB devices).
            John Beetem

            Jan Holst Jensen wrote:

             

            I suspect that the USB power surge when an offending device is connected and powers up, is causing the Pi to reset. This did not happen on a previous revision of the Pi - I have three older 256M Pi's and they can all have all of the above USB devices hot-plugged without resetting (as you would expect).

             

            ...

             

            I have two different types of 1000 mA 5V power supplies that I have tested with. There is no difference in behavior. I have even tried to buffer the on-board 5V by connecting a flat-ribbon cable to the P1 connector and then, via the ribbon cable wires, connect a 4700 uF capacitor across 5V and GND (pin 2 -> pin 6). No effect.

             

            Here is my guess:

             

            The rev 1 RasPi had polyfuses F1 and F2 which filtered the +5.0V Vbus going to the USB devices.   F1 and F2 were changed to 0 Ohm jumpers for the last batches of rev 1 RasPis.  The rev 2 RasPi doesn't have F1 and F2 at all.  According to the schematic, the USB Vbus signals are directly connected to 5V0 so any noise is directly coupled and you can't play with F1 and F2 like you could with a rev 1 board.  So it may be a design flaw rather than a manufacturing error and if so, replacement boards won't work any better.

             

            The 4700 uF cap should have helped, especially with the audio.  However, a large cap may have too much inductance to filter sharp spikes.

             

            If you have a spare USB cable, you might hack the Vbus line and insert a 1-2 Ohm resistor to simulate the filtering effect of the polyfuse.  That would test my hypothesis.  An LC circuit would filter without a voltage drop.  An externally-powered hub should also work if it has good power filtering (many don't).

             

            Also, do check TP1-TP2 with a voltmeter.  It should be at least 4.8V, but many people are able to run RasPi with as little as 4.2V.  However, it's conceivable that you're right at the threshold of reliable operation and the current surge of plugging in a new device is enough to trigger misbehavior.  It's unlikely that this is the problem, but it's an easy test.

              • Re: USB device connect resets 512M Raspberry Pi (most USB devices).
                JanHolstJensen

                John Beetem wrote:

                 

                Jan Holst Jensen wrote:

                 

                I suspect that the USB power surge when an offending device is connected and powers up, is causing the Pi to reset. This did not happen on a previous revision of the Pi - I have three older 256M Pi's and they can all have all of the above USB devices hot-plugged without resetting (as you would expect).

                 

                ...

                 

                I have two different types of 1000 mA 5V power supplies that I have tested with. There is no difference in behavior. I have even tried to buffer the on-board 5V by connecting a flat-ribbon cable to the P1 connector and then, via the ribbon cable wires, connect a 4700 uF capacitor across 5V and GND (pin 2 -> pin 6). No effect.

                 

                Here is my guess:

                 

                The rev 1 RasPi had polyfuses F1 and F2 which filtered the +5.0V Vbus going to the USB devices.   F1 and F2 were changed to 0 Ohm jumpers for the last batches of rev 1 RasPis.  The rev 2 RasPi doesn't have F1 and F2 at all.  According to the schematic, the USB Vbus signals are directly connected to 5V0 so any noise is directly coupled and you can't play with F1 and F2 like you could with a rev 1 board.  So it may be a design flaw rather than a manufacturing error and if so, replacement boards won't work any better.

                 

                The 4700 uF cap should have helped, especially with the audio.  However, a large cap may have too much inductance to filter sharp spikes.

                 

                If you have a spare USB cable, you might hack the Vbus line and insert a 1-2 Ohm resistor to simulate the filtering effect of the polyfuse.  That would test my hypothesis.  An LC circuit would filter without a voltage drop.  An externally-powered hub should also work if it has good power filtering (many don't).

                 

                Also, do check TP1-TP2 with a voltmeter.  It should be at least 4.8V, but many people are able to run RasPi with as little as 4.2V.  However, it's conceivable that you're right at the threshold of reliable operation and the current surge of plugging in a new device is enough to trigger misbehavior.  It's unlikely that this is the problem, but it's an easy test.

                 

                I had begun to suspect the ommision of the USB fuses too, since they were a major design change in the later revisions. Your explanation makes perfect sense - unfortunately :-(.

                 

                I can understand the reasons for removing the USB fuses - larger current draw possible for power-hungry USB devices, and the option of back-powering the Pi from a USB hub. But gaining that at the cost of making the Pi prone to a hard reset when you insert a USB memory stick, is definitely not worth it in my opinion.

                 

                I think I may have a USB cable that I can hack to insert a small resistor and test the hypothesis. Will be back later today with the results...

                  • Re: USB device connect resets 512M Raspberry Pi (most USB devices).
                    JanHolstJensen

                    Jan Holst Jensen wrote:

                     

                    John Beetem wrote:

                     

                    Jan Holst Jensen wrote:

                     

                    I suspect that the USB power surge when an offending device is connected and powers up, is causing the Pi to reset. This did not happen on a previous revision of the Pi - I have three older 256M Pi's and they can all have all of the above USB devices hot-plugged without resetting (as you would expect).

                     

                    ...

                     

                    I have two different types of 1000 mA 5V power supplies that I have tested with. There is no difference in behavior. I have even tried to buffer the on-board 5V by connecting a flat-ribbon cable to the P1 connector and then, via the ribbon cable wires, connect a 4700 uF capacitor across 5V and GND (pin 2 -> pin 6). No effect.

                     

                    Here is my guess:

                     

                    The rev 1 RasPi had polyfuses F1 and F2 which filtered the +5.0V Vbus going to the USB devices.   F1 and F2 were changed to 0 Ohm jumpers for the last batches of rev 1 RasPis.  The rev 2 RasPi doesn't have F1 and F2 at all.  According to the schematic, the USB Vbus signals are directly connected to 5V0 so any noise is directly coupled and you can't play with F1 and F2 like you could with a rev 1 board.  So it may be a design flaw rather than a manufacturing error and if so, replacement boards won't work any better.

                     

                    ...

                     

                    If you have a spare USB cable, you might hack the Vbus line and insert a 1-2 Ohm resistor to simulate the filtering effect of the polyfuse.  That would test my hypothesis.  An LC circuit would filter without a voltage drop.  An externally-powered hub should also work if it has good power filtering (many don't).


                     

                    I put together a USB extension cable and just having that extra wire between the USB ports and the devices does make a difference. My Wi-Fi dongle and the two previously-failing memory sticks can now be plugged into a running Pi - and it stays up. But, it is not enough to keep it going when I plug in my USB-powered speakers.

                     

                    I did not have a small-enough resistor at hand but I had an inductor so I inserted that small inductor in the +5V wire. It was not enough. I then added a 470 uF capacitor across +5V and GND, after the inductor, so the extension cable has an LC bridge. Not enough either, but then - I don't know how big that inductor is...

                     

                    Then I tried just having the capacitor across +5V and GND in the extension cable - a real dumb "dummy USB device": Charge a capacitor when plugged in, then do nothing. A 470 uF capacitor is enough to trigger a reset of the Pi - sometimes. And a 1000 uF capacitor does the job every time. The old 256M board stays alive in both cases.

                     

                    With regards to main board voltage: I checked TP1-TP2 and it hovers around 4.72 which is at the low end. One of my power supplies has adjustable voltage and I ramped it up to "6V" leaving me with 5.6V on the main board - should be plenty. It still resets when I plug in the Kingston memory stick.

                     

                    I will ask on the Raspberry Pi forum whether there are any plans for changing the design so we can get the fuses back in or some other form of current limitation. As it is, the USB ports are not at all user-friendly and the resets have now cost me data loss on two SD cards that I have had to re-image.

                • Re: USB device connect resets 512M Raspberry Pi (most USB devices).
                  wallarug

                  Sounds like the "bad batch" from RS is

                   

                  BATCH NUMBER: E3912RSV13R1.0

                   

                  That is the vibe I am getting from the other forum.  Get people to check batch numbers.

                   

                  [1] http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=22281&p=215444

                  • Re: USB device connect resets 512M Raspberry Pi (most USB devices).
                    John Beetem

                    Here's a new thread chez RasPi: Raspberry Pi Reboots on inserting a USB device.  In the third comment, mahjongg says:

                    Don't hot plug USB devices directly into the PI, if you must hot plug plug into a hub instead!

                     

                    Its called "the rush in current problem", and it makes that the current PI itself is non "hot pluggable", note that the revision 1 PI was hot pluggable, as the two polyfuses prevented any rush in current because the fuses had a non zero resistance. But in the current board there is literally zero resistance between the PI's 5V supply, and any USB device you plug in, that means that if you plug in any USB device with empty power decouplers, (which act as a complete short for a very small time) then you are actually simply shorting the 5V when you plug [the] USB device in...

                    As the current PI only has two ports normally there is no need/possibility to hot plug anything in anyway, (without a hub) as the two ports are reserved for a mouse and a keyboard, unless you want to hot plug the keyboard. If you want to plug anything in beyond that you would already use a hub, and as said, you can hot plug safely into a hub.

                    So there's the semi-official answer.  The rev 2 RasPi's USB ports look like standard USB ports, but aren't because they fail USB's fundamental hot-swappability requirement.

                      • Re: USB device connect resets 512M Raspberry Pi (most USB devices).
                        JanHolstJensen

                        John Beetem wrote:

                         

                        Here's a new thread chez RasPi: Raspberry Pi Reboots on inserting a USB device.  In the third comment, mahjongg says:

                        Don't hot plug USB devices directly into the PI, if you must hot plug plug into a hub instead!

                         

                        Its called "the rush in current problem", and it makes that the current PI itself is non "hot pluggable", note that the revision 1 PI was hot pluggable, as the two polyfuses prevented any rush in current because the fuses had a non zero resistance. But in the current board there is literally zero resistance between the PI's 5V supply, and any USB device you plug in, that means that if you plug in any USB device with empty power decouplers, (which act as a complete short for a very small time) then you are actually simply shorting the 5V when you plug [the] USB device in...

                        As the current PI only has two ports normally there is no need/possibility to hot plug anything in anyway, (without a hub) as the two ports are reserved for a mouse and a keyboard, unless you want to hot plug the keyboard. If you want to plug anything in beyond that you would already use a hub, and as said, you can hot plug safely into a hub.

                        So there's the semi-official answer.  The rev 2 RasPi's USB ports look like standard USB ports, but aren't because they fail USB's fundamental hot-swappability requirement.

                         

                        What a shame. I run all my Pi-s headless and so have both "USB" ports free. It's only natural to want to plug in a USB memory stick, but that is too dangerous with the current board layout.

                         

                        Thanks for digging this up, John.

                         

                        Cheers

                        -- Jan

                      • Re: USB device connect resets 512M Raspberry Pi (most USB devices).
                        John Beetem

                        Well, it looks like RasPi has finally solved their USB problem: USB - the Elephant in our Room.  Yes, by locking that thread there won't be any more bad news about USB.  Actually, I sympathize since that thread did attract a certain number of unhelpful comments, but the reality is that USB is a problem and RasPi is probably better off having a single place for those complaints.

                         

                        One of my all-time favorite comedies is I'm All Right, Jack (1959), a brilliant satire of post-war British labour-mangement relations.  In one scene, long-suffering labour-relations manager Terry-Thomas is looking through the employee suggestion box.  He's appalled by some of the suggestions, making hilarious facial expressions and muttering comments like "what a beastly thing to say" in his trademark voice.  But he says out loud that if they didn't provide the box then the workers would write those comments on the walls.

                          • Re: USB device connect resets 512M Raspberry Pi (most USB devices).

                            There is a new USB thread now.

                             

                            http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=23544

                             

                            It's supposed to be the "kinder, gentler" version.

                            How that's supposed to work isn't exactly clear, since the angst seems to be

                            continually fed by the perceived need to summarize and more prominently

                            acknowledge the issues for potential buyers, which doesn't appear likely to happen.

                            Maybe just getting "elephant" out of the title is considered a good enough reason

                            for the new thread. 

                             

                            Adding this new thread brings the number of troubleshooting thread topics to 2500.

                              • Re: USB device connect resets 512M Raspberry Pi (most USB devices).
                                obcd

                                It's clear how that's supposed to work. Jamesh warns that all complains about the usb will be erased. So, you need to post a clear reproducable problem, or some suggestions to improve things. The elephant made clear that the usb problems very likely won't get fixed. Last time I asked, they answered being suprised there still were usb problems. They obvious didn't seem to realise that a lot of unhappy customers were following that thread, so the problem reports kept coming.

                                If they thought the problems were gone or just existing with a minority of users, why do they still work on the fiq solution? Or maybe they aren't? I haven't seen a single line of code from it yet. They want the community to help. How can that happen this way?

                                And when I asked why they needed a gpu implementation after the fiq one, I got no response either.

                                So they wonder why we are concerned about it? Experiences from the past I guess.

                                  • Re: USB device connect resets 512M Raspberry Pi (most USB devices).

                                    > all complains about the usb will be erased

                                     

                                    and not just complaints, but concerns as well.

                                     

                                    > And when I asked why they needed a gpu implementation after the fiq one, I got no response either.

                                     

                                    I think any fiq solution is unlikely to be mainlined.

                                    I think the goal of a gpu solution would be to use the standard linux

                                    ehci usb driver, which would be a big advantage.

                                      • Re: USB device connect resets 512M Raspberry Pi (most USB devices).
                                        morgaine

                                        If the elephant in the room is USB, then I guess the ivory poachers are Broadcom (albeit removing the tusks at birth), and RPF are the reserve wardens turning a blind eye as they sell off their toothless pachiderms.   And this illustrates perfectly why one shouldn't push metaphors too far.

                                         

                                        Bad metaphors aside, do we know whether the work being done on Pi by Broadcom staff is unofficial and carried out in their own spare time, or is it being done during Broadcom office hours?

                                          • Re: USB device connect resets 512M Raspberry Pi (most USB devices).
                                            obcd

                                            For what it's worth, Jamesh was always telling they only work on it in their spare time.

                                            It's almost a month ago they started to talk about the fiq solution. Until now, not much was seen about it.

                                            Progress can be followed on the dev Twitter. When someone asked how that worked, the question never got answered.

                                            As long as sales are going well, they really don't seem to care much about the issue.

                                            They announced their webcam, so for people having problems with usb webcams, they have a solution.

                                            • Re: USB device connect resets 512M Raspberry Pi (most USB devices).
                                              John Beetem

                                              Morgaine Dinova wrote:

                                               

                                              Bad metaphors aside, do we know whether the work being done on Pi by Broadcom staff is unofficial and carried out in their own spare time, or is it being done during Broadcom office hours?

                                              I don't know what the standard practice is in the UK, but in the USA anti-moonlighting clauses in employment agreements explicitly forbid doing technical work for anyone else, whether for pay or for free.  The idea is that if a not-for-profit wants to use your "spare time", they should pay your employer for your services.  Otherwise it's "stealing from the company".  In fact, many USA companies consider all your time are belong to them, and if you've got all this extra time to do great, wonderful technical things then why aren't you using that time on work projects?  So my guess is that Broadcom has explicitly sanctioned use of "spare time" for RasPi, and whether it's done during "office hours" is moot.

                                               

                                              A classic Dilbert cartoon takes this one step further:

                                              Wally: Rex, how's your personal life going?

                                              Rex: I don't have one.  That would be like stealing from the company.

                                               

                                              It's not this way at all USA companies.  For example, in the old days Hewlett-Packard encourged employees to do fun projects on their own time and allowed them to take whatever parts they needed from the parts room to build fun things.  HP figured that if employees wanted to develop their knowledge and skills on their own time, providing parts was a cheap continuing education program.  The most famous success of this practice (my recollection of the legend) was when a young engineer named Steve Wozniak took a 6502 and other assorted parts and built the prototype of the Apple I.  He offered it to HP, but they weren't interested -- they told him it would be OK if he wanted to do something with it on his own.