]> git.baikalelectronics.ru Git - uboot.git/commit
tools: kwboot: Resend first 3 xmodem retry packets immediately
authorPali Rohár <pali@kernel.org>
Mon, 25 Oct 2021 13:13:04 +0000 (15:13 +0200)
committerStefan Roese <sr@denx.de>
Wed, 3 Nov 2021 05:45:27 +0000 (06:45 +0100)
commitec4048274287f533e9141ba54c85bbd0f486cae5
tree60146f484fccfef7fffe97b0d08a3a38ee8f73c4
parent7b7f9748024d2b9e48f979cce7fc13cff895dd60
tools: kwboot: Resend first 3 xmodem retry packets immediately

Currently when kwboot receive some garbage reply which does not understand,
it waits 1s before it tries to resend packet again.

The most common error on UART is that receiver sees some bit flipped which
results in invalid reply.

This behavior slows down xmodem transfer over UART as basically on every
error kwboot is waiting one second.

To fix this, try to resend xmodem packet for first 3 attempts immediately
without any delay. If broken reply is received also after the 3 attempts,
continue retrying with 1s delay like it was before.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
tools/kwboot.c