rpi-eeprom icon indicating copy to clipboard operation
rpi-eeprom copied to clipboard

Raspberry Pi 5 PMIC does not negotiate 5A current via USB-PD PPS profile

Open l3iggs opened this issue 1 year ago • 13 comments

Describe the bug

The raspberry Pi 5 PMIC does not make use of 5000 mA current offered by a charger via USB-PD PPS profile. Instead, it gets stuck at 3000mA even when a charger that advertises a PPS PDO of 3.3V - 20V @ 5A (even when a 5A e-marked cable is used).

Steps to reproduce the behaviour

  1. Buy a decent 3rd party USB type-c charger. For example, Anker 150W 747 Gan Prime. This charger happens to advertise the following PDOs [1]: image
  2. Power a rpi 5 with it using a properly e-marked 5A cable.
  3. Inspect the bootloader's power: line. It will show the power source as being only 3000 mA capable

As you can see in the image above, the charger offers a PPS PDO profile of 3.3 - 11V at 5A. 5V @ 5A falls squarely in that range and the pi5 should make use of this.

[1]: https://www.chargerlab.com/teardown-of-anker-150w-ganprime-747-charger-a2340/

Device (s)

Other

Bootloader configuration.

versions 30de0ba5 2023/10/30 and earlier

System

No response

Bootloader logs

No response

USB boot

No response

NVMe boot

No response

Network (TFTP boot)

No response

l3iggs avatar Nov 21 '23 05:11 l3iggs

This is expected. PPS is not supported.

timg236 avatar Nov 21 '23 09:11 timg236

It would require considerable work in the firmware so for the foreeable future NGTF

timg236 avatar Nov 21 '23 18:11 timg236

So you're saying there's a chance! (at some point) :-)

greyltc avatar Nov 21 '23 19:11 greyltc

So you're saying there's a chance! (at some point) :-)

Maybe ... not an expert on PPS, IIRC there are some hardware constraints plus more time-critical messaging to and from the power supply which will cause an unexplained reset (go to 'safe' 0V) if messaging goes wrong which is a disaster if the sink doesn't have a battery.

timg236 avatar Nov 21 '23 19:11 timg236

oof yeah. too bad the safe fallback wasn't something like 5V@3A

greyltc avatar Nov 21 '23 19:11 greyltc

@timg236 I've got a Satechi model ST-TC100GM charger which has a 5V fixed 3A PDO and a PPS 3.3-20V @ 5A one. When the time comes, I'd be willing to help in testing out any pre-alpha firmwares you might have for this feature. I can recover from bad power up negotiations with a benchtop power supply.

greyltc avatar Nov 21 '23 19:11 greyltc

@greyltc I've re-opened this as a feature request so that anyone interested can track it. Warning, it's probably 50:50 whether this is actually doable :)

timg236 avatar Nov 21 '23 22:11 timg236

Removed off-topic comments about product recomendations

timg236 avatar Nov 23 '23 10:11 timg236

Just to add my own 2 cents to this:

I've been observing a lot of voltage-related throttling on all of my non-official power supplies, so I checked with a lab bench PSU and it actually never exceeds 2A of current draw without anything plugged into the USB ports - it shouldn't be receiving too low a voltage. But it is, because of cable resistance. My cables are all unmarked and one of them is long but of good quality, and the rest are shorter but of dubious quality, so it's no wonder they're all pretty high resistance.

Indeed, I also have another 3A power supply that has a built-in high quality cable, and it gives me absolutely no issues. The power supplies therefore aren't even the main issue when it comes to throttling (that is, unless you have a bunch of stuff on your USB ports) - the cables are. (And they really are a big one: I'm seeing things like 4.5V despite the PSU still being at 5.)

Using PPS, the pi could ask for 5.1 or 5.2 volts, which would make the voltage drop on the cable less of a problem. It could even regulate the voltage dynamically depending on load, though I'm not sure how realistic that part would be. Some power supplies with fixed cables might even do this on their own, but I have no idea if that's actually the case.

TudbuT avatar Mar 24 '24 12:03 TudbuT

Using PPS, the pi could ask for 5.1 or 5.2 volts

The official 27W brick runs at 5.1V and has a permanently attached cable, I'm sure those design choices are for mitigating the voltage drop over the cabling. 5A is a lot. Using PPS to request a flat 5.2V no matter what seems like it would be a good idea to me. It's too bad the USB(/PD) spec didn't include some sort of provision for proper remote voltage sensing so that the source voltage supply could automatically and universally compensate for the voltage drop in the cables.

greyltc avatar Mar 24 '24 22:03 greyltc

The official brick having a fixed cable is definitely deliberate. The majority of cables just kinda suck it seems, and permanently attaching a good one just avoids that problem for good. And it would also allow the PSU to compensate for the resistance since it's a known cable - but once again, not sure if that's actually done.

I have also finally found a high quality cable somewhere in my stash. It came with a USB-C laptop charger and needs to carry 100W (@20V/5A), so they gave it a lower resistance. It works just fine with this and basically any PSU, which basically confirms my hypothesis that the cables are the problem.

PPS 5.2V or higher would probably be able to at least lessen the issue. Not sure what the max voltage of the pi is, but 5.2V certainly works just fine according to my tests. (Okay, I checked with a search engine and it SEEMS 5.25V is the rated maximum, so I probably wouldn't go above 5.2)

TudbuT avatar Mar 25 '24 11:03 TudbuT

That's why everytime I use a flash drive the os freezes?

actraiser30 avatar Sep 06 '24 06:09 actraiser30

@actraiser30 For help with troubleshooting flash drives, you should ask for help on the forums, rather than on GitHub.

lurch avatar Sep 06 '24 14:09 lurch