Pi command terminal and serial links

The SoC contains 2 UART circuits, UART0 and UART1 (aka 'PL011 UART' and 'MiniUART'). One of these is wired to the GPIO header pins8 and 10 and is activated as the 'console' (aka 'tty1' or 'serial0') command terminal on boot. Early Pi's set the baud rate to 9600 (the 'universal' standard for Serial Terminals), later versions used 115200 instead

There is quite a lot of confusion over which UART is used as the console as the RTS/CTS circuits are not 'mapped' to the GPIO header 'by default' which leads many authors to assume it's the 'MiniUART' that's being used.

However, the driver (/dev/ttyAMA0) source code is  "driver/tty/serial/amba-pl011.c" so it appears that the PL011 circuits are used.

More to the point, you can (now) get the RTS0 signal on GPIO 17 (P1-11) if you set it to 'ALT function 3' and CTS0 is available on GPIO 30 (P5-05), if that is set to 'ALT function 3'.

Although intended for debugging, there's nothing to stop you plugging in real serial hardware (display/keyboard) and using this to control the Pi. TxD is BCM14, on header pin 8 (WiringPi 15), RxD is BCM15, on header pin10 (WiringPi 16).

For a real serial link connection you will need a 'level converter'. RS232 uses +/- 12v (although most PC laptops with serial sockets used 0/5v), however the Pi serial lines are 0/3v3 (so if you just plug in a RS232 cable from your PC, you will blow the Pi !)

The second UART1 (Mini-UART) can be mapped to the GPIO header (at the expense of some other, ALT0 default, functions)

Pi B 3 = Bluetooth or serial command

On the Pi B3, the PL011 UART hardware is redirected to the Bluetooth hardware and the MiniUART used for the console. Unfortunately, the MiniUART baud rate is 'not stable' when the ARM processor is under load (the baud rate is tied to CPU speed)

However, for Raspbian Jessie releases after 18th March 2016, it's possible to 'swap' the two UART (so re-direct the PL011 UART back to console use and feed the MiniUART to Bluetooth = which will now be less stable) :-

1) to map the miniuart to bt (and thus pl011 UART back to BCM 14 and 15) :-
sudo nano /boot/config.txt and add at the end of the file :-
dtoverlay=pi3-miniuart-bt

2) to enable the command terminal,
sudo nano /boot/cmdline.txt and change the contents to the single line :
dwc_otg.lpm_enable=0 console=tty1 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

Note = both the above files are in the root FAT32 partition of a Raspbian Jessie SDHC, so can be modified on the PC after 'burning' the distro.