安装配置minicom并实现通过minicom传输文件

简介:
参考文献:
操作系统:ubuntu10.04
交叉编译器:arm-linux-gcc-4.1.1
一、安装配置minicom
1、安装minicom
lingd@ubuntu:~$  sudo apt-get install minicom
2、配置minicom
lingd@ubuntu:~$  sudo minicom -s
      出现这样的配置界面:
            +-----[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        |
            +--------------------------+
      选择Serial port setup, 会看到这样的选项:
    +-----------------------------------------------------------------------+
    | A -    Serial Device      : /dev/ttyS0                                |
    | B - Lockfile Location     : /var/lock                                 |
    | C -   Callin Program      :                                           |
    | D -  Callout Program      :                                           |
    | E -    Bps/Par/Bits       : 115200 8N1                                |
    | F - Hardware Flow Control :  No                                         |
    | G - Software Flow Control : No                                        |
    |                                                                       |
    |    Change which setting?                                              |
    +-----------------------------------------------------------------------+
输入前面对应的字母即可进入相应的选项。将选项A的值设置为/dev/ttyS0 表示是串口1,将选项E的值设置为115200,将选项F设置为NO(请根据实际情况配置).
     设置默认上传/下载的目录, 选择Filenames and paths , 会看到这样的选项:
    +-----------------------------------------------------------------------+
    | A - Download directory :  /home/lingd/arm/download                      |
    | B - Upload directory   : /home/lingd/arm/upload                       |
    | C - Script directory   :                                              |
    | D - Script program     : runscript                                    |
    | E - Kermit program     :                                              |
    | F - Logging options                                                   |
    |                                                                       |
    |    Change which setting?                                              |
    +-----------------------------------------------------------------------+
注意:开发板发送给pc的文件将保存在Download directory所设定的目录中,而pc要下载到开发板的文件保存在Upload directory所设定的目录中
     设置完成后, 选择”Save setup as dfl”,保存为默认设置.
然后选择“Exit”,即可进入Minicom的主界面:
Welcome to minicom 2.4

OPTIONS: I18n 
Compiled on Jan 25 2010, 06:49:09.
Port /dev/ttyS0

Press CTRL-A Z for help on special keys              
                                                     
按Ctrl-A,再按z,可以获取到minicom CTRL-A命令的帮助信息
Welco+-------------------------------------------------------------------+
     |                     Minicom Command Summary                       |
OPTIO|                                                                   |
Compi|          Commands can be called by CTRL-A <key>                   |
Port |                                                                   |
     |               Main Functions                  Other Functions     |
Press|                                                                   |
     | 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 |
     | Paste file.........Y                       | 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 |115200 8N1 | NOR | Minicom 2.4    | VT102 |      Offline   
其中,我们用CTRL-A s来发送文件给开发板;而用CTRL-A r来接收开发板上的文件
二、为pc安装lrzsz
lrzsz is a unix communication package providing the XMODEM, YMODEM ZMODEM file transfer protocols.
lingd@ubuntu:~$  sudo apt-get install lrzsz
三、交叉编译lrzsz并下载到开发板上
1、下载lrzsz源码包
到http://download.chinaunix.net/download/0007000/6293.shtml,下一个lrzsz的tar包,
2、解压缩后,到解压目录中执行./configure
lingd@ubuntu:~/arm$  tar -zxf lrzsz-0.12.20.tar.gz 
lingd@ubuntu:~/arm$  cd lrzsz-0.12.20/
lingd@ubuntu:~/arm/lrzsz-0.12.20$  ./configure 
creating cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... missing
checking for working autoconf... missing
checking for working automake... missing
checking for working autoheader... missing
checking for working makeinfo... missing
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking how to run the C preprocessor... gcc -E
checking whether gcc needs -traditional... no
checking for ranlib... ranlib
checking for POSIXized ISC... no
checking for AIX... no
checking for minix/config.h... no
checking for gcc option to accept ANSI C... none needed
checking for function prototypes... yes
checking for working const... yes
checking for inline... inline
checking for syslog in -lsocket... no
checking for syslog in -lbe... no
checking for gethostbyname in -lnsl... yes
checking for ANSI C header files... yes
checking for fcntl.h... yes
checking for limits.h... yes
checking for sys/ioctl.h... yes
checking for sys/time.h... yes
checking for unistd.h... yes
checking for sys/times.h... yes
checking for termios.h... yes
checking for sys/termios.h... yes
checking for termio.h... yes
checking for sys/termio.h... no
checking for sgtty.h... yes
checking for termios.h... (cached) yes
checking for sys/termios.h... (cached) yes
checking for termio.h... (cached) yes
checking for sys/termio.h... (cached) no
checking for sgtty.h... (cached) yes
checking for sys/mman.h... yes
checking for utime.h... yes
checking for syslog.h... yes
checking for sys/syslog.h... yes
checking for sys/param.h... yes
checking for sys/select.h... yes
checking for strings.h... yes
checking for arpa/inet.h... yes
checking for size_t... yes
checking for mode_t... yes
checking for off_t... yes
checking for speed_t... yes
checking for st_rdev in struct stat... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether sys/time.h and sys/select.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for errno declaration... yes
checking whether setvbuf arguments are reversed... no
checking return type of signal handlers... void
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for gettimeofday... yes
checking for settimeofday... yes
checking for strchr... yes
checking for memcpy... yes
checking for select... yes
checking for vprintf... yes
checking for times... yes
checking for rdchk... no
checking for utime... yes
checking for syslog... yes
checking for siginterrupt... yes
checking for mkdir... yes
checking for mktime... yes
checking for strerror... yes
checking for strstr... yes
checking for strdup... yes
checking for strtoul... yes
checking for strtol... yes
checking for strpbrk... yes
checking for stpcpy... yes
checking for strftime... yes
checking for vasprintf... yes
checking for getopt_long... yes
checking for ftime... yes
checking that ftime works correctly... yes
checking for timezone variable... yes
checking for LOG_UUCP... yes
checking for argz.h... yes
checking for limits.h... (cached) yes
checking for locale.h... yes
checking for nl_types.h... yes
checking for malloc.h... yes
checking for string.h... yes
checking for unistd.h... (cached) yes
checking for values.h... yes
checking for sys/param.h... (cached) yes
checking for getcwd... yes
checking for munmap... yes
checking for putenv... yes
checking for setenv... yes
checking for setlocale... yes
checking for strchr... (cached) yes
checking for strcasecmp... yes
checking for __argz_count... yes
checking for __argz_stringify... yes
checking for __argz_next... yes
checking for LC_MESSAGES... yes
checking whether NLS is requested... yes
checking whether included gettext is requested... no
checking for libintl.h... yes
checking for gettext in libc... yes
checking for msgfmt... /usr/bin/msgfmt
checking for dcgettext... yes
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for catalogs to be installed...  de
updating cache ./config.cache
creating ./config.status
creating Makefile
creating intl/Makefile
creating lib/Makefile
creating testsuite/Makefile
creating man/Makefile
creating po/Makefile.in
creating src/Makefile
creating debian/rules
creating Specfile
creating systype
creating src/lrzszbug
creating config.h
3、修改Makefile
有三个Makefile需要修改,分别是 ~/arm/lrzsz-0.12.20/Makefile、~/arm/lrzsz-0.12.20/lib/Makefile、~/arm/lrzsz-0.12.20/src/Makefile
lingd@ubuntu:~/arm/lrzsz-0.12.20$  vi Makefile
lingd@ubuntu:~/arm/lrzsz-0.12.20$  vi lib/Makefile
lingd@ubuntu:~/arm/lrzsz-0.12.20$  vi src/Makefile
将这三个Makefile中的所有gcc替代成你开发板所需要的交叉编译器,如arm-linux-gcc
即:
CC = gcc
CPP = gcc -E
都改成
CC = arm-linux-gcc
CPP = arm-linux-gcc -E
4、编译
lingd@ubuntu:~/arm/lrzsz-0.12.20$  make
在lrzsz-0.12.20/src目录下会生成两个可执行文件lsz、lrz(或者sz、rz),把它们下载到开发板linux系统的/bin目录下。
lingd@ubuntu:~/arm/lrzsz-0.12.20$  cd src
lingd@ubuntu:~/arm/lrzsz-0.12.20/src$ ls
ansi2knr.1   lrz          lsyslog.o    Makefile.in  tcp.o      zm.o
ansi2knr.c  lrz.c         lsz          protname.c   timing.c   zmodem.h
canit.c     lrz.o        lsz.c        protname.o   timing.h   zperr.c
canit.o     lrzszbug     lsz.o        rbsb.c       timing.o   zperr.o
crctab.c    lrzszbug.in  Makefile     rbsb.o       zglobal.h  zreadline.c
crctab.o    lsyslog.c    Makefile.am  tcp.c        zm.c       zreadline.o
四、测试
1、开发板-->PC机
在开发板上输入  lsz filename ,然后会出现一个传输界面,传输完成后可以在你设置的默认下载目录Download directory里找到这个文件。
2、PC机-->开发板
在开发板上先进入/tmp 目录,然后输入lrz。
# cd /tmp
# lrz                                                                         
�z waiting to receive.**B0100000023be50
按Ctrl-A,再按s,选择zmoden,会出现一个选择文件的界面,选择你要传输的文件(按一下空格键选择目录,按两下空格键进入目录),回车后出现一个传输界面,传输完成后,便可以在开发板的/tmp目录下找到这个文件了。



本文转自wanqi博客园博客,原文链接: http://www.cnblogs.com/wanqieddy/archive/2011/07/14/2106087.html 如需转载请自行联系原作者
相关文章
|
12月前
|
Ubuntu 虚拟化
Ubuntu安装VMtools实现与主机之间复制粘贴
一、安装 VMware Tools 右键点击你创建的系统,然后出现菜单下滑找到安装 VMware Tools(T) 这个点击安装; 右键点击你创建的系统,然后出现菜单下滑找到设置; 然后弹出虚拟机设置-->点击选项-->客户机隔离-->启用复制粘贴; 二、Ubuntu命令 这些命令假设你的Ubuntu系统已连接到互联网并且已配置为使用apt软件包管理器; 如果你的网络环境有限,你可能需要提前配置好网络或更换软件源; Ubuntu上安装和配置VMtools以实现与主机之间的文本复制粘贴功能; 1、打开终端(Terminal)。 2、运行以下命令以卸载旧版本的open-vm-tools: su
728 1
|
5月前
|
网络协议 Linux
Linux系统安装TFTP服务器
tftp是TCP/IP协议族中的一个用来在客户机与服务器之间进行简单文件传输的协议,提供不复杂、开销不大的文件传输服务,可用于UDP环境,具有使用灵活和内存占用小的优点,默认端口号为69。本篇文章将介绍如何在CentOS7上安装tftp服务器。
79 0
|
Linux 网络安全 iOS开发
mac使用lrzsz传输文件(iterm2)
mac使用lrzsz传输文件(iterm2)
1248 0
|
Ubuntu Unix Linux
【虚拟终端工具】SecureCRT工具连接虚拟机、rz/sz传输、中文乱码问题解决
【虚拟终端工具】SecureCRT工具连接虚拟机、rz/sz传输、中文乱码问题解决
462 0
【虚拟终端工具】SecureCRT工具连接虚拟机、rz/sz传输、中文乱码问题解决
|
Linux 数据安全/隐私保护
通过jumpserver传输文件到linux服务器
通过jumpserver传输文件到linux服务器
2072 0
通过jumpserver传输文件到linux服务器
排错集02——PXE装机时客户机出现”boot:"提示符,需要敲回车键才会下载安装文件。如何才能让客户机自动下载,不需要用户操作?
一、现象 使用PXE网络装机时,客户机下载default文件后,会出现 “boot:" 提示符,此时需要用户手动敲回车键(Enter键)启动引导参数,或输入引导入口的名称。
303 0
【解决】树莓派3B+自带的VNC版本不能进行文件传输
【解决】树莓派3B+自带的VNC版本不能进行文件传输
664 0
【解决】树莓派3B+自带的VNC版本不能进行文件传输
minicom
minicom
81 0
|
Linux 网络安全 网络架构
关于开发板用tftp下载失败分析
一、想实现开发板和PC ping通:(1)windows和linux桥接(2)用路由器将开发板和PC连接起来(3)将windows和linux以及开发板的IP设置成同一网段,注意不要和你同一个局域网的IP重复(4)关闭linux的防火墙以及SELinux(5)关闭windows的防火墙   二、关于开发板用tftp下载内核文件1.windows和VM的虚拟机之间用桥接,2.开发板和路由器之间用网线连接,PC和路由器之间用网线连接。
1726 0
|
Linux 虚拟化 Windows
通过minicom传送文件的相关配置及使用方法
写一下我使用串口向开发板传送文件中遇到的问题及解决办法: 使用的软硬件环境: 虚拟机:VMware® Workstation 8.0.1 Linux操作系统:Fedora 9 开发板:mini6410   下面使用通过串口终端minicom传送文件到开发板上: 1. USB 串口无法识别的问题: 我的笔记本没有RS232接口,只好用USB转串口,再通过开发板配套的一根交叉串口线连接到开发板上。
997 0