Tuesday 1 July 2014

Serial ports on the Beaglebone Black
On the BeagleBone Black, it's only the /dev/ttyO0 that is enabled by default, and it is coupled to the serial console. The other serial ports must be enabled before they can be used.

To enable the uarts 1,2,4 and/or 5 on the BeagleBone Black, rev A, B and C:
  1. Rev A/B: Open the file sudo nano/media/BEAGLEBONE/uEnv.txt
  2. Mine is Rev C: So sudo nano  /boot/uboot/uEnv.txt
  3. Add the key "capemgr.enable_partno="
  4. Add the ports you want to enable, comma separated (BB-UART1, BB-UART2. BB-UART4, BB-UART5)
  5. In my case I want to add tty04 so I can hook up to the RF Transmitter and LCD of my home automation 
  6. Reboot
An example line looks like this:


ubuntu@beaglebone:~$ sudo nano /boot/uboot/uEnv.txt
Find a suitable line to edit e.g.


##Disable HDMI

cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN capemgr.enable_partno=BB-UART4



After reboot, the device is present in the device list:


ubuntu@beaglebone:~$ ls -l /dev/ttyO*
crw-rw---- 1 root tty     248, 0 Jul  1 20:39 /dev/ttyO0
crw-rw---- 1 root dialout 248, 4 Jul  1 20:39 /dev/ttyO4

The UARTs map to pins and devices like this:


 RX TX CTS RTS Device Remark
 UART0    J1_4 J1_5     /dev/ttyO0BeagleBone Black only
 UART1 P9_26 P9_24 P9_20 P9_19 /dev/ttyO1
 UART2 P9_22 P9_21 P8_37 P8_38 /dev/ttyO2
 UART3 P9_42 P8_36 P8_34 /dev/ttyO3 TX only
 UART4 P9_11 P9_13 P8_35 P8_33 /dev/ttyO4
 UART5 P8_38 P8_37 P8_31 P8_32 /dev/ttyO5