summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2021-05-21 11:20:47 -0700
committerCommit Bot <commit-bot@chromium.org>2021-05-21 19:54:54 +0000
commit491b6948b4cb58fddb70652f533bdcb10ae1eec1 (patch)
treef968168384f1b0fb54a6439f65bbca8accc2188b
parent5c11d1e8b7e016fa782d7f627b348e608ab48a4f (diff)
downloadchrome-ec-491b6948b4cb58fddb70652f533bdcb10ae1eec1.tar.gz
flash_cr50: wait up to 15 seconds for EC cutoff
BUG=b:188846962 TEST=run on hatch Change-Id: I1d9ea6048cec240c830dcd5d56c41b5cbfd622a1 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2911495 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rwxr-xr-xutil/flash_cr50.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/util/flash_cr50.py b/util/flash_cr50.py
index 6dde1148af..d94ef7fb6e 100755
--- a/util/flash_cr50.py
+++ b/util/flash_cr50.py
@@ -410,6 +410,8 @@ class BatteryCutoffReset(Cr50Reset):
# EC console needs to be read-write to issue cutoff command.
'ec_uart',
)
+ CHECK_EC_RETRIES = 5
+ WAIT_EC = 3
def run_reset(self):
"""Use EC commands to cutoff the battery."""
@@ -423,9 +425,14 @@ class BatteryCutoffReset(Cr50Reset):
self._servo.dut_control('ec_uart_cmd:reboot', check_error=False,
wait=True)
- if not self._servo.dut_control('ec_board', check_error=False)[0]:
+ for i in range(self.CHECK_EC_RETRIES):
+ time.sleep(self.WAIT_EC)
+ if self._servo.dut_control('ec_board', check_error=False)[0]:
+ logging.info('Device is cutoff')
+ return
+ logging.info('EC still responsive')
+ else:
raise Error('EC still responsive after cutoff')
- logging.info('Device is cutoff')
def recover_from_reset(self):
"""Connect power using servo v4 to recover from cutoff."""