WRITING AN EMBEDDED APPLICATION LOADER
8
LZT 123 8094 R1A
5. If everything looks ok, then the downloader appends
the bytes in the packet to the file being created (sent).
The downloader then sends an ACK byte which tells
the uploader to send the next block. If the sums do not
match then the downloader sends an NAK byte which
tells the uploader to repeat transmission of the block.
When the uploader sends an EOT byte instead of an SOH
byte the downloader sends a NAK byte. If the uploader
sends another EOT immediately after that the downloader
sends an ACK byte and the transfer is complete.
The downloader can cancel the transfer at any time by
sending a CAN byte. The uploader can only cancel
between blocks by sending a CAN byte. It is
recommended that the application send anywhere
between 2 and 8 consecutive CAN bytes when a
download cancellation is required as some programs will
not let you abort if only 1 CAN byte is sent.