In addition to the flow-control issues (which others have addressed), the Ward Christensen
protocol (as used by XMODEM) detects a timeout when no response is received.
XMODEM tries to maximise throughput by buffering each received "sector" into the available
memory before writing it to the disk device. Small files which fit within the buffer can be
received fine, but the larger ones can fail when the time it takes to write out the buffer
exceeds the XMODEM timeout. Usually this results in sending a NAK character to get
the other end to re-send the last sector - when it should send an ACK after writing the
buffer to the disk file.
You could play with setting a longer time-out (by adjusting it with XMODEM's CPU speed
option /Zn) - but I have been able to make a non-working large file transfer succeed by
reducing the buffer space used by XMODEM (which makes the write to disk flushing
work quicker).
For XMODEM V2.7 the bufferspace is between the end of the program and the BDOS.
As a quick fix you can find where the BDOSA+1 is referenced in the source-code (there
are two places) and either hard-code an upper limit or (as I have done) halve the value.
e.g.
where the test for end of buffer uses -
lda BDOSA+1 ;high byte of BDOS
cmp h ;full buffer?
replace this with
lda BDOSA+1
ora a ; Clear carry and shift to divide by 2
rar
cmp h
and again later in the FILBF1 routine
replace
lda BDOSA+1 ;High byte of BDOS address
cmp d
with
lda BDOSA+1
ora a
rar
cmp d
then rebuild a new XMODEM.
This fixed my issue with a slow SPI connected Arduino microSD file system that
would take more than 15 seconds to write out 50 Kbytes of buffer. It now takes
about 8 seconds to write 25 Kbytes - well within the timeout margin.
Tony