summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2015-12-18 14:53:39 -0800
committerChromeOS bot <3su6n15k.default@developer.gserviceaccount.com>2016-02-18 19:33:43 +0000
commitb3d4ac08d3b263f6a1937c66ff85f33b765b8325 (patch)
tree33e3563dcbbbcf23c1abfb843bb89355731f701d
parent479760d5497aefa2885d08ced17fe1df0ec9c8fb (diff)
downloadchrome-ec-b3d4ac08d3b263f6a1937c66ff85f33b765b8325.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=pit TEST=Tested same patch on other branches to flash stm32 ECs. Change-Id: Idc946f2a53d468d8e28af38a041b1ebef50f7319 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/328292 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org>
-rwxr-xr-xutil/flash_ec14
1 files changed, 13 insertions, 1 deletions
diff --git a/util/flash_ec b/util/flash_ec
index 1a418ed514..ec91a5691c 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -108,7 +108,8 @@ DUT_CONTROL_CMD="dut-control --port=${FLAGS_port}"
# Find the EC UART on the servo v2
function ec_uart() {
SERVOD_FAIL="Cannot communicate with servo. is servod running ?"
- ($DUT_CONTROL_CMD ec_uart_pty || \
+ ($DUT_CONTROL_CMD raw_ec_uart_pty || \
+ $DUT_CONTROL_CMD ec_uart_pty || \
die "${SERVOD_FAIL}") | cut -d: -f2
}
@@ -135,6 +136,12 @@ function servo_restore() {
}
function free_pty() {
+ # Disconnect the EC-3PO interpreter from the UART since it will
+ # interfere with flashing.
+ dut_control ec_ec3po_interp_connect:off || \
+ warn "hdctools cannot disconnect the EC-3PO interpreter from" \
+ "the UART."
+
pids=$(lsof -F p 2>/dev/null -- $1 | cut -d'p' -f2)
if [ "${pids}" != "" ]; then
kill -9 ${pids}
@@ -171,6 +178,11 @@ function flash_daisy() {
ec_reset
# Unprotect flash, erase, and write
${STM32MON} -d ${EC_UART} -u -e -w ${IMG}
+
+ # Reconnect the EC-3PO interpreter to the UART.
+ dut_control ec_ec3po_interp_connect:on || \
+ warn "hdctools cannot reconnect the EC-3PO interpreter to" \
+ "the UART."
}
function flash_link() {