Serial terminal

From PlugWiki

(Redirected from Serial terminal program)
Jump to: navigation, search

The serial console for the Plug computer is a serial link from the Plug to a terminal emulation program like PuTTY running on a desktop.

This page describes how to quickly set-up your system to recognize the Plug and be able to connect to it with a terminal program. Details about specific terminal programs are available on dedicated pages (linked at the end of each OS-specific section).

In general you will need to set the following options in order to connect to serial console. These options are common to all serial terminal programs, however, the way these options can be changed depends on the program itself.

  • 115200 baud rate
  • 8 data bits encoding each character
  • N (none/no) parity
  • 1 stop bit
  • 0 (none) flow control

Or (briefly): 115200-8-N-1-0


Linux
Linux
  • Connect a mini USB cable from the Linux desktop to the mini-usb connector on the plug.
  • Power up the plug
  • First, try plugging in the USB cable, and run "dmesg" or look at your console logs. If the plug is recognized, you should see something like this:
 ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
 drivers/usb/serial/ftdi_sio.c: Detected FT2232C
 usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0
 ftdi_sio 1-1:1.1: FTDI USB Serial Device converter detected
 drivers/usb/serial/ftdi_sio.c: Detected FT2232C
 usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB1
  • If no new ttyUSB devices appear then try modprobe to force loading of usbserial and ftdi_sio:
 modprobe usbserial

(This step does not work on for example Ubuntu 9.04 where usbserial has been compiled into the kernel already.)

Then, for GTI plug:

 modprobe ftdi_sio vendor=0x9e88 product=0x9e8f

or Ionics plug:

 modprobe ftdi_sio vendor=0x1c0c product=0x0102

NOTE: On a recent kernel the console is on /dev/ttyUSB0. On an older kernel you should connect to the second serial interface /dev/ttyUSB1 (the first one is used for JTAG connectivity).

Visit this page to learn how to configure the most popular terminal programs on Linux.


Notes for Ubuntu (karmic, may be applicable to other versions)

You may not get any response on the /dev/ttyUSBx interface(s). In that case, you may need to remove brltty using sudo apt-get remove brltty.

Windows
Windows

Updating the Windows Driver: FTDI 2232

The first thing you need to do on Windows is update the FTDI 2232 driver that supports the Plug Computer mini-USB to serial connection. For you Linux (and FreeBSD) developers out there, this may not be straight forward so here is a detailed discussion. First, you need to be prepared to install three different drivers to get the serial terminal to work.


Getting the Windows Driver

Look in WindowsTeraTermUSBDriver.zip on the CD that came with your plug or download it from Marvell. This driver is meant for Microsoft Windows XP (but may work elsewhere).

  • The first driver install is to recognize the FTDI connection on the other end of the mini-USB cable.
  • The second and third drivers are installed to convert the FTDI 2232 controllers to serial terminals.


Serial Terminal for Windows Vista or Windows 7

Microsoft has made it a little more difficult to get on a serial terminal program now that Vista and the beta of W7 (and thus, probably W7) do not ship with a terminal program for any serial ports (or USB to serial ports). Not to fear, TeraTerm and PuTTY work great as serial terminal programs and have been tested with the Plug Computer's mini-USB cable.

In order to find the COM port to use, go to control panel/system/device manager and look in the Ports section. Sheeva is listed as USB serial port and after it between brackets is the name of the COM port (e.g. COM12). Baudrate to use is 115200 (8N1). If you got problems to interrupt the boot-process because the plug doesn't accept your Any-Key then try to set the Handshake for the serial connection to NONE.


TeraTerm: the Open Source Version 2

TeraTerm provides a secure shell (SSH) capability on Windows computers, but it also includes serial terminal capabilities. Just install the program and run like you normally would for SSH, but go to the VT Windows File menu and select New Connection to then select the proper serial port. Most new systems seem to have an abundance of USB ports, so you may have to do some testing until you get some kind of output unless you know you serial port number locations already or the order the Windows OS initializes the USB ports.


PuTTY: SSH and Serial Terminal

PuTTY extends past the secure shell and telnet protocols to the serial terminal as well so it is a good choice for adding support to your Windows systems. The documentation is a little better than the TeraTerm v2 docs so if you are trying a serial terminal on Windows for the first time, I would recommend PuTTY. Here is a direct link to the serial panel docs. A detailed how-to is provided here: PuTTY for the SheevaPlug on Windows

Mac OS X
Mac OS X

In order to connect to the serial console on the plug, you'll need to download a kernel driver for the USB to serial chipset in the plug. NOTE: there seems to be some confusion regarding the chipset of the console, this document used to recommend a Prolific driver. At least as of early 2009 (hardware version 1.3), the plug sports a FTDI FT2232D USB UART (note that some of the Marvell documentation mislabels this is a non-existant "FDT2322D"; ref. photos of the actual board for the real deal). The Prolific driver won't work with a FTDI chip.

The FTDI FT2232D provides two serial ports via USB:

  • port 0 (*A) is the JTAG interface
  • port 1 (*B) is the console (/dev/ttyS0 on the plug; default 115200 baud, 8N1, no flow control)


FTDI Driver for OS X

Download the OS X driver from FTDI.

This driver does not include the plug's device ID, so you need to edit the file /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist per FTDI_patch.

Devices appear as /dev/tty.usbserial-FTx(A|B), where x is an ID unique to each plug. A is the JTAG interface, B is the serial console (the plug's ttyS0).

As 10.5.8/FTDI 2.2.14: the extension doesn't load at reboot, use kextload to load it

 $ sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext
 Password:
 kextload: /System/Library/Extensions/FTDIUSBSerialDriver.kext loaded successfully


The 'screen' program is included on OS X:

 $ screen /dev/tty.usbserial-FTSKB964B 115200
 Ubuntu jaunty (development branch) debian ttyS0
 
 debian login:


Once you're in

The serial connection acts like an ordinary console terminal. If the plug is already up you'll get a Linux login prompt. On a reboot you can interrupt the boot sequence to get to the Marvell u-boot monitor, or let it go ahead and boot Linux.

Personal tools