MrChromebox / firmware

Issue tracker for firmware issues
78 stars 15 forks source link

ASUS Chromebook C523NA Slow Charging (USB TYPE C) #417

Open idontknowanything01 opened 1 year ago

idontknowanything01 commented 1 year ago

I am currently using coreboot 4.18.2 UFEI firmware My ASUS laptop comes with a 45W fast charger using type c interface for charging it taking 3-4 hours to complete the charging but in unmodified bios it took only 45 min to an hour.

I restored the default firmware and found the hardware is fine and charging is happening at the speed before firmware modification.

A few more details 1) In your firmware once i connect the charger the charging indicator change its colour after 5 seconds. 2) My OS (Linux Mint) show the charging indicator after 30 Sec or so. 3) Once i disconnect the charger the charger the charging indicator change its colour instantly. 4) Once i disconnect the charger the charger My OS stop showing the charging indicator after a min or so.

MrChromebox commented 1 year ago

OS driver is responsible for negotiating charging speed, make sure the cros-ec driver is loaded/working

idontknowanything01 commented 1 year ago

Thanks a lot for the replay can you please elaborate a little bit about how can i install cros-ec or check its installed or not any how to link will also work thanks again.

lee321987 commented 9 months ago

Not a solution, but a bit of a workaround: On my Asus Chromebook C423 running Xubuntu 23.10, i can get fast charging if I completely shut down the laptop, connect the charger and boot up, but if the cord is unplugged and re-plugged in it goes back to super-slow charging. Did anyone ever find a solution to this?

EDIT: I just discovered that I don't require a full shutdown -- going into deep suspend and then connecting the charger gets me full speed charge that persists when i wake from suspend.

ChocolateLoverRaj commented 6 months ago

Some useful commands for debugging slow charging:

sudo ectool usbpdpower
04:25:09 rajas@Redrix ~ → sudo ectool usbpdpower
Port 0: SNK Charger PD 19680mV / 3000mA, max 20000mV / 3000mA / 60000mW
Port 1: SRC 3000mA
sudo ectool typecstatus <port number>
04:25:11 rajas@Redrix ~ → sudo ectool typecstatus 0
Port C0: enabled, connected  State:Attached.SNK
Role:SNK DFP VCONN, Polarity:CC1
CC State: UNKNOWN
MUX: USB=1 DP=0 POLARITY=NORMAL HPD_IRQ=0 HPD_LVL=0
     SAFE=0 TBT=0 USB4=0
Port events: 0x00000000
SOP  PD Rev: 3.0
Source Capabilities:
    Fixed: 5000mV 3000mA UP DRD
    Fixed: 9000mV 3000mA 
    Fixed: 15000mV 3000mA 
    Fixed: 20000mV 3250mA 
cmbuck commented 3 months ago

I'm observing the same issue on two different Asus C302 devices. On ChromeOS the devices appear to charge normally, as expected (full charge from ~40% in <1hr). After flashing new firmware and installing Linux, both devices charge very slowly.

Additional details and troubleshooting steps below:

christopher@christopher-Cave2:~/Downloads$ sudo ./ectool usbpdpower
Port 0: SNK Charger PD 19570mV / 2248mA, max 20000mV / 2250mA / 45000mW
Port 1: Disconnected
christopher@christopher-Cave2:~/Downloads$ sudo ./ectool typecstatus 0
EC result 1 (INVALID_COMMAND)
Port C0: enabled, connected  State:SNK_READY
Role:SNK DFP, Polarity:CC1
PD Partner Capabilities:
 DR data
 Unconstrained power

upower indicates the battery is charging at ~2.5W which is really low.

christopher@christopher-Cave2:~/Downloads$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               AS19MZF
  model:                C302-50
  serial:               05DD
  power supply:         yes
  updated:              Wed 19 Jun 2024 08:49:07 PM PDT (15 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    warning-level:       none
    energy:              21.5754 Wh
    energy-empty:        0 Wh
    energy-full:         28.8057 Wh
    energy-full-design:  39.0005 Wh
    energy-rate:         2.5333 W
    voltage:             8.13 V
    charge-cycles:       164
    time to full:        2.9 hours
    percentage:          74%
    capacity:            73.8598%
    technology:          lithium-ion
    icon-name:          'battery-full-charging-symbolic'
  History (rate):
    1718855317  2.533   charging
    1718855287  2.564   charging
    1718855257  2.541   charging

I was originally concerned that this was a hardware issue, but the sequence of steps I noted above strongly indicates a software cause.

Is there a way to investigate how much power the battery is requesting, or how much power the EC is instructing the battery charger to pass to the battery?

MrChromebox commented 3 months ago

sounds like ChromeOS was doing something with the PD controller to adjust the charge rate that Linux isn't

shiptux commented 2 months ago

Is there any helpful of acpi_call?

shiptux commented 1 month ago

I have the same issue on redrix, howerver after upgrade my kernel to 6.6.43-chrultrabook(https://github.com/chrultrabook/debian-kernel), everything of charging works fine, include rapid charge.

cmbuck commented 1 month ago

@shiptux Glad to hear you've found a resolution. I tried to replicate your success but I'm still observing my charge rate being limited to 2.5W on the latest chultrabook kernel.

christopher@pop-os:~$ uname -r
6.6.43-chrultrabook
christopher@pop-os:~$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               AS19MZF
  model:                C302-50
  serial:               091B
  power supply:         yes
  updated:              Fri 09 Aug 2024 11:23:20 PM PDT (119 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    warning-level:       none
    energy:              32.7864 Wh
    energy-empty:        0 Wh
    energy-full:         37.8632 Wh
    energy-full-design:  38.494 Wh
    energy-rate:         2.4168 W
    voltage:             8.35 V
    charge-cycles:       18
    time to full:        2.1 hours
    percentage:          86%
    capacity:            98.3613%
    technology:          lithium-ion
    icon-name:          'battery-full-charging-symbolic'

In order to install the custom kernel, I took the steps:

Did I miss any steps? I'm still relying on @lee321987's workaround whenever I need to charge the device faster than 2.5W.

shiptux commented 1 month ago

@shiptux Glad to hear you've found a resolution. I tried to replicate your success but I'm still observing my charge rate being limited to 2.5W on the latest chultrabook kernel.

christopher@pop-os:~$ uname -r
6.6.43-chrultrabook
christopher@pop-os:~$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               AS19MZF
  model:                C302-50
  serial:               091B
  power supply:         yes
  updated:              Fri 09 Aug 2024 11:23:20 PM PDT (119 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    warning-level:       none
    energy:              32.7864 Wh
    energy-empty:        0 Wh
    energy-full:         37.8632 Wh
    energy-full-design:  38.494 Wh
    energy-rate:         2.4168 W
    voltage:             8.35 V
    charge-cycles:       18
    time to full:        2.1 hours
    percentage:          86%
    capacity:            98.3613%
    technology:          lithium-ion
    icon-name:          'battery-full-charging-symbolic'

In order to install the custom kernel, I took the steps:

  • Clone chultrabook kernel repo
  • run ./build.sh
  • install the resulting deb packages sudo dpkg -i *.deb
  • Manually edit my grub config to boot the new kernel

Did I miss any steps? I'm still relying on @lee321987's workaround whenever I need to charge the device faster than 2.5W.

I don't install the kernel manually, actually I installed it by run the https://github.com/WeirdTreeThing/chromebook-linux-audio scripts (deb_kernel_url="https://nightly.link/chrultrabook/debian-kernel/workflows/build/main/debian-kernel.zip" ). I will try your steps later

shiptux@shiptux-redrix:~$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               333-2C-
  model:                DK04050
  serial:               13C8
  power supply:         yes
  updated:              2024年08月10日 星期六 15时08分14秒 (27 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    warning-level:       none
    energy:              26.9654 Wh
    energy-empty:        0 Wh
    energy-full:         44.044 Wh
    energy-full-design:  50.974 Wh
    energy-rate:         35.0812 W
    voltage:             8.281 V
    charge-cycles:       46
    time to full:        29.2 minutes
    percentage:          61%
    capacity:            86.4048%
    technology:          lithium-ion
    icon-name:          'battery-full-charging-symbolic'
  History (charge):
    1723273694  61.000  charging
  History (rate):
    1723273694  35.081  charging
    1723273663  34.588  charging
    1723273662  33.541  charging
    1723273661  33.264  charging
    1723273660  4.173   charging
    1723273659  10.357  discharging
    1723273649  11.935  discharging
    1723273619  4.951   discharging

shiptux@shiptux-redrix:~$ uname -r 
6.6.43-chrultrabook
shiptux commented 1 month ago

@shiptux Glad to hear you've found a resolution. I tried to replicate your success but I'm still observing my charge rate being limited to 2.5W on the latest chultrabook kernel.

christopher@pop-os:~$ uname -r
6.6.43-chrultrabook
christopher@pop-os:~$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               AS19MZF
  model:                C302-50
  serial:               091B
  power supply:         yes
  updated:              Fri 09 Aug 2024 11:23:20 PM PDT (119 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    warning-level:       none
    energy:              32.7864 Wh
    energy-empty:        0 Wh
    energy-full:         37.8632 Wh
    energy-full-design:  38.494 Wh
    energy-rate:         2.4168 W
    voltage:             8.35 V
    charge-cycles:       18
    time to full:        2.1 hours
    percentage:          86%
    capacity:            98.3613%
    technology:          lithium-ion
    icon-name:          'battery-full-charging-symbolic'

In order to install the custom kernel, I took the steps:

  • Clone chultrabook kernel repo
  • run ./build.sh
  • install the resulting deb packages sudo dpkg -i *.deb
  • Manually edit my grub config to boot the new kernel

Did I miss any steps? I'm still relying on @lee321987's workaround whenever I need to charge the device faster than 2.5W.

I am trying to add this patch(https://github.com/chrultrabook/debian-kernel/blob/main/patches/i2c-Add-device-property-for-probing.patch) to my distribution's kernel. Everything works well including the battery charge speed.

shiptux@shiptux-redrix:~$ cat without-patch 
  native-path:          BAT0
  vendor:               333-2C-
  model:                DK04050
  serial:               13C8
  power supply:         yes
  updated:              2024年08月14日 星期三 10时30分31秒 (29 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    warning-level:       none
    energy:              40.3172 Wh
    energy-empty:        0 Wh
    energy-full:         44.8525 Wh
    energy-full-design:  50.974 Wh
    energy-rate:         15.2999 W
    voltage:             8.627 V
    charge-cycles:       50
    time to full:        17.8 minutes
    percentage:          89%
    capacity:            87.9909%
    technology:          lithium-ion
    icon-name:          'battery-full-charging-symbolic'
  History (charge):
    1723602594  89.000  charging
    1723602573  0.000   unknown
  History (rate):
    1723602631  15.300  unknown
    1723602601  16.401  charging
    1723602600  16.501  charging
    1723602599  16.617  charging
    1723602597  10.306  charging
    1723602595  13.087  discharging
    1723602594  15.924  charging
    1723602573  0.000   unknown
shiptux@shiptux-redrix:~$ cat with-patch 
  native-path:          BAT0
  vendor:               333-2C-
  model:                DK04050
  serial:               13C8
  power supply:         yes
  updated:              2024年08月14日 星期三 11时30分22秒 (4 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    warning-level:       none
    energy:              34.4036 Wh
    energy-empty:        0 Wh
    energy-full:         44.8525 Wh
    energy-full-design:  50.974 Wh
    energy-rate:         34.5884 W
    voltage:             8.55 V
    charge-cycles:       50
    time to full:        18.1 minutes
    percentage:          76%
    capacity:            87.9909%
    technology:          lithium-ion
    icon-name:          'battery-full-charging-symbolic'
  History (rate):
    1723606222  34.588  charging
    1723606192  35.127  charging
    1723606191  35.058  charging
    1723606190  34.758  charging
    1723606189  35.166  charging
    1723606188  8.732   charging
    1723606187  3.735   discharging
    1723606166  7.623   discharging
    1723606136  4.512   discharging