summaryrefslogtreecommitdiff
path: root/util/uut
diff options
context:
space:
mode:
authorNamyoon Woo <namyoon@chromium.org>2019-04-24 15:18:22 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-26 00:17:46 -0700
commit0a60e8dbd01b39ca1c4fde2523f0961c5a07fc35 (patch)
tree9204cec77af70df95499a4b2368f40bbdae5e1eb /util/uut
parentc8d62579f7ba8a774f0bf91feafd7a8986991511 (diff)
downloadchrome-ec-0a60e8dbd01b39ca1c4fde2523f0961c5a07fc35.tar.gz
uartupdatetool: retry opr_check_sync() if the first attept fails
This is a workaround fix for grunt, where the first command after EC reset gets zero bytes as response. BUG=b:126795953 BRANCH=none TEST=manually ran flash_ec on grunt/careena, grunt/liara and octopus/fleex through servo_v4_with_ccd_cr50 or suzy-Qable. Change-Id: I5da3bd7889d9e4059a8f523352db4f3e5a7ce841 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1583128 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Diffstat (limited to 'util/uut')
-rw-r--r--util/uut/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/uut/main.c b/util/uut/main.c
index 64a84e2725..7f8bea5963 100644
--- a/util/uut/main.c
+++ b/util/uut/main.c
@@ -292,6 +292,14 @@ int main(int argc, char *argv[])
/* Verify Host and Device are synchronized */
DISPLAY_MSG(("Performing a Host/Device synchronization check...\n"));
sr = opr_check_sync(baudrate);
+
+ /*
+ * If it fails, try it once more. There is an issue that the first
+ * command after EC reset gets 0x00 byte response. Note b/126795953.
+ */
+ if (sr != SR_OK)
+ sr = opr_check_sync(baudrate);
+
if (sr != SR_OK) {
display_color_msg(FAIL,
"Host/Device synchronization failed, error = %lu.\n",