Arm board releases ttys0 as communication serial port (disable debugging serial port)

Source: Internet
Author: User

Release ttys0 as the communication serial port

# Include <sys/IOCTL. h>
# Include <sys/STAT. h>
# Include <sys/types. h>
# Include <fcntl. h>
# Include <termios. h>
# Include <errno. h>
Void closeconsole (void ){

Int FP;
Struct termios options;
Printf ("Change1 \ n ");
Fp = open ("/dev/tty1", o_rdonly); // change the Console
IOCTL (FP, tioccons );
Close (FP );

Fp = open ("/dev/TTS/0", o_rdwr | o_noctty | o_ndelay); // open the serial port 0 for reading and writing
If (FP =-1) Exit (0 );
Tcgetattr (FP, & options );
Cfsetispeed (& options, b115200 );
Cfsetospeed (& options, b115200 );
Options. c_cflag | = (clocal | cread );
Tcsetattr (FP, tcsanow, & options );
Write (FP, "Hello world! \ N123 ", 15 );
Close (FP); // close the serial port 0

Fp = open ("/dev/tty0", o_rdonly); // restore the console to the serial port 0
IOCTL (FP, tioccons );
Close (FP );
Printf ("Change2 \ n ");
}

Close shell usage on the serial port to enable normal serial port communication and dialing

1. steps:
Execute make menuconfig during kernel Compilation
Character devices --->
Serial drivers --->

S3C2410 serial port support
[] Console on S3C2410 serial port [note] Remove this option without modifying busybox/init. C.
<> 8250/16550 and compatible serial support (experimental)
2. Remarks:
In this way, you cannot use the ttys0 port to log on to the arm development board. You can use Telnet to log on.
Practice: Telnet 192.168.0.12 (the IP address of your Development Board)
Enter the "root" User Name To Go To Your Development Board.
3. OK ..

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.