Previously, when I was playing gec2410, I had the idea that I was debugging it in Linux. Because the target board is powered or the serial port sent to the PC during the reset, this was already implemented in windows, so I wanted to see the results in Linux, but after setting up a serial port in Linux, I found no response at all. I thought I did not install the cross-compilation environment, so after installing the cross-compiling environment for Embedded Linux last night, I thought this should be able to be pulled. I didn't expect the target board to be powered on, but the serial port under Linux has never been responsive and depressing. Why, since it is not suitable for cross-compiling environments, there must be a reason, so I searched the internet and previously I was stupid enough. Why don't I know how to query the Internet, it turns out that I didn't turn on the VMware serial port. Hehe immediately shut down [shut down the system under the Virtual Machine], in VM-> setting ...... -> click Add to add the serial port. During configuration, do not use automatic detection. Select the serial port, even if your virtual system can be changed after it is started, at the same time, you need to set the serial port to be connected when it is started. In this way, the serial port in Linux is powered on the target board. Or you will receive the same data as in windows After resetting. Haha, great!
Environment:
HOST: Windows 7 vmware7.1
Virtual Machine: fedora12
VMware Serial Port:
A virtual machine can add up to four virtual serial ports. You can configure the virtual serial ports in the following ways:
Connects a virtual serial port to the host machine's physical serial port.
Connects a virtual serial port to a file on the host.
Establish a direct connection between two virtual machines, or connect the serial port of the virtual machine to the application program of the host machine.
Add serial ports for virtual machines
First, make sure that the VM is in the power off status. Choose VM> Settings... from the menu ..., on the hardware tab, click Add. In the Add hardware wizard dialog box, select serial port and click Next,
Select serial port type. There are three types:
1. If you want to use the host machine's physical serial port device, select use physical serial port on the host, then click Next and select the physical serial port you want to use.
2. If you want to output the serial port data to a file, select output to file, and then next, select the output file, which is a TXT text file. Run the following command in the command line:
Echo "ASDF">/dev/ttys0,
Open the output file and you will see the Serial Output string ASDF.
3. Use named pipe to connect two virtual machines or applications of the virtual machine to the host machine through serial port. Select output to Named Pipe and click Next To Go To The following interface:
Enter the MPs queue name. For a Windows host, the MPs queue name format is //./pipe/<namedpipe>. It must start with //./pipe.
Output debugging information to the application on the host:
Select this end is the server or this end isthe client from the first drop-down menu, and select the other end is an application from the second drop-down menu.
Output debugging information to another virtual machine:
Select this end is the server from the first drop-down menu, and select the other end is an application from the second drop-down menu.
Connect two VMS through serial ports:
Install fedora12 and ubuntu10.04 on the Virtual Machine to add a serial port for the two virtual machines,
The serial port of fedora12 is set:
The serial port of ubuntu10.04 is set:
In this way, the serial port of fedora is Serial Port 1, the device name is ttys0, the serial port of Ubuntu is Serial Port 2, and the device name is ttys1.
Test:
Run the following command under fedora:
Cat </dev/ttys0
Run the following command in Ubuntu:
Echo Hello>/dev/ttys1
You can see the received string hello in fedora, indicating that Ubuntu sending and Fedora receiving are normal. You can perform the same test after interchange.
Grammar
Statserial [required parameters] [device]
Merit
Statserial command: displays the status of each pin. It is often used to determine whether the serial port is normal. Press Ctrl + C to exit
Similar command: stat
Similar commands: Linux commands
Execution permission: Super User common user
Command attribute: Network Communication
Parameters
Required Parameters
-N does not show cyclically
-D decimal display
-X hexadecimal display
Select Parameters
None
Example
Example 1: display the serial port status
[Root @ Linux ~] # Statserial/dev/tty1
Example 2: only display the serial port status once
[Root @ Linux ~] # Statserial-N/dev/tty1