diff options
author | Todd Broch <tbroch@chromium.org> | 2013-03-12 09:37:47 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-03-13 13:50:27 -0700 |
commit | abc11d883c513043f2ca037ce3c79e75008d829d (patch) | |
tree | d8ed89ad6aef4f964c8e0d9c37ff35da6d8d891c | |
parent | e1c1756808dcc83b21f776dc0ce1d1c9a97e1fea (diff) | |
download | chrome-ec-abc11d883c513043f2ca037ce3c79e75008d829d.tar.gz |
stm32: Force disconnect of UART prior to writing firmware.
For chromeos devices with the stm32 EC we write the firmware via
uart. Often developers are connected to this UART for console I/O
which causes flash_ec to fail.
This change looks for any pids currently attached to the UART and
forcibly kills them prior to attempting to write the firmware.
Signed-off-by: Todd Broch <tbroch@chromium.org>
BRANCH=spring
BUG=none
TEST=manual,
./util/flash_ec --board spring ...
Forcibly grabs UART from both:
cu -l /dev/pts/<num>
minicom -p /dev/pts/<num>
Change-Id: Ie2a2b7aaf437c2cedd1d16e399c63068f2b02da3
Reviewed-on: https://gerrit.chromium.org/gerrit/45217
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
-rwxr-xr-x | util/flash_ec | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/util/flash_ec b/util/flash_ec index 3fbe203e27..2680f9e58f 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -104,6 +104,14 @@ function servo_restore() { done } +function free_pty() { + pids=$(lsof -F p 2>/dev/null -- $1 | cut -d'p' -f2) + if [ "${pids}" != "" ]; then + kill -9 ${pids} + info "You'll need to re-launch console on $1" + fi +} + # Board specific flashing scripts function flash_daisy() { @@ -118,6 +126,7 @@ function flash_daisy() { fi info "Using serial flasher : ${STM32MON}" + free_pty ${EC_UART} dut_control uart1_en:on dut_control uart1_parity:even |