diff options
author | Brian J. Nemec <bnemec@chromium.org> | 2019-05-22 14:52:08 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-05-30 16:57:50 -0700 |
commit | 4fcbc594e541adbdff4a61b1fd1306741d135169 (patch) | |
tree | c1eeb0969337cec9133b024fbf67738d77fc2a8c | |
parent | 6f37f1fe24ea647ee04a55a3195c34d9b0dcae79 (diff) | |
download | chrome-ec-4fcbc594e541adbdff4a61b1fd1306741d135169.tar.gz |
Adds filtering of the STM32 DFU devices to eliminate devices with
DFU's 'Runtime' identifier.
Some USB devices include the DFU Runtime descriptor during normal use.
These devices are detected as potential targets by DFU-UTIL causing it to
incorrectly identify multiple potential DFU targets leading to errors
while flashing. This change adds an additional requirement using the
device's expected vendor:product id to select the correct device.
BUG=b:133329195
BRANCH=none
TEST=Verified DFU with STM32 based devices: Servo_v4, Servo_Micro, and
Sweetberry flash as expected. Verified that the awk correctly extracts
and eliminates devices with the DFU's Runtime identifier when a
suitable device connects. Verified pattern matching on variations of
the serial.
Signed-off-by: Brian Nemec <bnemec@chromium.org>
Change-Id: I2331b5e06d2eebf8dc28f20b9dd6b10bf2abe02a
Reviewed-on: https://chromium-review.googlesource.com/1626650
Commit-Ready: Todd Broch <tbroch@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
-rwxr-xr-x | util/flash_ec | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/flash_ec b/util/flash_ec index 7bb5a463f4..f1a4b17d6b 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -1030,13 +1030,13 @@ function flash_stm32_dfu() { SIZE=$(wc -c ${IMG} | cut -d' ' -f1) # Remove read protection - sudo timeout -k 10 -s 9 "${FLAGS_timeout}" \ - $DFU_UTIL -a 0 -s ${ADDR}:${SIZE}:force:unprotect -D "${IMG}" + sudo timeout -k 10 -s 9 "${FLAGS_timeout}" $DFU_UTIL -a 0 -d "${DFU_DEVICE}" \ + -s ${ADDR}:${SIZE}:force:unprotect -D "${IMG}" # Wait for mass-erase and reboot after unprotection sleep 1 # Actual image flashing - sudo timeout -k 10 -s 9 "${FLAGS_timeout}" \ - $DFU_UTIL -a 0 -s ${ADDR}:${SIZE} -D "${IMG}" + sudo timeout -k 10 -s 9 "${FLAGS_timeout}" $DFU_UTIL -a 0 -d "${DFU_DEVICE}" \ + -s ${ADDR}:${SIZE} -D "${IMG}" } # TODO(b/130165933): Implement a dut-control command to look up the correct |