Skip to content
Commit 82a9e13a authored by This contributor prefers not to receive mails's avatar This contributor prefers not to receive mails Committed by Stefan Roese
Browse files

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: default avatarPali Rohár <pali@kernel.org>
Signed-off-by: default avatarMarek Behún <marek.behun@nic.cz>
Reviewed-by: default avatarStefan Roese <sr@denx.de>
parent 8bd15fd1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment