raspberrypi / bookworm-feedback

14 stars 1 forks source link

Bookworm lifting USB current limit doesn't seem to work? #87

Closed Tiger0215 closed 1 year ago

Tiger0215 commented 1 year ago

When using the PD power supply, the USB port output current still does not reach 1.6A. Is there any instruction to test the USB output current or release the USB current limit? I've currently used PD power, and lifted the USB current limit, but it doesn't work: I_VJ6C5GSK2E6X `W$8MCX5

ghollingworth commented 1 year ago

Can you confirm:

image

Tiger0215 commented 1 year ago

pi@raspberrypi:~ $ vcgencmd get_config usb_max_current_enable usb_max_current_enable=1 But when I use a 1A electronic load on the USB interface, the USB interface power supply will continue to restart, that is, the measured USB output capability remains at 600mA.

ghollingworth commented 1 year ago

For completeness, can you answer the other questions?

Tiger0215 commented 1 year ago
ghollingworth commented 1 year ago

What do you get with:

pinctrl 49

Tiger0215 commented 1 year ago

49: op dh pd | lo // EN_MAX_USB_CUR/GPIO49 = output

Tiger0215 commented 1 year ago

When I connect an electronic load greater than 1A, the USB interface keeps restarting I'm not sure if there is a command to monitor the output status of the USB interface. If there is, I can try to read it.

timg236 commented 1 year ago

49: op dh pd | lo // EN_MAX_USB_CUR/GPIO49 = output

That looks correct.

pin43 will tell you whether USB OC is asserted

ghollingworth commented 1 year ago

@timg236 @pelwell

I've just tried adding:

usb_max_current_enable=0

in config.txt, I've confirmed with vcgencmd that

gordon@gordon@~$ vcgencmd get_config usb_max_current_enable
usb_max_current_enable=0
gordon@gordon@~$ pinctrl 49
49: op dl pd | lo // EN_MAX_USB_CUR/GPIO49 = output

Without the config.txt parameter, I get:

49: op dh pd | lo // EN_MAX_USB_CUR.GPIO49 = output

Is there something wrong with this output? In this case it is driving high (dh), but reading back 'lo'

Gordon

pelwell commented 1 year ago

Yes, there's something wrong, as if the firmware isn't properly configuring the output (which is more complicated with RP1).

If you run pinctrl 49 dh; pinctrl 49 you'll see no change. Ditto for pinctrl 49 dl; pinctrl 49 dh; pinctrl 49. But if you explicitly (re)set it to be an output it should spring into life:

pi@raspberrypi:~$ pinctrl 49
49: op dh pd | lo // EN_MAX_USB_CUR/GPIO49 = output
pi@raspberrypi:~$ pinctrl 49 op dh; pinctrl 49
49: op dh pd | hi // EN_MAX_USB_CUR/GPIO49 = output

So there are three things to do:

  1. Find out what the firmware isn't doing and fix it (I'm looking at the RP1 GPIO support anyway).
  2. Improve pinctrl so it can spot the problem and report it in some way.
  3. Add a read-back option to pinctrl so you don't have to run it twice to make a change and observe the effect.
Tiger0215 commented 1 year ago

49: op dh pd | hi // EN_MAX_USB_CUR/GPIO49 = output Yes, I can see that the IO port is in a high level state. But unfortunately, the actual USB output capability remains unchanged.

pelwell commented 1 year ago

OK - I think the pinctrl output is red herring. The read value is wrong, but that's because the input enable has not been set on the pin. Running sudo busybox devmem 0x1f000f8040 32 0x56 changes that, after which pinctrl shows that the pin level is high, as expected.

I can either display -- for the level, or force the input enables to always be high - I think the former is safer and more informative.

pelwell commented 1 year ago

FYI, pinctrl has been updated with the change described above: https://github.com/raspberrypi/utils/commit/4f4c1744591a909bbc389428e64ba999f6d2f2c8

pi@raspberrypi:~$ pinctrl 49
49: op dl pd | -- // EN_MAX_USB_CUR/GPIO49 = output
timg236 commented 1 year ago

@Tiger0215 Please could you post a photo of the underside of the board? High res around the RP1 area would be good to rule out some things