scripts: kwboot: try to resync on packet boundary after receiving a NAK
If we sent the boot message too often the CPU might already have started
to interpret this as an xmodem packet. As sender and receiver are not in
sync it's impossible to transfer a packet successfully.

So when we get a NAK send '\xff' bytes until the receiver reaches the
packet boundary. When we send too many the SoC replies with a NAK for
each byte and doesn't interpret it as the start of a new package (which
must start with SOH == '\x01').

A slower alternative would be to wait for another NAK which is sent when
reception of the already started packet times out.

This was tested on an Armada XP based machine with bootrom version 1.20.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 1a43860 commit 331391d686ad87915a69a686220f01a20a7fd8e1
@Uwe Kleine-König Uwe Kleine-König authored on 4 Oct 2016
Sascha Hauer committed on 4 Oct 2016
Showing 1 changed file
View
scripts/kwboot.c