Serial console

From eLinux.org
Revision as of 12:45, 20 September 2007 by Prpplague (Talk | contribs)

Jump to: navigation, search

Often, embedded development boards and products do not have normal displays that are available for kernel console messages. This is especially true during the early stages of getting a new kernel running on a board. Therefore, it is very common to boot a kernel using a "serial console". That is, the console messages, and the ability to log in to the newly running kernel are provided via a serial connection to the development board (rather than via a VGA screen and keyboard combination, which is the default for desktop versions of Linux).

To use a serial console, you must have a kernel with the necessary serial port driver configured in, and you must boot the kernel and specify to use a serial console on boot.

The kernel configuration options to support this are (usually):

  • CONFIG_SERIAL_8250=y
    • other serial ports are also supported, but this is the most common serial UART hardware
  • CONFIG_SERIAL_8250_CONSOLE=y

An example kernel command line option to specify the serial console (and it's settings) are:

  • console=ttyS0,115200n8

This option tells the kernel to use ttyS0 (the first serial port), with settings of speed=115200 cps, no stop bits and 8 data bits. The serial ports of the host and the target should be configured to match in terms of the speed, stop bits and data bits. Minicom is a common serial communications program used on host machines for accessing the console from the host.


some example serial console configurations:

* JuiceBox Serial Console
* Hammer Board Serial Console
{"cc_re__cc_re__cc_by_sa_3_0": ["d=\"t-permalink\"><a href=\"/index.php?title=Serial_console&amp;oldid=4378\" title=\"Permanent link to this revision of the page\">Permanent link</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<li id=\"t-info\"><a href=\"/index.php?title=Serial_console&amp;action=info\" title=\"More information about this page\">Page information</a></li>\n\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</div>\n\t\t</div>\n\t\t\t\t</div>\n\t\t</div>\n\t\t<div id=\"footer\" role=\"contentinfo\">\n\t\t\t\t\t\t\t<ul id=\"footer-info\">\n\t\t\t\t\t\t\t\t\t\t\t<li id=\"footer-info-copyright\">Content is available under <a class=\"external\" rel=\"nofollow\" href=\"http://creativecommons.org/licenses/by-sa/3.0/\">a Creative Commons Attribution-ShareAlike 3.0 Unported License</a> unless otherwise noted.</li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t<ul id=\"footer-places\">\n\t\t\t\t\t\t\t\t\t\t\t<li id=\"footer-places-privacy\"><a href=\"/eLinux.org:Privacy_policy\" title=\"eLinux.org:Privacy policy\">Privacy policy</a></li>\n\t\t\t\t\t\t\t\t\t\t\t<li id=\"footer-places-about\"><a href=\"/eLinux.org:About\" title=\"eLinux.org:About\">About eLinux.org</a></li>\n\t\t\t\t\t\t\t\t\t\t\t<li id=\"footer-places-disclaimer\"><a href=\"/eLinux.org:General_disclaimer\" title=\"eLinux.or", "oter-places-privacy\"><a href=\"/eLinux.org:Privacy_policy\" title=\"eLinux.org:Privacy policy\">Privacy policy</a></li>\n\t\t\t\t\t\t\t\t\t\t\t<li id=\"footer-places-about\"><a href=\"/eLinux.org:About\" title=\"eLinux.org:About\">About eLinux.org</a></li>\n\t\t\t\t\t\t\t\t\t\t\t<li id=\"footer-places-disclaimer\"><a href=\"/eLinux.org:General_disclaimer\" title=\"eLinux.org:General disclaimer\">Disclaimers</a></li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t<ul id=\"footer-icons\" class=\"noprint\">\n\t\t\t\t\t\t\t\t\t\t\t<li id=\"footer-copyrightico\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"http://creativecommons.org/licenses/by-sa/3.0/\"><img src=\"http://i.creativecommons.org/l/by-sa/3.0/88x31.png\" alt=\"a Creative Commons Attribution-ShareAlike 3.0 Unported License\" width=\"88\" height=\"31\" /></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t<li id=\"footer-poweredbyico\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"//www.mediawiki.org/\"><img src=\"/resources/assets/poweredby_mediawiki_88x31.png\" alt=\"Powered by MediaWiki\" width=\"88\" height=\"31\" /></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<div style=\"clear:both\"></div>\n\t\t</div>\n\t\t<script>/*<![CDATA[*/window.jQuery "], "copyright__copyright__copyright": [":\n\n  \u2022 console=ttyS0,115200n8\n\nThis option tells the kernel to use ttyS0 (the first serial port), with settings of speed=115200 cps, no stop bits and 8 data bits. The serial ports of the host and the target should be configured to match in terms of the speed, stop bits and data bits. Minicom is a common serial communications program used on host machines for accessing the console from the host.\n\n\nsome example serial console configurations:\n\n* JuiceBox Serial Console\n* Hammer Board Serial Console", ":\n\n  \u2022 console=ttyS0,115200n8\n\nThis option tells the kernel to use ttyS0 (the first serial port), with settings of speed=115200 cps, no stop bits and 8 data bits. The serial ports of the host and the target should be configured to match in terms of the speed, stop bits and data bits. Minicom is a common serial communications program used on host machines for accessing the console from the host.\n\n\nsome example serial console configurations:\n\n* JuiceBox Serial Console\n* Hammer Board Serial Console", ":\n\n  \u2022 console=ttyS0,115200n8\n\nThis option tells the kernel to use ttyS0 (the first serial port), with settings of speed=115200 cps, no stop bits and 8 data bits. The serial ports of the host and the target should be configured to match in terms of the speed, stop bits and data bits. Minicom is a common serial communications program used on host machines for accessing the console from the host.\n\n\nsome example serial console configurations:\n\n* JuiceBox Serial Console\n* Hammer Board Serial Console"]}