1

I am trying to communicate with a microcontroller over the ancient (but simple) XMODEM protocol. The two ways that I have found of sending a file are through minicom (interactive) and through cx (non-interactive). However, payload size cannot be specified (defaults to 128 bytes), while the chip is expecting 64 bytes.

Is there a way, using commands from Ubuntu repos, makefiles or even bash scripts, to send non-interactively a file over XMODEM with payload of 64 bytes? Also, short checksum(1 byte) must be supported.

Vorac
  • 3,077

1 Answers1

1

The source code for a good free-software xmodem implementation is available in the lrzsz package. You could hack the source and build your own custom version of sx with 64-byte packets.

https://ohse.de/uwe/software/lrzsz.html

Note, however, that xmodem was designed for 128 byte packets (i don't recall ever hearing of an implementation with smaller packet sizes) because files were always a multiple of 128 bytes in size on CP/M back in 1977. See https://en.wikipedia.org/wiki/XMODEM

cas
  • 78,579
  • Indeed, after I went to bed I realized that the 128 bytes are a constant in the standard. On another note, how do I use lrzsz? lrzsz is already the newest version. but lrzsz: command not found. – Vorac Oct 29 '15 at 06:44
  • lrzsz is the name of the entire software package. It includes sz, and sx commands for sending via zmodem and xmodem. and rz, rx for receiving. See man sx for more details. – cas Oct 29 '15 at 06:46
  • I changed the payload length at the receiver and am now receiving files successfully. However, I can't seem to set the baudrate of sx. – Vorac Oct 29 '15 at 06:56