File transmission through serial ports between the embedded Linux System and the host
I think if I want to download something from my PC to the embedded Linux System of the Development Board, many people will first think of using network tools such as TFTP SFTP to download it from the network port. But if the network is not used, what should I do if I can only download it through the serial port? At this time, there are two tools that can help you: zmrx and zgp, and lsz and lrz. I personally think that zmrx/zgp is not stable with lsz/lrz. We recommend that you use the latter. The following describes how to use lsz/lrz.
1. Compile lrzsz and download it to the Development Board
Slave! Get two executable files, SZ, RZ (or lsz, lrz), and download them to the/bin directory of the Linux System of the Development Board.
Ii. Case 1: Windows OS for PC
If the PC is equipped with a Windows operating system, you can use the Super Terminal that comes with the system for serial communication tools. The following describes how to transfer files.
1. Development Board --> PC
Enter SZ filename on the Development Board.
On the PC, click "transfer"> "receive file" in the Super Terminal menu, select the download location and the zmodem and crash recovery protocol, and click "receive.
2. PC --> Development Board
Enter the/tmp directory on the Development Board, and then enter Rz.
On the PC, click "transfer"-> "Send File" in the Super Terminal menu, select the target file and the zmodem and the crash recovery protocol, and click "send.
Iii. Case 2: Linux for PC
If the PC uses a Linux operating system, the serial communication tool can use minicom. The following describes how to transfer files.
1. If you use minicom for the first time, you need to set minicom:
# Minicom-S
The following configuration page is displayed:
┌ ── ─ [Configuration] ── ─ ┐
│ Filenames and paths │
│ File transfer protocols │
│ Serial Port setup │
│ Modem and dialing │
│ Screen and keyboard │
│ Save setup as DFL │
│ Save setup as .. │
│ Exit │
│ Exit from minicom │
└ ── ─
Select Serial Port setup. See the following options:
A-serial device:/dev/ttys0
B-lockfile location:/var/lock
C-calling program:
D-callout program:
E-bps/PAR/bits: 115200 8n1
F-hardware Flow Control: No
G-software flow control: No
Change with setting?
Enter the corresponding letter to enter the corresponding option. Set the value of option A to/dev/ttys0 to serial port 1, set Option E to 115200, and set option F to no (Please configure according to the actual situation ).
You can set the default upload/download directory, transmission protocol parameters, serial port baud rate, and so on in the initialization settings. after setting, select Save setup as DFL and save it as the default setting. select "exit", Press ctrl-A, and then press Z to enter the main interface of minicom:
Welco┌─────────────────────────────────┐
│ Minicom Command Summary │
OPTIO│ │
Compi│ Commands can be called by CTRL-A
│
│ │
Press│ Main Functions Other Functions │
│ │
│ Dialing directory..D run script (Go)....G | Clear Screen.......C │
│ Send files.........S Receive files......R | cOnfigure Minicom..O │
│ comm Parameters....P Add linefeed.......A | Suspend minicom....J │
│ Capture on/off.....L Hangup.............H | eXit and reset.....X │
│ send break.........F initialize Modem...M | Quit with no reset.Q │
│ Terminal settings..T run Kermit.........K | Cursor key mode....I │
│ lineWrap on/off....W local Echo on/off..E | Help screen........Z │
│ | scroll Back........B │
│ │
│ Select function or press Enter for none. │
│ │
│ Written by Miquel van Smoorenburg 1991-1995 │
│ Some additions by Jukka Lahtinen 1997-2000 │
│ i18n by Arnaldo Carvalho de Melo 1998 │
└──────────────────────────────────┘
CTRL-A Z for help | 38400 8N1 | NOR | Minicom 2.00.0 | VT102 | Offline
2. Development Board --> PC
Enter SZ filename on the Development Board, and a transmission interface will appear. After the transfer is completed, you can find this file in the default download directory you set.
3. PC --> Development Board
Enter the/tmp directory on the Development Board, and then enter Rz.
Press ctrl-A and then press s to display a file selection interface. Select the file you want to transfer and press enter to display a transmission interface, after the transfer is complete, you can find this file in the/tmp directory of the Development Board.