summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNamyoon Woo <namyoon@chromium.org>2020-01-30 09:43:27 -0800
committerCommit Bot <commit-bot@chromium.org>2020-01-30 23:48:29 +0000
commite3181255263a8c5ef851bdb313d6b712a5dcd657 (patch)
treeaf782912dffb4d66f1779611a1d66c8f3edf0299
parent8acad8f93f1cd221d6f683c908a0c2f4115b2133 (diff)
downloadchrome-ec-e3181255263a8c5ef851bdb313d6b712a5dcd657.tar.gz
flash_ec: no stderr redirection in flashrom run
This patch removes stderr redirection in running flashrom to flash-size, so that flash_ec log would contain more information on error cases. It could be verbose even for success case, but flash_ec script would take the last output in number as SPI_SIZE. BUG=none BRANCH=none TEST=manually ran flash_ec with Suzy-Q and Servo_Micro on reef. - success case $ ./util/flash_ec --chip=npcx_spi --image ${IMG} --verbose INFO: EC build system didn't recognize . Assuming no baseboard. INFO: Using ccd_cr50. ... INFO: Running flashrom: sudo /usr/sbin/flashrom -p raiden_debug_spi:target=EC, serial=0580300D-91984377 --flash-size flashrom v0.9.9 : : on Linux 5.2.17-1rodete3-amd64 (x86_64) flashrom v0.9.9 : : on Linux 5.2.17-1rodete3-amd64 (x86_64) bus=0x01,address=0x43 | Cr50 INFO: Programming EC firmware image. INFO: Running flashrom: ... - failure case: servo_micro was not connected to the dut. $ ./util/flash_ec --chip=npcx_spi --image ${IMG} --verbose INFO: EC build system didn't recognize . Assuming no baseboard. INFO: Using servo_v4_with_servo_micro. ... INFO: Running flashrom: sudo /usr/sbin/flashrom -p raiden_debug_spi:serial=SNCQ03109 --flash-size flashrom v0.9.9 : : on Linux 5.2.17-1rodete3-amd64 (x86_64) flashrom v0.9.9 : : on Linux 5.2.17-1rodete3-amd64 (x86_64) bus=0x01,address=0x17 | Servo Micro No EEPROM/flash device found. ERROR: Failed to determine chip size! INFO: Restoring servo settings... dut-control --port=9999 cold_reset:off dut-control --port=9999 spi1_vref:off dut-control --port=9999 spi1_buf_en:off dut-control --port=9999 cold_reset:on dut-control --port=9999 cold_reset:off Change-Id: I642f62081e92bec68d01dcf4e2a4bb71a0131163 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2031644 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rwxr-xr-xutil/flash_ec3
1 files changed, 1 insertions, 2 deletions
diff --git a/util/flash_ec b/util/flash_ec
index 1cead158a9..870d9afe07 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -916,8 +916,7 @@ function flash_flashrom() {
info "Running flashrom:" 1>&2
echo " ${FLASHROM_GETSIZE}" 1>&2
fi
- SPI_SIZE=$(${FLASHROM_GETSIZE} 2>/dev/null |\
- grep -oe '[0-9]\+$') || \
+ SPI_SIZE=$(${FLASHROM_GETSIZE} | grep -oe '[0-9]\+$') || \
die "Failed to determine chip size!"
[[ ${SPI_SIZE} -eq 0 ]] && die "Chip size is 0!"