Use (Modify) "Turn" of USB to serial port under Linux

Source: Internet
Author: User

Environment: Ubuntu 10.10 Server

Minicom is the Linux under the serial communication software, its use relies entirely on the keyboard operation, although no "HyperTerminal" so easy to use, but after using the habit reader will appreciate its efficiency and convenience, the following will explain the installation and configuration of minicom.

Transferred from: http://blog.chinaunix.net/uid-25562715-id-1990181.html

First, install Minicom:

Use the following command:
# sudo apt-get install minicom

The following is the installation details:
# sudo apt-get install minicom
Reading the package list ... Complete
The dependency tree that is parsing the package
is reading state information ... Completing the
will install the following additional packages:
Lrzsz
The following "new" packages will be installed:
Lrzsz minicom
A total of 0 packages have been upgraded, 2 new packages have been installed, 0 packages have been uninstalled, 2 software has not been upgraded. The
needs to download 270kB packages. The
will consume 1389kB of extra space after decompression.
Do you want to continue? [Y/n]y
Get: 1 http://ubuntu.uestc.edu.cn hardy/universe lrzsz 0.12.21-4.1 [97.0kB]
Get: 2 http:/ /ubuntu.uestc.edu.cn hardy/main minicom 2.3~rc1-2 [173kB]
Download 270kB, time-consuming 1s (184kb/s)
selected the package Lrzsz that was previously deselected.
(Reading Database ... The system currently has a total of 101,203 files and directories installed.
Extracting Lrzsz (from .../lrzsz_0.12.21-4.1_i386.deb) ... The
selected the package minicom that was previously deselected.
Extracting minicom (from .../minicom_2.3~rc1-2_i386.deb) ... The
is processing the trigger for man-db ...
Setting Lrzsz (0.12.21-4.1) ...
Setting minicom (2.3~rc1-2) ...

What Ps:ubuntu is doing right now is quite practical and intelligent, associating the dependent packages (LRZSZ) with each other and installing them. However, if you use a previous version of Ubuntu 8.10, you may want to install the LRZSZ package separately (Lrzsz includes the X/y/zmodem protocol). That is, in the Xmodem protocol through the serial port to write the kernel will be prompted without the Xmodem protocol, so this will be installed LRZSZ software package:
# sudo apt-get install Lrzsz
Then you can normally use minicom to burn the kernel through the serial port.

Second, the configuration minicom:

1, before using minicom, first to ensure that you have read/write permission to the serial port. We know that the Linux device corresponds to a file in the/dev/directory, the serial port COM1 corresponds to the ttys0,com2 corresponding to the ttyS1, use the following command to view your permissions to COM1:
$ ls-l/DEV/TTYS0
CRW-RW----1 root dialout 4, 2009-08-01 11:05/DEV/TTYS0
As you can see, its owner is root.

2, as in Windows to configure HyperTerminal, before using Minicom, the serial port to be configured first.
Run # sudo minicom-s

Select serial port Setup, where the cursor is on "change which setting", type "a", at which point the cursor moves to the corresponding position in item A: Serial COM1 corresponds to ttys0,com2 corresponding to ttyS1 (note selection), If the direct use of USB to the serial port corresponding to the ttyUSB0 (General Ubuntu has been installed under the USB to the serial port driver).

Then the baud rate, data bits and stop bits are configured, type "E", the baud rate is selected as 115200 8N1 (data bit 8, parity no, stop bit 1), hard/software flow control type "F" and "G" respectively, and select No. After confirming that the configuration is correct, type Enter to return to the ancestor configuration interface and save it as the default configuration (that is, save Setup as DFL). Finally, select the "Exit from Minicom" command to exit.

The specific configuration information is as follows:
Serial port Setup [Enter]
+-------------------------------------------------------------+
| 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? |
+-------------------------------------------------------------+

Note: If you do not use a USB to serial port, but use the serial port directly, then serial device to be configured as/DEV/TTYS0.

Then restart the minicom (that is, directly under the shell to execute the minicom command can enter the Minicom console) so that the configuration is effective, and then connected to the Development Board of the serial line, you can print the correct serial port information in the minicom. The Minicom menu can be accessed under the console by combining keys CTRL + A Z.

The use of a key combination is to press CTRL + A key, then release the two keys, and then press the Z key. There are also some common key combinations.
(1) S key: Send the file to the target system;
(2) W key: Automatic roll screen. When the displayed content is more than one line, the following content is automatically wrapped. This feature is useful when viewing boot information for a kernel.
(3) C key: Clear the display content of the screen;
(4) B key: Browse the historical display of minicom;
(5) X key: Exit minicom, you will be prompted to confirm the exit.

3. Directory where the configuration files are located
Ctrl + A-and O
+-----[Configuration]------+
| Filenames and Paths |
| File Transfer Protocols-|
| Serial Port Setup |
| Modem and Dialing |
| Screen and keyboard |
| Save Setup as DFL |
| Save setup as. |
| Exit |
+--------------------------+

Select "Filenames and Paths"
+-----------------------------------------------------------------------+
| A-download Directory:/home/crliu |
| B-upload directory:/tmp |
| C-script Directory: |
| D-script Program:runscript |
| E-kermit Program: |
| F-logging Options |
| |
| Change which setting? |
+-----------------------------------------------------------------------+

(1) Where to store the A-download download file (Development Board---> PC)
The files on the Development Board will be transferred to the/home/crliu directory on the PC.
(2) B-upload read the uploaded file from here (PC---> Development Board)
The PC sends files to the Development Board and needs to send the files in the/tmp directory (the directory on the PC). With this configuration, each time you send a file to the board, you only need to enter the filename, without having to enter the absolute path to the directory where the file resides.

Iii. How to use USB to serial port device under Linux

For the notebook holder without serial port, do hardware development often for no serial port and worry, but now have USB to serial port device. But new problems have arisen, for example, the minicom under the PC and target computer communication or there are some configuration problems, the following is the Linux USB to the serial port configuration and problems:

Note: By default, Ubuntu has a USB to serial port driver (pl2303) installed.

1, # Lsmod | grep usbserial
If there is usbserial, the system supports USB to serial port.

2, plug in the USB to the serial port, in the terminal input command #dmesg | grep ttyUSB0, if a connection success message appears, the Ubuntu system has identified the device.

Note: Ubuntu in the virtual machine environment is not automatically recognized by default, you need to click "Prolific Usb-serial Controller" in the bottom right corner of the virtual machine window, then select "Connect (Disconnect from Host)", This will be recognized by the Ubuntu system.

3, in the above minicom configuration set serial Device:/dev/ttyusb0, restart the Development Board, so basically you can use minicom to print the serial information.

4. Question 1
If the virtual machine does not recognize the load USB device, the following prompt appears:
This problem suddenly occurs with VMware Workstation: The connection to the VMware USB arbitration Service is unsuccessful. Please check the status of this service in the Microsoft Management Console.
Cause: VMware USB Arbitration service does not start
The workarounds are:
(1) Method one: Right click on My Computer, click Manage-Services and applications-services, find the VMware USB Arbitration service, right clicking, start-Up is OK. (Under Win7)
(2) Method two: Start-and-run, input: cmd. Input: net start Vmusbarbservice

5. Question 2
If the above steps are minicom or not working correctly, the following error message appears:
# sudo minicom
Minicom:cannot open/dev/ttyusb0: No such file or directory

At this point, you can try a different USB port and then operate the above process again. If you are still prompted for this error, you can use the following method to resolve it.

This method is to add a serial device to the hardware and add the device under window to the virtual machine. In other words, to add the USB to the serial port when the window gets focus, and then to the virtual machine under the device added, this can be viewed under Ubuntu to add the device files, usually/dev/tty0 or/DEV/TTYS0.
This method is actually the window of the USB to the serial port as the virtual machine's serial port, so it is tty0 or ttyS0, and not really loaded under Ubuntu.
The steps are as follows:
(1) Open the Virtual machine environment and select Vm-->settings (ctrl+d).
(2) Click "Add", go to the Add Hardware Wizard, select "Serial Port" and click "Next".
(3) Select the first item "Use physical port on the host", click "Next".
(4) Select "Physical serial port" mode for "Auto detect", tick "Connect at Power on", click "Finish" to complete.
(5) Then set serial device:/DEV/TTY0 or serial device:/DEV/TTYS0, restart the Development Board in the minicom configuration above, so that it can run minicom properly.

From: http://www.cnblogs.com/shendeng/articles/1887438.html

Use (Modify) "Turn" of USB to serial port under Linux

Related Article

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.