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.

Getting ttyO2 and ttyO3 to work?

Other Parts Discussed in Thread: AM3352

Guys,

Are there any additional steps that need to be done to get /dev/ttyO2 and /dev/ttyO3 working in the linux-3.2.0-psp05.06.00.00 package?  I believe I am pinmuxing them correctly:

static struct pinmux_config uart2_pin_mux[] = {
        {"spi0_sclk.uart2_rxd", OMAP_MUX_MODE1 | AM33XX_SLEWCTRL_SLOW |
                                                AM33XX_PIN_INPUT_PULLUP},
        {"spi0_d0.uart2_txd", OMAP_MUX_MODE1 | AM33XX_PULL_UP |
                                                AM33XX_PULL_DISA |
                                                AM33XX_SLEWCTRL_SLOW},
        {NULL, 0},
};

static struct pinmux_config uart3_pin_mux[] = {
        {"spi0_cs1.uart3_rxd", AM33XX_PIN_INPUT_PULLUP},
        {"ecap0_in_pwm0_out.uart3_txd", AM33XX_PULL_ENBL},
        {NULL, 0},
};

In my current test setup I have an RS-485 serial signal going from my test PC to my board, looks like it's correctly converted to 3.3V TTL by the line driver and I can see what looks like a regular 3.3V TTL serial set of data bits present on the uart3 RX pin to the CPU.  For my test I ran picocom on /dev/ttyO3 and was expecting to see the characters I'm sending echoed on the console, but I don't see anything.  ttyO0 is working fine as my console port.  The chip is an AM3352.

My Linux startup seems to indicate all serial ports are being initialized (below).  Are there any additional steps that need to be taken to get all the serial ports to work.

[    0.683258] omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0
[    1.332611] console [ttyO0] enabled
[    1.338928] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
[    1.349273] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
[    1.360382] omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
[    1.371520] omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
[    1.381805] omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5

  • Hi Sean,

    To check if everything is pinmuxed correctly, do the following:

    mount -t debugfs none /sys/kernel/debug/
    cat /sys/kernel/debug/omap_mux/spi0_sclk
    cat /sys/kernel/debug/omap_mux/spi0_d0
    cat /sys/kernel/debug/omap_mux/spi0_cd1
    cat /sys/kernel/debug/omap_mux/ecap0_in_pwm0_out

    These commands will show you how these pins are muxed.

    Also note that the ecap0 pin is used in the gen_purp_evm_dev_cfg[], so please make sure you are not causing any conflicts.

    A similar issue was answered here some time ago:

    Miroslav Kiradzhiyski XID said:
    I just tried Profile 3 on the AM335x EVM board and UART2 works fine. Please try to test UART2 using microcom instead of your application. Microcom is part of the busybox binary, which is included in the Arago filesystem, which is part of the official TI AM335x SDK.

    Here are my steps:

    On EVM board:

    1. I switched to Profile 3 which uses UART0, UART1 and UART2.
    2. I started the board (UART0 is used for serial console to the PC).
    3. Start serial communication through UART2: microcom -s 115200 /dev/ttyO2

    On my host PC:

    1. Start serial communication with the board using picocom (you may use minicom or whatever you wish):
    sudo picocom -b 115200 /dev/ttyUSB0 (I'm using a RS232 to USB converter - your port may be different)

    Whatever you type at either end of the communication, it should appear at the other (no echo to the sender).

    Best regards,
    Miroslav

  • Hi Miroslav,

    Thanks for the informed comments.  Today I got ttyO1 working in TTL loopback mode.  I am still having problems getting bytes received on ttyO2 and ttyO3 however.  In my current setup I have a test PC generating RS-485 traffic to the ttyO3 port.  This is converted to TTL seemingly OK by the line driver (looked at it on the CRO).  I never see any characters received on ttyO2 or ttyO3 however.

    Debugfs settings for ttyO3 are:

    root@arm:~# cat /sys/kernel/debug/omap_mux/ecap0_in_pwm0_out
    name: ecap0_in_pwm0_out.uart3_txd (0x44e10964/0x964 = 0x0009), b NA, t NA
    mode: OMAP_MUX_MODE1 | AM33XX_PULL_DISA
    signals: ecap0_in_pwm0_out | uart3_txd | spi1_cs1 | NA | spi1_sclk | mmc0_sdwp | NA | gpio0_7

    and the pinmux settings for the three ports are below.  What about pull-ups or pull-downs on the rxd lines, are they required?  Also do we need to set the slow slew control bits on these serial lines?

    /* pin mix for SunDAC uart1 */
    static struct pinmux_config sundac_uart1_pin_mux[] = {
            {"uart1_rxd", OMAP_MUX_MODE0 | AM33XX_INPUT_EN},
            {"uart1_txd", OMAP_MUX_MODE0},
            {NULL, 0},
    };

    /* Module pin mux for uart2 */
    static struct pinmux_config uart2_pin_mux[] = {
            {"spi0_sclk.uart2_rxd", OMAP_MUX_MODE1 | AM33XX_INPUT_EN},
            {"spi0_d0.uart2_txd", OMAP_MUX_MODE1},
            {NULL, 0},
    };

    /* Module pin mux for uart3 */
    static struct pinmux_config uart3_pin_mux[] = {
            {"spi0_cs1.uart3_rxd",  OMAP_MUX_MODE1 | AM33XX_INPUT_EN},
            {"ecap0_in_pwm0_out.uart3_txd", OMAP_MUX_MODE1},
            {NULL, 0},
    };

  • I've also tried sending a direct 3.3V TTL level serial stream into the RX pin of ttyO5, but get nothing.  Is there some kind of hardware handshaking that needs to be disabled?  Why would it work on ttyO0 an ttyO1 and not the other ports?

    Also where exactly is the serial driver for the AM3352?

    TI please chime in,

  • One thing I notice is that in this diff it mentions enabling UART2

    http://arago-project.org/git/projects/?p=linux-am33x.git;a=blobdiff;f=arch/arm/mach-omap2/omap_hwmod_33xx_data.c;h=61d6cbaf32e582e23a32f4398418500635b8d7b2;hp=f5b1786f71c03f5fb6aff9915bde1bb6c8be16c5;hb=94082f35882b7da6256c9609e17fa1047d9477c7;hpb=0987862149575e557d50b2fc0cce21e2c04a257b

    Looking at

    "arch/arm/mach-omap2/omap_hwmod_33xx_data.c"

    I notice that the definition for uart5 seems to refer to uart1's DMA settings:

    static struct omap_hwmod am33xx_uart5_hwmod = {
            .name           = "uart5",
            .class          = &uart_class,
            .clkdm_name     = "l4ls_clkdm",
            .mpu_irqs       = am33xx_uart5_irqs,
            .main_clk       = "uart5_fck",
            .sdma_reqs      = uart1_edma_reqs,
            .prcm           = {
                    .omap4  = {
                            .clkctrl_offs   = AM33XX_CM_PER_UART4_CLKCTRL_OFFSET,
                            .modulemode     = MODULEMODE_SWCTRL,
                    },
            },
            .slaves         = am33xx_uart5_slaves,
            .slaves_cnt     = ARRAY_SIZE(am33xx_uart5_slaves),
    };

    Is this correct or should there be a separate definition for UART5's DMA channels?  If so, what are the numeric values of the DMA channels for UART5?

  • This has been resolved in the following related thread.

    [AM335x] Board Porting - Enable UART 3/4/5