diff options
author | Mary Ruthven <mruthven@chromium.org> | 2017-03-31 15:20:24 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2017-04-06 21:50:15 +0000 |
commit | 9425636d77054b28b3c21f6e4c25824d8e44cfac (patch) | |
tree | c469f15e6383164aa7ddc01b547226a61723fb7d | |
parent | a4e4cfac9f53609962eb86ff80e4ccba4ecac6b0 (diff) | |
download | chrome-ec-9425636d77054b28b3c21f6e4c25824d8e44cfac.tar.gz |
usb_updater: fix --fwver
This change adds a send_done call at the end of show_fw_ver. With this
change Cr50 will set the state to rx_idle after every usb_update -f
call.
Cr50 cannot process any vendor commands unless the updater state is
idle. After a vendor command is sent cr50 wont set the state to idle
unless it receives a send_done call. It will also reset the state if it
sees that it has been more than 5 seconds since the last transfer.
In the current state you cannot use usb_updater -f back to back because
usb_updater doesn't call send_done through the -f path. If you wait 5
seconds between calls, then it will work. If the call fails and you keep
retrying waiting less than 5 seconds between calls, then it will fail
forever. The last transfer time will get reset with each call and Cr50
will never reach the timeout to reset the usb_update state to idle.
BUG=none
BRANCH=cr50
TEST=run 'sudo ./usb_updater -f && sudo ./usb_updater -f'. Verify both
calls succeed.
Change-Id: I5daca8e03ece840288abb61e02a528a9af0ada30
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/465491
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
(cherry picked from commit e69a10388476c963c52d99967d15362a5ce44064)
Reviewed-on: https://chromium-review.googlesource.com/470487
-rw-r--r-- | extra/usb_updater/usb_updater.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/extra/usb_updater/usb_updater.c b/extra/usb_updater/usb_updater.c index dda202690d..6318d340e2 100644 --- a/extra/usb_updater/usb_updater.c +++ b/extra/usb_updater/usb_updater.c @@ -1254,6 +1254,7 @@ int main(int argc, char *argv[]) targ.shv[0].minor); printf("RW %d.%d.%d\n", targ.shv[1].epoch, targ.shv[1].major, targ.shv[1].minor); + send_done(&td.uep); } if (data) { |