This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BeagleBone Black enabling UART ports

Please somebody tell me how to enable UART1, 2 and 4 on BeagelBone Black Linux from ti-sdk-am335x-evm-07.00.00.00. I found some guides where i need to place *.dtbo file in "/lib/firmware" and apply it in this file:  "/sys/devices/bone_capemgr*/slots", but there is no such folder on the system.

  • Hi Anton,

    to enable UARTs on BBB you must use edit am335x-bone-common.dtsi file, included in am335x-boneblack.dts device tree file. Files are placed in <ti-sdk-am335x-evm-07.00.00.00>/board-support/linux-.../arch/arm/boot/dts/.

    UART ports are initialized in am33xx.dtsi file, but are disabled.

    Look into am335x-bone-common.dtsi file, where UART0 is enabled:

    ocp {
    		uart0: serial@44e09000 {
    			pinctrl-names = "default";
    			pinctrl-0 = <&uart0_pins>;
    
    			status = "okay";
    		};
    

    add below nodes for other uart ports, as verify its addresses from am335x TRM, 2.1 "ARM Cortex-A8 Memory Map": http://www.ti.com/lit/ug/spruh73l/spruh73l.pdf

     Also verify pinmuxes for other UARTs, using TI PinMux tool: http://processors.wiki.ti.com/index.php/TI_PinMux_Tool

    Add nodes with uart pinmuxes to am335x-bone-common.dtsi below the uart0_pins node:


    uart0_pins: pinmux_uart0_pins { pinctrl-single,pins = < 0x170 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */ 0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ >; };

    After that recompile recompile am335x-boneblack.dtb and replace the old one in place where from your BBB finds the kernel and dtbs to boot.

    BR,

    Georgi

  • Do I understand it correctly?

    uart1: serial@48022000 {
    pinctrl-names = "default";
    pinctrl-0 = <&uart1_pins>;
    
    status = "okay";
    };

    and

    uart1_pins: pinmux_uart1_pins {
    pinctrl-single,pins = <
    0x180 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart1_rxd.uart1_rxd */
    0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_txd.uart1_txd */
    >;
    };

    So i did it and compiled dtb file according to guide from this page: http://processors.wiki.ti.com/index.php/Linux_Kernel_Users_Guide

    I replaced old am335x-boneblack.dtb with new one and launched the device. There is still no /dev/ttyO1 in system. What i did wrong?

  • Hi,

    can you, please, share the ouput of /dev directory?
    what .dtb file have you edited and make?

    BR,
    Georgi
  • I modified am335x-bone-common.dtsi file and compiled am335x-boneblack.dtb again and now i can see /dev/ttyO1. Now I'm trying to work with it, to establish connection with another device.

    I've seen those guides you wrote in previous message, but they didn't help.

  • I also tried to add UART2 and UART4 ports. Ethernet stops working when i activate them.In the am335x-bone-common.dtsi file I noticed, that the ethernet is using the same pins as rx, tx of UART2 and 3. Is it right or i misunderstood something?
  • As it can be verified in BBB Documentation, only UART2, 4 and 5 are using same pins with Ethernet.
    Look into 6.8.1 Ethernet Processor Interface here:
    github.com/.../BBB_SRM.pdf

    BR,
    Georgi

  • UART1 works fine now. Also i need 2 more ports, so I tried to activate UART2. I did next steps:

    1) Added this:

    uart2_pins: pinmux_uart2_pins {
    			pinctrl-single,pins = <
    				0x12c (PIN_INPUT_PULLUP | MUX_MODE1)	/* uart2_rxd.uart2_rxd */
    				0x130 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)	/* uart2_txd.uart2_txd */
    			>;
    		};

    and this:

    uart2: serial@48024000 {
    			pinctrl-names = "default";
    			pinctrl-0 = <&uart2_pins>;
    
    			status = "okay";
    		};

    Mux mode changed to "1", according to reference manual  7.1.2 Connector P9, Table 13.


    2) Commented lines with the same pins (0x12c, and 0x130):

    Here:

    cpsw_default: cpsw_default {
    			pinctrl-single,pins = <
    				/* Slave 1 */
    				0x110 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mii1_rxerr.mii1_rxerr */
    				0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* mii1_txen.mii1_txen */
    				0x118 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mii1_rxdv.mii1_rxdv */
    				/*0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0)*/	/* mii1_txd3.mii1_txd3 */
    				/*0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)*/	/* mii1_txd2.mii1_txd2 */
    				0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* mii1_txd1.mii1_txd1 */
    				0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* mii1_txd0.mii1_txd0 */
    				/*0x12c (PIN_INPUT_PULLUP | MUX_MODE0)*/	/* mii1_txclk.mii1_txclk */
    				/*0x130 (PIN_INPUT_PULLUP | MUX_MODE0)*/	/* mii1_rxclk.mii1_rxclk */
    				0x134 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mii1_rxd3.mii1_rxd3 */
    				0x138 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mii1_rxd2.mii1_rxd2 */
    				0x13c (PIN_INPUT_PULLUP | MUX_MODE0)	/* mii1_rxd1.mii1_rxd1 */
    				0x140 (PIN_INPUT_PULLUP | MUX_MODE0)	/* mii1_rxd0.mii1_rxd0 */
    			>;
    		};

    And here:

    		cpsw_sleep: cpsw_sleep {
    			pinctrl-single,pins = <
    				/* Slave 1 reset value */
    				0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    				0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    				0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    				/*0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7)*/
    				/*0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7)*/
    				0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    				0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    				/*0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7)*/
    				/*0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7)*/
    				0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    				0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    				0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
    				0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)
    			>;
    		};

    After that I recompiled dtb file and changed one on the board. Now i see /dev/ttyO2. But i can't see any data on the port when i'm trying to write to it. I'm checking it using oscilloscope and there is nothing on the both lines. But at the same time /dev/ttyO1 is works fine and I can use it for data exchange with another devices. Please tell me where i did mistake.

  • Ok. I found the problem. Pin values of pins i took here dev.ti.com/.../app.html is not valid for my Beaglebone. Valid values i found here: blog.pignology.net/.../getting-uart2-devttyo1-working-on.html and all is fine now.