diff options
author | Craig Hesling <hesling@chromium.org> | 2021-06-10 15:55:35 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-12 02:32:21 +0000 |
commit | 26fe6f3c1269da1e66fdf99edaeb09e1758b34b4 (patch) | |
tree | 2be64051bea55bc6266de15e6237c0f207f6ff57 /util | |
parent | 923c231f6a6b5d6897a6de3beb21fa9ee012d589 (diff) | |
download | chrome-ec-26fe6f3c1269da1e66fdf99edaeb09e1758b34b4.tar.gz |
flash_fp_mcu: Abort if raw driver bind fails
This helps simplify the errors being reported.
BRANCH=none
BUG=b:190744837
TEST=# On Hatch and Zork
scp util/flash_fp_mcu ${DUT_HOSTNAME}:/usr/local/bin/flash_fp_mcu
ssh ${DUT_HOSTNAME} flash_fp_mcu --hello
Change-Id: I74d57ec0d7fc4bda3fae144fe649124af5c61ba9
Signed-off-by: Craig Hesling <hesling@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2954919
Reviewed-by: Patryk Duda <patrykd@google.com>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/flash_fp_mcu | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/util/flash_fp_mcu b/util/flash_fp_mcu index 180f238e1a..a2f7b118a8 100644 --- a/util/flash_fp_mcu +++ b/util/flash_fp_mcu @@ -334,6 +334,11 @@ flash_fp_mcu_stm32() { warn_gpio "${gpio_nrst}" 0 \ "WARNING: One of the drivers changed NRST pin state on bind attempt." + if [[ ! -c "${device}" ]]; then + echo "Failed to bind raw device driver." >&2 + return "${EXIT_RUNTIME}" + fi + local attempt=0 local cmd_exit_status=1 local cmd="stm32mon ${stm32mon_flags}" |