Serial Port transfer File Lrzsz

Source: Internet
Author: User
Tags file transfer protocol

Suppose there is a development environment, a board, in addition to the serial port, no external access to the output device, no SD card, no network cable, this time if you want to communicate with this board of interactive files, how to do?

According to the file Transfer protocol used by modem: Xmodem,ymodem,zmodem classify it

Xmodem: Simple and general, transmission information Unit is "packet =128b", transmission speed is slow, suitable for the poor quality of the telephone line in the case of
Ymodem: From Xmodem evolution, high efficiency and reliability, package =128*8b; one transmission can send or receive several files

Zmodem: Send data in two different, continuous streams, more efficient

In Ubuntu host can directly use RZ or SZ command and SECURECRT Interactive file

BusyBox provides RX command in the Development Board to directly xmodem download files to the Development Board, but no upload commands are found

Command:

RZ Download Zmodem

XZ Upload Zmodem

Rx Download Zmodem

If you want to upload a file in the Development Board, you can migrate the full version of the Lrzsz to the Development Board, the full use of its functions

One, porting the LRZSZ to the Development Board

The Lrzsz tool is quite practical in conjunction with SECURECRT and is now transplanted to Arm-linux

Explain the environment:

PC ubuntu12.4

Cross-compile ARM-LINUX-GCC

--1--Get the source code

Http://www.ohse.de/uwe/software/lrzsz.html

Get lrzsz-0.12.20.tar.gz

--2--Decompression Source

Tar-xzf lrzsz-0.12.20.tar.gz

--3--generating the cache file

./configure--host=arm-linux--cache-file=./arm-linux.cache

At this time, the./arm-linux.cache file should be generated in the directory

--4--Modifying configurations

VI Arm-linux.cache

Will

ac_cv_prog_cc=${ac_cv_prog_cc= ' GCC '}

Change into

ac_cv_prog_cc=${ac_cv_prog_cc= ' ARM-LINUX-GCC '}

--5--using the cache file to configure the source code

./configure--host=arm-linux--cache-file=./arm-linux.cache

--6--compiling source code

Make

Note: Problems that may occur: Zglobal.h:188:22:error:libintl.h:no such file or directory

Note: Problems that may arise: warning:incompatible implicit declaration of built-in function ' GetText '

Workaround:

VI config.h

Modify/* Define to 1 if NLS is requested. */
#define ENABLE_NLS 1

For

#define ENABLE_NLS 0

--6--Get Tools

The Lrz and LSZ tools under the Src/folder are the successful Lrzsz tools for cross-compiling

--7--Practical

Copy the Lrz and LSZ to the board/bin, you can use, of course, with SECURECRT

One, the use of Lrzsz through the serial port and SECURECRT transfer files

--1--SECURECRT settings, in the case of the serial port need to open the Xon/xoff flow control mechanism

Session options, serial---flow control->xon/xoff Hook, and then restart the session

Session options, Terminal->x/y/zmodem-> Directory Select the directory you want to store (I chose the desktop)

--2--Uploading Files

Terminal Input LRZ command automatically pop-up Select File dialog box, select to Start transfer

$./lrz

--2--Download File

Enter lsz+ file name in terminal

$./lsz < file name >

--3--simple download file via Rx in BusyBox

If there is no external interface at all, even the lrzsz can not be poured in. Or just want to download the transfer files, do not need to upload the situation, you can use the RX command in busybox simple download files

Enter the name rx+ to save in the terminal, such as $rx Redmin.txt

Then send the xmodem-> select Redmin.txt file to send data in the terminal sent File menu, transmission


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Serial Port transfer File Lrzsz

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.