xmodem crc16 checksum send on linux NACK because stream not flushed, RFC PATCH

Adam Lackorzynski adam at os.inf.tu-dresden.de
Wed Sep 7 21:08:33 UTC 2011


On Wed Sep 07, 2011 at 15:25:55 +0200, Domen Puncer wrote:
> Hello!
> 
> I've been having trouble uploading a file through xmodem with crc16,
> every time I got a bunch of NACKs and it just failed. After lots of
> googling, I found I'm not the only one [1] [2], and that the cause was
> that receiver sent some data which was misinterpreted ("C" chars in my
> case, which is crc16 xmodem RX prompt IIRC). Some website suggested
> "cat /dev/ttySx" just before sending the file, and that did the trick,
> so flushing was the way.
> 
> Following trivial patch flushes serial port before starting file
> transfer. I DO NOT KNOW if it has any bad effects on any transfers. I
> do know that it makes xmodem transfer work in MY case.
> Maybe someone with more experience with file transfers could comment on this?

I think any additional flushing cannot harm except making things
'slower' which does not matter here. So I applied your patch. Thanks for
your effort in debugging this!



Adam
-- 
Adam                 adam at os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/



More information about the minicom-devel mailing list