diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2016-11-25 12:44:06 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-11-28 20:53:53 -0800 |
commit | 56310c97bf25220c9124b97f3920ec74e67a213f (patch) | |
tree | 72298b8a196875111a7116fa19ec0442ed9b4ed3 /extra/usb_updater | |
parent | 6eae52a0944136f4745770be0233dc1bef6cd2a1 (diff) | |
download | chrome-ec-56310c97bf25220c9124b97f3920ec74e67a213f.tar.gz |
usb_updater: improve debugability
When usb update errors happen it helps a lot to be able to see the
actual error code returned by the target and where the error was
generated.
This patch adds a few printouts to help with debugging.
BRANCH=none
BUG=none
TEST=observed proper error messages generated while debugging
introduction of extension/vendor commands transfer over USB.
Change-Id: I06c77e7467f7f9547704c88c4b673866fb2e6032
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/414947
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'extra/usb_updater')
-rw-r--r-- | extra/usb_updater/usb_updater.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/extra/usb_updater/usb_updater.c b/extra/usb_updater/usb_updater.c index 67a5aec366..a1248c58f1 100644 --- a/extra/usb_updater/usb_updater.c +++ b/extra/usb_updater/usb_updater.c @@ -878,8 +878,15 @@ static void setup_connection(struct transfer_descriptor *td) if (rxed_size <= 4) { if (td->ep_type != spi_xfer) { - fprintf(stderr, "Unexpected response size %zd\n", + size_t i; + + fprintf(stderr, "Unexpected response size %zd: ", rxed_size); + + for (i = 0; i < rxed_size; i++) + fprintf(stderr, " %02x", + ((uint8_t *)&start_resp)[i]); + fprintf(stderr, "\n"); exit(update_error); } |