From b9e95e96927982e4d9beb1100b348cceb06e4849 Mon Sep 17 00:00:00 2001 From: Wai-Hong Tam Date: Mon, 30 Oct 2017 15:51:15 -0700 Subject: [PATCH] flash_ec: Get the path of EC UART PTY only in flash_stm32 Flashing STM32 requires the EC UART. The path of EC UART PTY was originally set under some conditions which didn't reflect the case. Instead of fixing these conditions, this change simply moves it inside flash_stm32() as other flash functions don't need EC UART PTY. BRANCH=none BUG=b:67010776 TEST=Used servo-micro to flash_ec a STM32 EC, no error on getting EC UART PTY. Change-Id: I20c31de8e6c7a99fde259f4f397e53325ee80b07 Signed-off-by: Wai-Hong Tam Reviewed-on: https://chromium-review.googlesource.com/745101 Reviewed-by: Aseda Aboagye Reviewed-by: Nick Sanders --- util/flash_ec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/util/flash_ec b/util/flash_ec index 2645569cd3..a78e983d40 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -677,11 +677,13 @@ fi function flash_stm32() { TOOL_PATH="${EC_DIR}/build/${BOARD}/util:$PATH" STM32MON=$(PATH="${TOOL_PATH}" which stm32mon) + EC_UART="$(servo_ec_uart)" if [ ! -x "$STM32MON" ]; then die "no stm32mon util found." fi info "Using serial flasher : ${STM32MON}" + info "${MCU} UART pty : ${EC_UART}" claim_pty ${EC_UART} if [[ "${SERVO_TYPE}" =~ "servo" ]] ; then @@ -826,9 +828,6 @@ IMG="$(ec_image)" info "Using ${MCU} image : ${IMG}" if ! on_raiden && [ "${NEED_SERVO}" != "no" ] ; then - EC_UART="$(servo_ec_uart)" - info "${MCU} UART pty : ${EC_UART}" - save="$(servo_save)" fi