diff options
Diffstat (limited to 'util/flash_ec')
-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 2af7475668..3a6c9c6fa3 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 } @@ -137,6 +138,12 @@ function servo_restore() { function free_pty() { local pids + # 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 return @@ -188,6 +195,11 @@ function flash_stm32() { 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() { |