Instead of using screen
, you might want to use a dedicated serial terminal emulator program, such as minicom
, since it has built-in support for the local side of serial-port binary transfer protocols like ZMODEM.
To transfer a file from local system to an ARM device, you would need to have the command-line tool for the ZMODEM protocol installed on both devices. At least on Debian, it comes in package named lrzsz
.
First, you would login to the ARM device and run the rz
(Receive Zmodem) command on it. It will output a special "waiting to receive" character sequence which can be detected by a ZMODEM-aware terminal emulator program, such as minicom
. At that point, the terminal emulator program should automatically allow you to select a file for sending to the remote ARM device. If that does not happen, you can still select the "send file using ZMODEM" (or "upload file...") function manually from your terminal emulator.
Some terminal emulators may have full internal implementation of the ZMODEM protocol, but minicom
just uses the sz
(Send Zmodem) command-line tool to do the actual file transfer, so you'll need to have the lrzsz
package installed locally too.
Transferring from the remote ARM to the local system works essentially the same: you run the sz <filename>
command at the remote end, and the incoming transfer ("download") should be automatically detected by your terminal emulator.
Since the sz
and rz
tools are designed to be used at the remote end and will transfer the file over what is essentially the standard input and output of your shell session, using the commands at the local side requires specific input/output redirections and the terminal emulator must stop reading the serial port while the file transfer program is running. All these things would make it extremely inconvenient to use the sz
/rz
tools on the local side with a program like screen
that does not have the necessary features for accommodating external file transfer tools.