Serial console

From UpWiki
Jump to: navigation, search

The UP board can be controlled without a monitor or input peripherals (headless setup), but through a serial connection to a host machine. Various hardware ports can be enabled for this serial console. The following sections document the procedure for each of them.

10-pin connector CN7 (UART0)

Location of 10-pin connector CN7 on the UP board, highlighted in blue
CN7 adapter to serial + USB2.0 (UP shop)
FTDI (serial to USB) cable

The UART0 interface can be found in pins 9 and 10 on 10-pin connector CN7 (refer to the connectors description document).

It is enabled as a debug terminal as early as the BIOS stage.

To use it, connect your serial cable to the UP and configure the serial client (such as minicom or picocom, included with ubilinux, or putty, for Windows) on your host with these parameters:

  • Speed: 115200 bps
  • Data bits: 8
  • Parity bit: no
  • Stop bits: 1
  • Hardware flow control: no

Tips: The port name is Communications Port (COM1) in Windows 10

Required parts

  • 10-pin wafer box connector cable (one such adapter is available from the UP shop)
  • 3.3V Serial cable (for example, a FTDI cable)
  • Depending on the type of serial cable: jumper wires

Using the provided adapter

The adapter from the UP shop brings three connectors out of CN7:

CN7 pin Description Group Adapter connector
1 USB_VCC USB 1 USB 2.0 plug
2 USB_HSIC_P3_D-
3 USB_HSIC_P3_D+
4 GND
5 USB_VCC USB 1 USB 2.0 plug
6 USB_HSIC_P3_D-
7 USB_HSIC_P3_D+
8 GND
9 UART0_RXD UART0 3-pin: pin 2 red
10 UART0_TXD 3-pin: pin 1 white (with ▲ mark)
4, 8 GND 3-pin: pin 3 black

For serial console usage, the 3-pin connector can then be brought to some other kind of serial cable (for instance, using jumper wires).

For a FTDI cable, for example, the mapping should be:

3-pin FTDI
1 white yellow 5
2 red orange 4
3 black black 1

BIOS menu access

You can get to the BIOS menu by pressing Esc on your client after booting the board.

ubilinux

By default, ubilinux allows using UART0 as an interface from installation time to installed system.

To install ubilinux through serial console:

  • Configure the terminal as shown above before booting the installation media.
  • On the GRUB menu that appears, pick the Install (serial console) entry.

After installation, a TTY is always available on UART0, no matter how you installed the system in the first place.

Ubuntu

To enable the serial console on Ubuntu, first configure GRUB:

$ sudo mkdir /etc/default/grub.d
$ sudoedit /etc/default/grub.d/serial.cfg

On that file, add the following config:

GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX console=tty0 console=ttyS0,115200n8"
GRUB_TERMINAL_INPUT="console serial"
GRUB_TERMINAL_OUTPUT="gfxterm serial"
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200"

To finish this step, run update-grub.

ttyS0

On Ubuntu 14.04 (Trusty), if you also need a terminal on the serial TTY (which is probably the case), Upstart must be configured to start one. Run sudoedit /etc/init/ttyS0.conf and add this config:

# ttyS0 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /sbin/getty -L 115200 ttyS0 vt102

Finally, enable the terminal:

sudo start ttyS0

40-pin GPIO header (UART1)

Notes

  • BIOS menus are not available through this interface by default.
  • Detailed instructions will be added here. For now, see: Pinout#UART

Required parts

  • Serial cable (for example, a FTDI cable)
  • Jumper cables for the GPIO pins may be needed

USB3.0 OTG port in device mode

USB 3.0 device mode (Type-A to Micro-B) cable

UP

It is also possible to use the USB3.0 OTG port as an interface for serial console. To enable this feature, ensure that these BIOS settings are in place:

Chipset > South Bridge > Default DRD Config: DeviceMode
Chipset > South Bridge > USB OTG Support: PCI mode

This switches the OTG port role from host mode to device mode.

UP Squared

The functionality should work out of the box from BIOS version 2.1. No bios settings modification are needed.

Required parts

  • Device mode USB3.0 cable

ubilinux

Once the BIOS is correctly configured, you can follow these steps to test USB3.0 serial console:

  • Plug the device end of the cable to the UP board and boot the board.
  • Execute
 $ sudo modprobe g_serial
 $ sudo systemctl start getty@ttyGS0
  • Plug the host end of the cable to your host and look for a new TTY device entry in /dev (for example, /dev/ttyACM0).

You should now be able to access a TTY from your host device:

$ sudo picocom /dev/ttyACM0