diff options
author | Aaron Massey <aaronmassey@google.com> | 2022-04-07 13:07:17 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-04-12 01:10:26 +0000 |
commit | 4427e1026df8ec4f5ff2dceb29ca7ff0ee218fda (patch) | |
tree | dd9907650f3fb7fa136b965be6e72a1f0be76aac | |
parent | 60436e57ddfede61e8523afc03891728f74994ee (diff) | |
download | chrome-ec-4427e1026df8ec4f5ff2dceb29ca7ff0ee218fda.tar.gz |
zephyr: Document pwr_avg cmd in batteries doc
The pwr_avg EC console command can be invoked to query battery charging
rates.
Document this functionality in the Zephyr battery doc.
BRANCH=none
BUG=b:216366887
TEST=gerrit view
Signed-off-by: Aaron Massey <aaronmassey@google.com>
Change-Id: I139aa8d83dcdc0d80067b95fafbca77c48e3fdaa
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3576667
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r-- | docs/zephyr/zephyr_battery.md | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/docs/zephyr/zephyr_battery.md b/docs/zephyr/zephyr_battery.md index 99f70a9c10..76dd3dfc69 100644 --- a/docs/zephyr/zephyr_battery.md +++ b/docs/zephyr/zephyr_battery.md @@ -137,6 +137,10 @@ requires the battery module for correct operation. ## Testing and Debugging +### EC Console Commands + +#### battery + The `battery` [EC console command] may be invoked to check battery information on a flashed board. @@ -169,6 +173,72 @@ full_factor:0.97 shutdown_soc:4 % ``` +#### pwr_avg + +The `pwr_avg` [EC console command] logs the battery charging rate by querying +the battery fuel gauge driver. + +Example output of `uart:~$ pwr_avg`: + +Charging + +``` +mv = 13073 +ma = 439 +mw = 573 +``` + +Discharging + +``` +mv = 12824 +ma = -146 +mw = -1872 +``` + +Note: A fully charged board may report `ma = 0` and `mw = 0` average rates. + +#### chgstate + +The `chgstate` [EC console command] may be invoked to debug and manipulate machine +charging state. + +Example output of `uart:~$ chgstate`: + +``` +state = charge +ac = 1 +batt_is_charging = 1 +chg.*: + voltage = 13200mV + current = 0mA + input_current = 3000mA + status = 0xc010 + option = 0x2830004 + flags = 0x0 +batt.*: + temperature = 26C + state_of_charge = 100% + voltage = 13037mV + current = 0mA + desired_voltage = 0mV + desired_current = 0mA + flags = 0x2 + remaining_capacity = 4436mAh + full_capacity = 4436mAh + is_present = YES +requested_voltage = 0mV +requested_current = 0mA +chg_ctl_mode = 0 +manual_voltage = -1 +manual_current = -1 +user_current_limit = -1mA +battery_seems_to_be_dead = 0 +battery_seems_to_be_disconnected = 0 +battery_was_removed = 0 +debug output = off +``` + <!-- Reference Links --> [DEFAULT_BATTERY_TYPE]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/shim/src/battery.c?q=%22DEFAULT_BATTERY_TYPE%22&ss=chromiumos |