]> git.baikalelectronics.ru Git - uboot.git/commit
tools: kwboot: Improve retrying logic for incomplete xmodem packets
authorPali Rohár <pali@kernel.org>
Tue, 25 Jan 2022 17:13:02 +0000 (18:13 +0100)
committerStefan Roese <sr@denx.de>
Mon, 31 Jan 2022 09:23:38 +0000 (10:23 +0100)
commit520b94aa6ba4709164eba790808b143474ee0da8
treeae41ab3ae33acdd9c4c9f57eea65f965c0e536c6
parent031100c0af838882f7b5c0b0b48d66b40a60c9f3
tools: kwboot: Improve retrying logic for incomplete xmodem packets

Sometimes if the first byte of xmodem packet (SOH) is incorrectly
transmitted, BootROM sends NAK for every non-SOH received byte, which
makes BootROM and the host kwboot tool out of sync. BootROM automatically
re-synchronizes after 2s pause by dropping its input queue. So when
attempting retransmit for 9th time or later, ignore NAK reply from BootROM
and either wait for valid ACK or let kwboot timeout, which implies
re-synchronization.

This fixes retransmission of xmodem packets and allows kwboot to work also
without "Waiting ... and flushing tty" code which is at the beginning of
kwboot xmodem transfer.

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