diff options
author | Aseda Aboagye <aaboagye@google.com> | 2015-12-18 14:53:39 -0800 |
---|---|---|
committer | ChromeOS bot <3su6n15k.default@developer.gserviceaccount.com> | 2016-02-18 19:20:44 +0000 |
commit | 84c5169b10576536ee8df93bf086da632b18b457 (patch) | |
tree | 826ea3507bc4718d91c23fd94919705dd26dd6e9 | |
parent | 6d5343e8cd28b1e97a964ae1a99dd3ba8adc51aa (diff) | |
download | chrome-ec-84c5169b10576536ee8df93bf086da632b18b457.tar.gz |
flash_ec: Disconnect EC-3PO interps when flashing.
Due to the recent changes for EC-3PO in servod, flash_ec needs to be
modified in the same way that was done for ToT.
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
BUG=chromium:587600
BRANCH=strago
TEST=Tested same patch on other branches to flash stm32 ECs.
Change-Id: Iaa801eecde95aeb82375fb6a7466b1c2d2d03478
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/328370
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@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 76521ae17a..10b0e823d9 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -263,7 +263,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 } @@ -304,6 +305,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." + FROZEN_PIDS=$(lsof -FR 2>/dev/null -- $1 | tr -d 'pR') # reverse order to SIGSTOP parents before children @@ -367,6 +374,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() { |