BeagleBone Black Serial UART Device Tree Overlays for Ubuntu and Debian Wheezy (tty01, tty02, tty04, tty05 .dtbo files)

BeagleBone Black UARTs

Unlike the BeagleBone White, the BeagleBone Black has no built-in serial to USB connection. This was one of the several cost saving measures taken in order to get the per-unit price down to $45 USD. The serial debug interface available at J1 is setup to allow the use of an FTDI TTL-232R-3V3 3.3V serial to USB adapter (Figure 1). An FTDI 3.3V knock-off is available from Amazon, and works well for this application. The unit cost is $19 with free Prime shipping. Using the UARTs from another BeagleBone Black would have served the same purpose for only ~$20 more (Figure 2). Also note that, depending on the use case, the BeagleBone Black can also monitor its own serial debug port via one of the other UART ports.

FTDI TTL-232R-3V3

Figure 1 – BeagleBone Black with an FTDI TTL-232R-3V3 3.3V serial to USB attached to J1

 

Device Tree Overlay

The BeagleBone Black am335x-boneblack.dtb device file has only /dev/ttyO0 active by default. To enable the other UARTs, we could either modify this file or create an overlay (.dtbo) file to adjust this behavior at runtime. I opted to go with the .dtbo overlay approach. The compiled files and their proper application are noted in the section below.

Figure 2 shows the connection between the board doing the monitoring (top) using UART4, RX pin P9-11 and TX pin P9-13. It is connected to the board being monitored (bottom) via its UART0 serial debug port at J1. Note that J1 has six pins, but only three are active: pin 1: ground, RX pin 4 and TX pin 5. In this case the TX is tied to RX and vice-versa (TX:P9-13 to RX:J1-4 and RX:P9-11 to TX:J1-5).

BeagleBone Serial Debug

Figure 2 – BeagleBone Black serial J1 attached to BeagleBone Black ttyO4

Install and start minicom (apt-get install minicom) and launch it in setup mode (minicom -s). Select Serial port setup and change the Serial Device to /dev/ttyO4 (or whatever port you are using). Note that Hardware Flow Control is on by default and should be turned off.

That’s it. You should now be seeing the login screen of the other BeagleBone Black:

Welcome to minicom 2.5

OPTIONS: I18n 
Compiled on Dec  7 2011, 12:04:29.
Port /dev/ttyO4

Press CTRL-A Z for help on special keys                      

Ubuntu 12.04.2 LTS ubuntu-armhf ttyO0                        

ubuntu-armhf login: 

 

Serial UART Device Tree Overlay Files

The most difficult part was figuring out how to build the device tree overlay files. To build the overlay, use the unmodified device tree compiler available in the Ubuntu packages (apt-get install device-tree-compiler). Googling around, many examples are Ångström based that use /plugin/ and had a command-line option -@ that Ubuntu stock device tree compiler does support.  By decompiling an existing overlay file it is not too difficult to see how the parameters are defined within the file.  Below are overlay files for the various serial ports of the BeagleBone Black.

 

Copy the following .dtbo overlay files to the /lib/firmware directory and apply them after each boot with the command: echo ttyO1_armhf.com > /sys/devices/bone_capemgr*/slots

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

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
root@ubuntu-armhf:/# 

 

Serial UART Address and Configuration

Below are the notes from cross-referencing the BeagleBone Black System Reference Manual, the TI AM335x Datasheet, and the TI AM335x Technical Reference Manual. Take some time to review these manuals for yourself – several websites are out there with inaccurate information and transcription errors, so it pays to double-check. It is always more frustrating and challenging when multiple issues exist in code; this is one easy thing to get right. Also, don’t forget to examine the kernel log dmesg after trying to load an overlay file – many times the kernel will tell you exactly what is wrong.


UART0: 0x44E0_9000 (/dev/ttyO0)
   TX: 0x174 0x00 (j1-p5)  (ZCZ-E16 UART0_TXD mode:0 [datasheet]) = (conf_uart0_txd 974h [TRM p1126] = 0x0174)
   RX: 0x170 0x20 (j1-p4)  (ZCZ-E15 UART0_RXD mode:0 [datasheet]) = (conf_uart0_rxd 970h [TRM p1126] = 0x0170)

UART1: 0x4802_2000 (/dev/ttyO1)
   TX: 0x184 0x00  (p9-24) (ZCZ-D15 UART1_TXD mode:0 [datasheet]) = (conf_uart1_txd 984h [TRM p1126] = 0x0184)
   RX: 0x180 0x20  (p9-26) (ZCZ-D16 UART1_RXD mode:0 [datasheet]) = (conf_uart1_rxd 980h [TRM p1126] = 0x0180)

UART2: 0x4802_4000 (/dev/ttyO2)
   TX: 0x154 0x01  (p9-21) (ZCZ-B17 SPI0_D0   mode:1 [datasheet]) = (conf_spi0_d0   954h [TRM p1126] = 0x0154)
   RX: 0x150 0x21  (p9-22) (ZCZ-A17 SPI0_SCLK mode:1 [datasheet]) = (conf_spi0_sclk 950h [TRM p1126] = 0x0150)

UART3: 0x481A_6000 (/dev/ttyO3)
   TX: 0x164 0x01  (p9-42)       (ZCZ-C18 ECAP0_IN_PWM0_OUT mode:1 [datasheet]) = (conf_ecap0_in_pwm0_out 964h [TRM p1126] = 0x0164)
   RX: 0x188 0x21  (no breakout) (ZCZ-C17 I2C0_SDA          mode:1 [datasheet]) = (conf_i2c0_sda          988h [TRM p1126] = 0x0188) I2C0_SDA is tied to TDA19988

UART4: 0x481A_8000 (/dev/ttyO4)
   TX: 0x074 0x06  (p9-13) (ZCZ-U17 GPMC_WPn   mode:6 [datasheet]) = (conf_gpmc_wpn   874h [TRM p1124] = 0x0074)
   RX: 0x070 0x26  (p9-11) (ZCZ-T17 GPMC_WAIT0 mode:6 [datasheet]) = (conf_gpmc_wait0 870h [TRM p1124] = 0x0070)

UART5: 0x481A_A000 (/dev/ttyO5)
   TX: 0x0C0 0x04  (p8-37) (ZCZ-U1 LCD_DATA8 mode:4 [datasheet]) = (conf_lcd_data8 8C0h [TRM p1125] = 0x00C0)
   RX: 0x0C4 0x24  (p8-38) (ZCZ-U2 LCD_DATA9 mode:4 [datasheet]) = (conf_lcd_data9 8C4h [TRM p1125] = 0x00C4)
Posted in BeagleBone Black, Device Tree, HowTo Tagged with:
  • Pingback: BeagleBone Black Serial UART Device Tree Overla...()

  • bluehash

    Thanks! we were discussing about the same thing at the bfu forum:

    http://forum.beaglefu.com/topic/95-expose-remaining-beaglebone-uarts/

  • andyvt

    Is there a reliable way to get the overlay to apply automatically when the system reboots? I haven’t been able to make it work with rc.local or adding optargs=capemgr.enable_partno=ttyO1_armhf.com to uEnv.txt.

    Thanks

  • Simon Bella

    Hi John

    Great stuff!

    Can you confirm the exact location of the BeagleBone Black am335x-boneblack.dtb file and how it can be edited directly for enabling ttyO1 – ttyO5?
    I cannot seem to locate this file on your unbuntu 12.04 LTS imae (june9)

  • armhf

    /boot/dtbs/am335x-boneblack.dtb

    apt-get install device-tree-compiler
    dtc -I dtb -O dts -o am335x-boneblack.dts /boot/dtbs/am335x-boneblack.dtb
    nano am335x-boneblack.dts

    Find the serial@48xxxxxx entry and change status = "disabled"; to status = "okay";
    dtc -I dts -O dtb -o am335x-boneblack.dtb am335x-boneblack.dts

    Then copy the new dtb file to the /boot/dtbs directory.

  • armhf

    Checkout my reply to Simon above — if you know you always want this behavior you can just edit the default dtb to configure the system this way.

  • andyvt

    Thanks. I’ll give that a shot.

  • andyvt

    I ran through the steps above, and it does make /dev/ttyO1… appear, but I can’t connect to it in my code. dmesg shows the results and it looks the same as ttyO0 (which I can use after disabling console output). Are the pin locations mapped differently doing it this way v. the echo method?

    Thanks

  • armhf

    I left out the pinmix that goes along with it — I corrected the original post above.

  • andyvt

    That was it. Thank you!

  • Pingback: ray ban()

  • Pingback: clash of clans hack()

  • cPhil

    I have followed the above instructions by downloading the tty02 and tty04.dtbo above and echo them to */slots at boot time to enable ttyO2 and ttyO4. Using minicom, I can pass text to and from a pc via putty and both seem to be working as expected. However, when running a c++ application that makes use of both of these serial ports, data is being corrupted on both ports (although ttyO2 is much worse off). There seems to be corruption as one of the serial lines passes ascii strings, which on occasion come across as jibberish — although some data comes through okay.

    I’ve verified there are no other processes running, etc, that are using these ports.

    Since it works in minicom with low data rates, could the write buffers be overrun while the application is running? PS the application has been verified to work on a Gumstix Overo, so this really seems to be coming down to the UART setup.

  • armhf

    So if you use 115,200 you have more trouble than, say, 9600? If you are using short lead lengths can you reproduce this with Minicom?

  • cPhil

    Using two minicom sessions, I always get correct output to the host PC at many different baud rates between 9600 and 115200 (i.e. I cannot reproduce the error with minicom).

    In code, changing the baud rates did affect the severity of corruption; the lower baud rates tended to produce more severe corruption. Also, using only one UART results in a clean output regardless of the baud rate.

    Code is confirmed to be working on an Overo COM (i.e. multiple UARTs are sending and receiving non-corrupted information)

  • cPhil

    I might have a cable issue…Checking into it right now and will report back.

  • cPhil

    I took the rs-232 converters off of my BBB and hardwired the UARTs in question to an open UART and watched the output with minicom. Output looks fine so I assume I have a bad MAX3232.

    Thanks for the help
    -C

  • Everett Wang

    Hi John,
    Great work!
    I have been trying to confirm that we can access at least 4 UARTs in BB-black at the same time. Does your work just confirm that? I am working on a project that
    requires 4 UARTs.
    Thanks,
    Everett

  • Anthony Webb

    Hey John, A little off topic, but can you explain your wifi setup for the BBB? What setup do you have an will it work on a box stock BBB? Looking to add some wireless love to my BBB. Thanks!

  • armhf

    I searched amazon for the cheapest USB adapter with the biggest antenna and found this: http://www.amazon.com/gp/product/B006L0Y17G

    It’s always worked great. My assumption is the same hardware goes into name brand devices and they charge more for their support (which is of no use use to me anyway).

  • armhf

    You can access 5 uarts at the same time.

  • Akash Hajari

    While trying echo ttyO1_armhf.com-00A0.dtbo > /sys/devices/bone_capemgr*/slots, I am getting error

    bash: echo: write error: No such file or directory.

    And dmesg is

    [ 1969.798425] bone-capemgr bone_capemgr.9: part_number ‘ttyO1_armhf.com-00A0.dtbo’, version ‘N/A’
    [ 1969.800065] bone-capemgr bone_capemgr.9: slot #18: generic override
    [ 1969.800128] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 18
    [ 1969.800182] bone-capemgr bone_capemgr.9: slot #18: ‘Override Board Name,00A0,Override Manuf,ttyO1_armhf.com-‘
    [ 1969.802238] bone-capemgr bone_capemgr.9: slot #18: Requesting part number/version based ‘ttyO1_armhf.com–00A0.dtbo
    [
    1969.802304] bone-capemgr bone_capemgr.9: slot #18: Requesting firmware
    ‘ttyO1_armhf.com–00A0.dtbo’ for board-name ‘Override Board Name’,
    version ’00A0′
    [ 1969.825780] bone-capemgr bone_capemgr.9: failed to load firmware ‘ttyO1_armhf.com–00A0.dtbo’

  • armhf

    The command is: echo ttyO1_armhf.com > /sys/devices/bone_capemgr*/slots

  • Dustin Carr

    Many thanks for this. Just one problem.

    I am using 13.04 and I am getting permission denied (with or without sudo)

    ubuntu@arm:/media/beagledev$ sudo echo ttyO1_armhf.com > /sys/devices/bone_capemgr*/slots
    -bash: /sys/devices/bone_capemgr.8/slots: Permission denied

    Any ideas?

    Dustin

  • Dustin Carr

    Disregard my previous post. I just did a

    sudo chmod 666 /sys/devices/bone_capemgr.8/slots

    And then I could run the command fine. It was 644, which seems like it should have been writeable with sudo, but at least this works.

  • armhf

    This is because sudo is elevating the echo command only — read the top of this article: http://www.armhf.com/index.php/getting-started-with-ubuntu-img-file/

  • Neel Shah

    Fantastic resource John. Thanks for doing the dirty work and providing clear directions for the rest of us.

  • armhf

    It should work but you need to find a very good guide as how to do it well. I’d start with a guide, and when you get results and find it flaky (I know I did), I would suggest moving on to DD-WRT and examining the config files there. I think with this approach you will get to a stable result — we all know DD-WRT is rock solid. I would like to post an article like that here if you are interested in contributing those results…

  • Simon Bella

    Hi

    Can anyone help with the correct Usart Control mode setting for using the RTS signal to allow half duplex control for RS485 serial communications? I believe it just a matter of setting the uart mode configuration to make the RTS signal control the hardware of the RS485 TX output buffer.

  • armhf

    Which UART are you wanting to configure?

  • Simon Bella

    Hi,
    Not sure if this is possible but the BBB seems to have RSTn pins for UART3,4,5 on the P8 connectors but these pins also connect to lcd pins so there may be a conflict ? I can’t see RST pins for UART1,2 which I would prefer. ( also i will not need HDMI in my app – using your ubuntu LTS image) So my preference would e to use UART4 with RSTn if no conflicts.

    I have tried using external USB/RS485 adapters and this works fine But wanted to use the only available USB port for Wifi rather than use a hub?

  • armhf

    UART1 should be available — I used the following three manuals to locate the information:

    BeagleBone Black System Reference Manual
    https://github.com/CircuitCo/BeagleBone-Black/blob/master/BBB_SRM.pdf?raw=true

    TI AM335x Datasheet
    http://www.ti.com/lit/ds/sprs717f/sprs717f.pdf

    TI AM335x Technical Reference Manual
    http://www.ti.com/lit/ug/spruh73i/spruh73i.pdf

    The datasheet indicates:
    Up to Six UARTs
    • All UARTs Support IrDA and CIR Modes
    • All UARTs Support RTS and CTS Flow
    • UART1 Supports Full Modem control

    2.3.6.6 UART, page 77 (ZCZ part)
    BBB pin chip pin mode 0 name
    P9-24 ZCZ-D15 UART1_TXD
    P9-26 ZCZ-D16 UART1_RXD
    P9-19 ZCZ-D17 UART1_RTSn
    P9-20 ZCZ-D18 UART1_CTSn

    The TI AM335x Technical Reference Manual, page 1126 shows:
    978h conf_uart1_ctsn Section 9.3.1.51
    97Ch conf_uart1_rtsn Section 9.3.1.51
    980h conf_uart1_rxd Section 9.3.1.51
    984h conf_uart1_txd Section 9.3.1.51

    Which allowed me to compile the following table. With this information, you can edit a custom device tree file.
    TI AM335x Datasheet (rev f): Page 45-46
    TI AM335x Technical Reference Manual (rev i): Page 172, 1126, 4030
    UART1: 0x4802_2000 (/dev/ttyO1)
    TX: 0x184 0x00 (p9-24) (ZCZ-D15 UART1_TXD mode:0 [datasheet]) = (conf_uart1_txd 984h [TRM p1126] = 0x0184)
    RX: 0x180 0x20 (p9-26) (ZCZ-D16 UART1_RXD mode:0 [datasheet]) = (conf_uart1_rxd 980h [TRM p1126] = 0x0180)
    RTSn: 0x17C 0x00 (p9-19) (ZCZ-D17 UART1_RTSn mode:0 [datasheet]) = (conf_uart1_rtsn 97Ch [TRM p1126] = 0x017C)
    CTSn: 0x178 0x20 (p9-20) (ZCZ-D18 UART1_CTSn mode:0 [datasheet]) = (conf_uart1_ctsn 978h [TRM p1126] = 0x0178)

  • Simon Bella

    That’s great – I just got back, I will look at trying to impliment this soon. Using Uart1 should do the trick?

  • Simon Bella

    Hi John

    I am attempting to compile the /boot/dtbs/am335x-boneblack.dtb file to enable RSTn pin UART1 as you suggest. Just need to confirm a couple of things with you. In the pin ctrl settings does the order of entry make any difference I have simply added the RTSn pin as shown below?

    I have previously added UART1 to this file as you suggested some time ago – and this works great! Now I am attempt to enable RTSn for Uart1

    Also I assume I will also need to remove the I2C2 (pinmux_i2c2_pins) entry from the dts setup to avoid conflict with the I2C2 as these pins are shared with the RTSn and CTSn of UART1?

    pinmux_serial1_pins {

    pinctrl-single,pins = ;
    linux,phandle = ;
    phandle = ;
    };

    Also just to avoid a major bungle – If the dtbs files are in error
    will this cause the BBB to hang on boot up without any way to recover?

    Thanks for your advise

  • Kishor

    Did you get success to communicate RS485 with BBB??

  • http://www.freewear.org RazZziel

    Do you have a dts or dtbo file for ttyO3? I’ve tried these two dts, but none of them work, I get “echo: write error: No such file or directory” error when I run “echo BB-UART3-00A0 > /sys/devices/bone_capemgr.8/slots”, after compiling the dts with “dtc -O dtb -o /lib/firmware/BB-UART3-00A0.dtbo -b 0 -@ BB-UART3-00A0-2.dts”. I’ve tested it with ttys O1 O2 O4 and O5, and they all work, but ttyO3 refuses to work.

    http://pastebin.com/raw.php?i=XFRqrQnG
    http://pastebin.com/raw.php?i=6CuTq1q4

  • armhf

    Sorry, I didn’t make one since tty03 is TX only.

    Note 1: ttyO3 does not have an RX pinout (it is tied to the TDA19988 HDMI chip)

  • http://www.freewear.org RazZziel

    Yup, I only need TX. Do you know why my first dts could be failing?

  • armhf

    Well, I gave it a shot, but have not tested it if you want to give it a try: http://s3.armhf.com/boards/bbb/dt/ttyO3_armhf.com-00A0.dtbo

    The source file is there too with a .dts extension if you want to look at it.

  • http://www.freewear.org RazZziel

    Hey, awesome, it works beautifully :D

  • Gabriela

    Does someone know if we can get an overlay (dtbo) to implement uart1 with cts and rts pins ??? I tried several ways with no success!!

  • Ruben

    Thank you for another awesome tutorial. I’m trying to run the apply command in a .sh file at startup, but I cant seem to get it to work. I’m using LXDE Ubuntu precise. can someone help me?
    thanks!

  • armhf

    @Actium over on the BeagleBone Black page had a good suggestion to use the following to the Kernel command line (see optargs in /boot/uboot/uEnv.txt): capemgr.enable_partno=BB-ADC

    I would expect this would be a good solution — let me know how it works for you and I will update the article above.

  • Xnient

    I want the same!

  • Julien

    Hello,

    Thanks for your tutorial !

    But what is the best methode for enable all serial ports at boot ?

    With the methode of tutorial when i reboot all port are disable and rights of /sys/devices/bone_capemgr.9/slots are not applied. Create a .sh for that at start up ?

    Or modifie /boot/dtbs/am335x-boneblack.dtb as explained below but it’s only for serial 1 (ttyO1). How do for the other serial ports ?

    Or in /boot/uboot/uEnv.txt but I do not know how !
    Thanks.
    Bye.

  • Timothy Vann

    I’m trying to do the exact same thing. I’m trying to get the beagle bone black to communicate through a max3485 transceiver to devices on an rs-485 half-duplex network. I’ve tried to disable I2C2 and use UART1 and I’ve tried disabling HDMI and using UART4. In both cases I need RTS to activate the max3485. It seems like I’ve been successful in disabling I2C2 and HDMI and it also seems like I’ve been successful in creating and installing the UART1-RTS and UART4-RTS overlays. However I can’t get any communication established. I can’t tell if the problem is in the disabling of the I2C2/HDMI or in the overlay or if I just don’t have the port set up correctly. I don’t have an oscilloscope but at least I have TX and RX lights on the devices I’m trying to communicate with. I also have an RTS LED on the transceiver I’m using. So far I haven’t been able to make any communication lights blink. If I can get positive results I’ll write up a guide.

    Can anyone help me figure out what the problem is.

    Specifically:
    How can i tell if the pins are actually setup for UARTX with RTS/CTS?
    Is there something more detailed than:
    cat /proc/tty/driver/OMAP-SERIAL
    0: uart:OMAP UART0 mmio:0x44E09000 irq:88 tx:553 rx:0 RTS|CTS|DTR|DSR
    1: uart:OMAP UART1 mmio:0x48022000 irq:89 tx:0 rx:0 CTS|DSR|CD|RI

    cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pins
    pin 94 (44e10978) 00000020 pinctrl-single
    pin 95 (44e1097c) 00000000 pinctrl-single
    pin 96 (44e10980) 00000000 pinctrl-single
    pin 97 (44e10984) 00000020 pinctrl-single

    Is there something else that needs to be done so that the UART uses the pins besides the overlay?

    Is there something that needs to be done to put the RTS pin in auto-RTS mode?

  • sam

    What about SPI ? Do you have a tutorial for that? I’ve gone through recompiling using dtc and everything suggests that SPIDEV0 should be working however, the SCLK is just low all the time. The other pins for SPI0 seem as if they work i.e spidev1.0 is installed and I can use Ardafruits python SPI class as well. However looking through a logic analyzer I get no clock signal in the SPI0 clock i.e pin22 on the p9 header. I ‘m using BBB revA6 , on Ubuntu lts 12.04… Any suggestions on why just the SCLK may not be working? The driver is installed, i’ve tried this on Angstrom as well, edited the appropriate uEnv.txt (fat boot portion) file and checking with dmesg, /proc/cmdline etc shows everything as it should be I think. I am relatively new to bbb but not linux or spi.

  • Phil Pollock

    Following similar instructions (for Simon) UART4 doesn’t get enabled during the boot although I can manually load its device by using: echo BB-UART4 > /sys/devices/bone_capemgr.*/slots.

    I have altered /boot/dtbs/am335x-boneblack.dts to enable “uart4″ and recompiled it into a .dtb file then copied it over the original .dtb file; however ttyO4 still doesn’t show up under /dev/ttyO*

    serial@481a6000 {
    compatible = “ti,omap3-uart”;
    ti,hwmods = “uart4″;
    clock-frequency = ;
    reg = ;
    interrupts = ;
    status = “okay”;
    linux,phandle = ;
    phandle = ;
    };


    Do you have any suggestions?

  • David

    Hi everyone,
    I had success activating UARTs 1, 2 and 4 by adding the follwing to the optargs line in uEnv.txt:

    capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART-4

    (So your optargs line might read something like: optargs=fixrtc some_of_your_other_arguments capemgr.enable_partno=BB-UART1,BB-UART2,BB-UART-4)

    -David

  • German

    Hello John,
    I recently began using you ubuntu LTS configuration, its great!

    I have modified the am335x-boneblabl.dtb file for UART1 as per your instructions to Simon above but am having difficulty doing this for other UART’s ?

    I notice that the original decompiled dtb file has already allocated linux handles for all the Uart’s, even UART1 in your example above, so I really don’t understand why you need to give them a different handle as such?

    For example in your instructions above for UART1 you do not say whether we need to delete the existing handles or why they need to be changed to at all? and even leaving the old handles still makes it work OK?

    Now in attempting to activate UART4 .. shown as serial4 = “/ocp/serial@481a8000″ in the dts file when I simply change the status line to ‘okay’ this appears to enable UART4 but it doesn’t actually work the hardware as such and can’t understand why?

    Can you help with modifying the dts file to allow working the other uart’s .. I need UART4 working in my case?
    I tried adding the pinmux entries for UART4 similar to what you have done for UART1 and used a new handle of but this did not get UART4 working for some reason?

    thanks for the help

  • German

    This code works ok for UART4 although not exactly sure why?

    pinmux_serial4_pins {
    pinctrl-single,pins = ;
    linux,phandle = ;
    phandle = ;
    };

    insert these two line here ….

    serial@481a8000 {

    pinctrl-0 = ;
    status = “okay”;

  • German

    Has anyone been able to get RTS signal to work for use with half duplex RS485 ?
    Trying to do this with UART1 without success so far?
    any help would be appreciated.

  • orotemo

    listing /sys/devices, all I get is the following list of folders (3.14.4.1-bone-armhf.com):

    `44e10800.pinmux fixedregulator.8 ocp.3 soc.1 system

    ARMv7 Cortex-A8 hdmi.9 platform soc0 tracepoint

    breakpoint leds.7 pmu.0 software virtual`

    no bone_capemgr*. any updates to this? specifically I need to load an overlay to enable rs485 on one of the serials (the rts pin to control the chip).

  • armhf

    The bone_capemgr has not been ported to the 3.14 kernel yet. The current option is to modify the main dtb directly with the features you want.

  • German

    Hi John,

    After upgrading to the latest Ubuntu trusty image & latest kernel I notice that UART1 is now enabled at power up and there are several new dtb files located in /boot/dtbs/ directory such as the am335x-boneblack-ttyO1.dtb, am335x-boneblack-ttyO2.dtb and am335x-boneblack-ttyO4.dtb files?
    I assume these should make it easier to enable Uarts?
    But also notice there is no cape manager .. so how/do I need to disable the previously configured HDMI pins to make them available for general I/O use?

  • armhf

    That is the unfortunate part of not having the cape manager in the post 3.8 kernels. In the comments below there are instructions on hacking the dtb to a dts, editing, then compiling back. See: dtc -I dtb -O dts -o am335x-boneblack.dts /boot/dtbs/am335x-boneblack.dtb

  • Pingback: BeagleBone Black Serial UART Device Tree Overla...()

  • Pingback: Enabling uarts on the beaglebone white and black with ubuntu 13.10 | voidnoise.co.uk()

  • smokeAndMirrors

    On my BBB (Rev B6) there are what appear to be the relevant overlays, so that I can enable /dev/ttyO1 for UART1 by

    echo BB-UART1 > > /sys/devices/bone_capemgr.*/slots

    /dev/ttyO1 is there, but I can’t read or write data to it (2 terminal windows, one doing cat /dev/ttyO1, the other echo “boo” > /dev/ttyO1, the cat window remains blank).

    Is there something more necessary to get this to work?

    (Notes: I could not get the modification of /boot/uboot/uEnv.txt method to work because I didn’t have a uboot directory. uEnv.txt was in the /boot folder, but modifying it and rebooting had no effect).

  • MihaiM

    It means that there is no way of using already dtb files delivered in /boot/dtbs directory ?

  • MihaiM

    How can we use the files delivered in /boot/dtb directory from the latest kernel without having cape manage witch I understood was not ported?

  • armhf

    You cannot — you will have to edit the master dtb file. There are instructions below, look for: “1) Decompile the dtb to a dts and edit:”

  • MihaiM

    And this new updated master dtb file how it is handled ? it is loaded automatically by the system ? It has to be moved by us somewhere ?

  • armhf

    You edit the one that gets loaded by uboot. You can see the name of the dtb by looking at the kernel boot log (use dmesg). Here is a well written series of articles on the subject: http://xillybus.com/tutorials/device-tree-zynq-1

  • MihaiM

    Ok I got the point
    Any idea of when the cape manager will be ported or can we install this package (download, make+install and so on)

  • armhf

    Robert Nelson would be the best person to ask.

  • Damian Manda

    This is very frustrating to a new BBB developer that just wants to use multiple serial outputs. No existing code seems to work with kernel 3.14 on Ubuntu 14.04. I see the various dtb files but dmesg gives no reference to any of them, and they are over 5000 lines long so I have no idea where I would even start changing something. Is there really no other way to enable these serial ports? It seems like more than a couple people would need access to them.