红联Linux门户
Linux帮助

ubuntu 12.04 TTL线连接cubieboard 3

发布时间:2015-09-02 15:43:20来源:linux网站作者:alifrank

连线方式
Cable         Pin on         Cubieboard
GROUND          (BLACK)     GND    #接地
MUST NOT BE CONNECTED         VCC    #这个是不能接的
PIN2           (GREEN)     RX    #TTL读
PIN1           (WHITE)     TX      #TTL写

Exclamation-red.png WARNING: DO NOT CONNECT THE RED LINE TO VCC.


一、可以上 http://linux-sunxi.org/Cubieboard/TTL
这里面介绍的是 gtkterm 链接方式
现在一个简单的介绍
stty -F /dev/ttyUSB0 -crtscts  # turn off hardware flow control - the cable has no wires for that
cu -s 115200 -l /dev/ttyUSB0
screen /dev/ttyUSB0 115200
gtkterm -p /dev/ttyUSB0 -s 115200
如不能链接则是用下面命令查看
$ sudo cu -s 115200 -l /dev/ttyUSB0
cu: open (/dev/ttyUSB0): Permission denied
cu: /dev/ttyUSB0: Line in use
一般的解决方法是
$ sudo usermod --append --groups dialout myusername


二、minicom的安装
sudo apt-get install minicom
1、查看USB转串口设备是否存在
ls -l /dev | grep ttyUSB
如果成功连接USB转串口工具,那么可以查找到ttyUSB0或ttyUSB1等。 //这个是USB转TTL的

也可以用lsusb 查看usb端口

我的如下

zhz@zhz:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 009: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 005 Device 010: ID 18d1:0003 Google Inc.
Bus 005 Device 007: ID 0e8f:0016 GreenAsia Inc. 4 port USB 1.1 hub UH-174
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
zhz@zhz:~$

这个就是我的TTL链接

Bus 005 Device 009: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
2、配置
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 prot setup
按如下设置
+-----------------------------------------------------------------------+
| A -    Serial Device      : /dev/ttyUSB0                              |
| 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?                                              |
+-----------------------------------------------------------------------+
| Screen and keyboard      |
| Save setup as dfl        |
| Save setup as..          |
| Exit                     |
| Exit from Minicom        |
+--------------------------+

3、首先在命令行下执行sudo minicom启动程序的 进入 cubieboard
可以开始调试  cubieboard ,#可以用sudo minciom -c on 命令进入带颜色的调试
(1)首先在命令行下执行sudo minicom启动程序的
(2)进入主界面后按 Ctrl+A 然后再按Z
可以进入配置界面
当 sudo minciom 进入不了。报如下错误
Device /dev/ttyUSB0 is locked.
可以用
sudo rm /var/lock/LCK..ttyUSB0 删除
再用sudo minicom 重新开始


在ubuntu kylin编译cubieboard2的android镜像碰到的问题:http://www.linuxdiyf.com/linux/13108.html