I have today finally fixed the issues with my Raspberry-PI.
If I have these issues everybody must be having them, USB problems!
After spending the whole day measuring and tinkering it seems to work.
There are some serious design-flaws with the board, to say the least.
UPDATE: it is not completely fixed, after a few hundred open/close calls on a sound card (alsa on USB) the problem still happens, the USB locks up. I will not use a R-Pi again. What a piece of marketing hype it is.
One of the thing I need the R-Pi to do is run of 12 Volts, not a 5 volt USB connector. So I added a DC/DC converter (which also insulates the ground connection, which is always good when doing audio or mounting stuff in a car).
It appeared to work fine but the usb-audio-card kept failing, after opening it 20 times or so.
I also have a Pi-Face board connected so that complicated the situation.
When it ran it ran OK, but sometimes it just did not work. I do not like these intermittent problems, so I spend today investigating. If I toggled the relays on the Piface board many times trouble happened...
That sounds like a power supply issue, but how can that be? It is a very commonly used board, it certainly would be stable right, NOT, certainly not, not a chance.
I ended up measuring voltages everywhere and found very odd readings, like voltage dropping 1.0 volt over a polyfuse, yes you read that right.
A USB device must be given a voltage of 4.75 -. 5.25 volts to work with. The R-Pi was outputting just 4.0 Volts when giving it 5.1 Volts at the input. All the reports of using a proper power-supply are not the whole answer, the board is certainly also to blame, not just the power-supply.
Furthermore, the voltage was not stable, it depended on the audio being played, really! Play something at high volume and lose the R-Pi, how is that for fun?
I ended up bypassing all the polyfuses on the R-Pi board and adding some extra capacitors on the 3.3 Volt and 5 volt lines.
That made a real change, it stopped crashing and USB does not disconnect anymore filing up my logs with : usb_set_interface failed (-32)
After seeing one of these messages, the only way to recover is to remove power and reboot, not even unplugging/reconnecting the USB device will work.
I am not seeing these anymore, hooray hooray. (Update: it still fails sometimes when stressed a bit more)
above some pictures of the DC/DC converter and the bypassed of the fuses.
The voltage on the USB devices is now 4.91 volts, which is within specification.
Then there where also issues with the Pi-Face board, the flyer and docs say that the inputs are pulled up with 10k resistors, this is not true. (the actual value is about 100k, which matches the specs of the MCP23S17 which is doing the pull-up. (since there is no good schematic for the Piface board, you have to find this by reverse engineering the board, which I think is not good)
the picture shows the 1.5 k resistor between input 1 and 3.3 Volt, as a pull-up.
If you connect a switch to a 100k pull-up a current of 0.03 mA will flow when you close the switch. This is out of spec for most switches (they might have a leakage current that high), a switch needs some current to work well, so I added a 1.5k resistor as a pull up, so at least 2 mA will flow through it. Much better.
If I have these issues everybody must be having them, USB problems!
After spending the whole day measuring and tinkering it seems to work.
There are some serious design-flaws with the board, to say the least.
UPDATE: it is not completely fixed, after a few hundred open/close calls on a sound card (alsa on USB) the problem still happens, the USB locks up. I will not use a R-Pi again. What a piece of marketing hype it is.
One of the thing I need the R-Pi to do is run of 12 Volts, not a 5 volt USB connector. So I added a DC/DC converter (which also insulates the ground connection, which is always good when doing audio or mounting stuff in a car).
It appeared to work fine but the usb-audio-card kept failing, after opening it 20 times or so.
I also have a Pi-Face board connected so that complicated the situation.
When it ran it ran OK, but sometimes it just did not work. I do not like these intermittent problems, so I spend today investigating. If I toggled the relays on the Piface board many times trouble happened...
That sounds like a power supply issue, but how can that be? It is a very commonly used board, it certainly would be stable right, NOT, certainly not, not a chance.
I ended up measuring voltages everywhere and found very odd readings, like voltage dropping 1.0 volt over a polyfuse, yes you read that right.
A USB device must be given a voltage of 4.75 -. 5.25 volts to work with. The R-Pi was outputting just 4.0 Volts when giving it 5.1 Volts at the input. All the reports of using a proper power-supply are not the whole answer, the board is certainly also to blame, not just the power-supply.
Furthermore, the voltage was not stable, it depended on the audio being played, really! Play something at high volume and lose the R-Pi, how is that for fun?
I ended up bypassing all the polyfuses on the R-Pi board and adding some extra capacitors on the 3.3 Volt and 5 volt lines.
the pictures shows the bypassed on the USB polyfuses, they where losing about 1 volt of the already low 5 volt bus.
Adding a proper 5 volt input, bypassing the input fuse on the R-Pi, the fuse was dropping the 5 volt bus below 4.8 volts.
the DC/DC converter, a MEE3S1205SC, now the Pi can connect to 12 Volts and without the fragile micro-usb connection.
That made a real change, it stopped crashing and USB does not disconnect anymore filing up my logs with : usb_set_interface failed (-32)
After seeing one of these messages, the only way to recover is to remove power and reboot, not even unplugging/reconnecting the USB device will work.
I am not seeing these anymore, hooray hooray. (Update: it still fails sometimes when stressed a bit more)
above some pictures of the DC/DC converter and the bypassed of the fuses.
The voltage on the USB devices is now 4.91 volts, which is within specification.
Then there where also issues with the Pi-Face board, the flyer and docs say that the inputs are pulled up with 10k resistors, this is not true. (the actual value is about 100k, which matches the specs of the MCP23S17 which is doing the pull-up. (since there is no good schematic for the Piface board, you have to find this by reverse engineering the board, which I think is not good)
the picture shows the 1.5 k resistor between input 1 and 3.3 Volt, as a pull-up.
If you connect a switch to a 100k pull-up a current of 0.03 mA will flow when you close the switch. This is out of spec for most switches (they might have a leakage current that high), a switch needs some current to work well, so I added a 1.5k resistor as a pull up, so at least 2 mA will flow through it. Much better.
Reacties