[Linux] Using Minicom to transfer data between Host and Development board(platform)

Minicom is a text-based modem control and terminal emulator program for Unix-like operating systems. It is a serial communication program that connects to devices through a GNU/Linux PC's serial ports.
OS:ubuntu16.04
Cross compiler:arm-linux-gcc
# Host
1. Install minicom in Host
sudo apt-get install minicom
Setting minicom
sudo minicom -s
You’ll see a response similar to:

Serial port setup
A — Serial Device : your serial device
(you can list the devices by: ls /dev/tty*)
E — Bps/Par/Bits : setting the baud rate
F — Hardware Flow Control : No
you’ll see a response similar to:

Filenames and paths
A — Download directory : directory which from platform to host
B — Upload directory : directory which from host to platform
you’ll see a response similar to:

After all you done, select Save setup as df to be default. Than select Exit to into Minicom.
Ctrl-A, and z
, show the minicom command summary. You’ll see a response similar to: (Press CTRL-A Z for help on special keys)

Now, you can use Minicom to send or receive data in your host.
CTRL-A, and s: send a data from host to platform
CTRL-A, and r: receive a data from platform to host
2. Install lrzsz and build in Host
lrzsz is a unix communication package providing the XMODEM, YMODEM ZMODEM file transfer protocols.
sudo apt-get install lrzsz
download lrzsz source code:
decompression lrzsz-0.12.20.tar.gz: tar -zxf lrzsz-0.12.20.tar.gz
go to lrzsz dir: cd lrzsz-0.12.20/
run configure: ./configure
Modify Makefile
lrzsz-0.12.20/Makefile
lrzsz-0.12.20/lib/Makefile
lrzsz-0.12.20/src/Makefile
Replace gcc with the cross compiler required by the development board. In my case, I am using the NXP i.MX 8M Mini witch is arm-linux:
CC = gcc
CPP = gcc -E
replace “gcc” with “arm-linux-gcc”:
CC = arm-linux-gcc
CPP = arm-linux-gcc -E
then, make it: make
you will find “lsz” and “lrz” in path: lrzsz-0.12.20/src, you’ll see a response similar to:

copy lsz and lrz from Host to development board’s dir: /bin
# Platform
3. Test
send a data from host to platform:
cd /tmp
lrz
You’ll see a response similar to:

CTRL-A, and s
select zmoden, and enter


Escape to exit, Space to tag, Space*2 to enter.
send a data from platform to host:
lsz filename
You will see the file in Download directory you set before.