Embedded Linux and PC serial port transfer files based on lrzsz

Embedded Linux and PC serial port transfer files based on lrzsz

Embedded Linux transfer applications usually use nfs, tftp, etc., which is more troublesome. Generally, small applications can only use serial ports for a few
kilos . Here is a way to transfer files through serial ports. lrzsz lzsz needs to be installed on the development board. The installation method is to use development The cross-compilation tool corresponding to the board compiles the lzsz source code and then puts the executable program in the bin directory of the development board file system. Here, I will take the wildfire imx6ull as an example, the cross-compilation tool arm-linux-gnueabihf-gcc

1. Compile the source code
1. Download the source code
https://www.ohse.de/uwe/software/lrzsz.html
2. Unzip the
tar -zxvf lrzsz-0.12.20.tar.gz
3. Enter the lrzsz directory and configure the compilation
. /configure --host=arm-linux --prefix=$PWD/__install CC=arm-linux-gnueabihf-gcc
modify Makefile, lib/Makefile, src/Makefile, intl/Makefile, the cross-compilation tool is arm-linux-gnueabihf -gcc
compiler
make && make installl
generates lrb lrx lrz lsb lsx lsz several executable files in the directory __install

2. Put the executable file in the bin directory of the embedded linux file system of the development board.
Here, use the u disk
1. Copy the executable files lrb lrx lrz lsb lsx lsz to the u disk, and then insert the u disk into the development board
2. Mount the USB disk
mount /dev/sda1 /mnt
3. Copy files to bin
cp lrb lrx lrz lsb lsx lsz /bin

3. Test and use
Preparation: Use SecureCRT on windows and open the serial port

1. Windows transfer to the development board:
Enter lrz on SecureCRT, the tool will automatically pop up to select the file to be transferred, click OK and wait for the file transfer to complete

2.
Transfer the development board to windows SecureCRT and enter the lsz file name, then click on the tool to transmit-receive assic, and then select the receiving location

Guess you like

Origin blog.csdn.net/u010835747/article/details/108482902