Improve handling serial port feedback in different modes of operation
The recently introduced capability of accessing the DUT CPU console
UART to confirm status of write operation backfired in certain modes
of operation: when there is no servo or when flash programming is not
required.
This patch prevents attempts to receive UART feedback when it is not
provided.
BUG=None
TEST=manual
. the following command previously failed reporting target dead, it
now passes.
cros_bundle_firmware -b daisy -d exynos5250-snow -w usb -v 3
.unittest still passes
$ FEATURES=test sudo -E emerge cros-devutils
. command expecting UART console feedback also still passes
$ cros_write_firmware -b daisy -w usb -d exynos5250-snow -F spi -i \
/tmp/3690/image-snow.bin -V
Change-Id: Iaeba35d37fad9cca97bcf6f37fab839d23fe48e0
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43582
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/host/lib/write_firmware.py b/host/lib/write_firmware.py
index c9e1623..e15ea01 100644
--- a/host/lib/write_firmware.py
+++ b/host/lib/write_firmware.py
@@ -373,7 +373,7 @@
"""
if self._servo_port is None:
return '' # User has requested not to use servo
- elif self._servo_port:
+ if self._servo_port:
args.extend(['-p', '%s' % self._servo_port])
return self._tools.Run('dut-control', args)
@@ -602,8 +602,9 @@
args += ['dut_hub_sel:%s' % preserved_dut_hub_sel]
self.DutControl(args)
- self._out.Notice('Image downloaded - please see serial output '
- 'for progress.')
+ if flash_dest is None:
+ self._out.Notice('Image downloaded - please see serial output '
+ 'for progress.')
return True
def _GetDiskInfo(self, disk, item):
@@ -829,7 +830,9 @@
if not ok:
raise CmdError('Image upload failed - please check board connection')
output.Progress('Image uploaded, waiting for completion')
- write.WaitForCompletion()
+
+ if flash_dest is not None and servo != 'none':
+ write.WaitForCompletion()
output.Progress('Done!')
finally: