BBB Serial Ports

From Wiki
Jump to: navigation, search

From this page

Extract the files from zip file linked to below and copy the files to the /lib/firmware directory. The commands below will fetch the zip file and unzip directly to the directory. You'll need to root to do this.

unzip -d /lib/firmware

Apply them after each boot with the command:

echo > /sys/devices/bone_capemgr*/slots # UART1
echo > /sys/devices/bone_capemgr*/slots # UART2
echo > /sys/devices/bone_capemgr*/slots # UART4
echo > /sys/devices/bone_capemgr*/slots # UART5

After applying all four of the .dtbo files, you should see something like:

root@ubuntu-armhf:/# ll /dev/ttyO*
crw-rw---- 1 root tty     249, 0 Jan  1  2000 /dev/ttyO0
crw-rw---- 1 root dialout 249, 1 Jun 17 18:16 /dev/ttyO1
crw-rw---- 1 root dialout 249, 2 Jun 17 18:16 /dev/ttyO2
crw-rw---- 1 root dialout 249, 4 Jun 17 18:16 /dev/ttyO4
crw-rw---- 1 root dialout 249, 5 Jun 17 18:16 /dev/ttyO5

Note that in a shell script you'll need something like this, because the '*' in the echo redirection doesn't work in a shell script:

for i in /sys/devices/bone_capemgr*/slots; do
  echo > $i
done Icon-zip.png (3 KB)

Note 1: ttyO0 is available on J1 and does not require an overlay (but it's tied to the FTDI USB chip)
Note 2: ttyO3 does not have an RX pinout (it is tied to the TDA19988 HDMI chip)
Note 3: ttyO5 shares pins with the HDMI overlay – both cannot be active at the same time

See BBB Reducing TTYO0 Console Output if using ttyO0.

ttyO0 is brought out on a 0.1" center 6-pin connector next to one of the expansion slot connectors. It's designed to connect directly to an FTDI TTL-232R-3V3 USB-to-serial cable (Digikey #768-1015-ND).

To view the serial port settings (leave out -a for less information):

stty -a < /dev/ttyO2

To set the baud rate:

stty -F /dev/ttyO2 19200