diff options
author | Aseda Aboagye <aaboagye@google.com> | 2015-12-18 14:53:39 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-02-06 17:28:00 -0800 |
commit | cef39847f4ad7e3f6470a59b79ae9817e56ef67d (patch) | |
tree | d232f8dd6c8df14d235e364fcc59a9b80a805ed6 | |
parent | f700e3bb0ea187bae315ff925f59c8eab05fb446 (diff) | |
download | chrome-ec-stabilize-7907.B.tar.gz |
flash_ec: Disconnect EC-3PO interps when flashing.stabilize-7907.B
Since the stm32 MCUs are programmed over the UART, we need to make
some changes to allow the interpreter to stop listening to the UART
PTY when flash_ec needs those PTYs. Otherwise, the EC-3PO interpreter
will interfere with the programming and cause the flash to fail every
time.
BUG=chromium:571170
BRANCH=None
TEST=Use flash_ec to program both veyron_jerry and samus_pd with no
interruptions.
TEST=Use flash_ec to program veyron_jerry without servod changes with
no interruptions.
CQ-DEPEND=CL:321084
CQ-DEPEND=CL:318900
Change-Id: I350fdb708d30c4ec6f18e5dc4abd621370522381
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/320629
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
-rwxr-xr-x | util/flash_ec | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/util/flash_ec b/util/flash_ec index f535b7517f..6a1839d4a2 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -301,7 +301,8 @@ function dut_control() { # Find the EC UART on the servo v2 function ec_uart() { SERVOD_FAIL="Cannot communicate with servo. is servod running ?" - ($DUT_CONTROL_CMD ${MCU}_uart_pty || \ + ($DUT_CONTROL_CMD raw_${MCU}_uart_pty || \ + $DUT_CONTROL_CMD ${MCU}_uart_pty || \ die "${SERVOD_FAIL}") | cut -d: -f2 } @@ -342,6 +343,12 @@ function claim_pty() { "'cros_sdk --no-ns-pid' (see crbug.com/444931 for details)" fi + # Disconnect the EC-3PO interpreter from the UART since it will + # interfere with flashing. + dut_control ${MCU}_ec3po_interp_connect:off || \ + warn "hdctools cannot disconnect the EC-3PO interpreter from" \ + "the UART." + pids=$(lsof -FR 2>/dev/null -- $1 | tr -d 'pR') FROZEN_PIDS="" @@ -475,6 +482,11 @@ function flash_stm32() { if $(servo_has_warm_reset); then dut_control warm_reset:off fi + + # Reconnect the EC-3PO interpreter to the UART. + dut_control ${MCU}_ec3po_interp_connect:on || \ + warn "hdctools cannot reconnect the EC-3PO interpreter to" \ + "the UART." } function flash_stm32_dfu() { |