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.

trouble with using UART (ttyS1) in MontaVista on DVEVM DM355

I have a problem with serial interface (UART) on embedded Monta Vista, which included in my DVEVM kit (from Texas Innstruments, the DM355 processor). The core of problem is - after booting, embedded MontaVista have no serial interfaces in /dev. I use NAND Flash boot procedure with NFS. But, first of all, console works correct - it means that, at least one serial (ttyS0) is in system. This serial don't see in /dev, but its initialization can be founded in kernel ring buffer, so as two others serial ports:

# dmesg | grep tty
ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A
ttyS1 at MMIO 0x1c20400 (irq = 41) is a 16550A
ttyS2 at MMIO 0x1e06000 (irq = 14) is a 16550A


First question is - why in console input/output by ttyS0 is accessible, but no devices with this name are in /dev.

Second (and main) problem. I want to use ttyS1 for transmission  and receiving data from other external device.

I cann't find it in /dev, like previous and did that

# mknod -m 666 /dev/ttyS1 c 4 65

or

# cd /dev
# ./MAKEDEV ttyS1    

After that, device appears

# setrerial -bg /dev/ttyS1
/dev/ttyS1 at 0x0000 (irq = 41) is a 16550A

but with zero port address!

I also did

# setserial /dev/ttyS1 port 0x1c20400

address is from request for 'dmesg | grep tty' command.

At last, it looks like normal device

# setserial -bg /dev/ttyS1
/dev/ttyS1 at 0x1c20400 (irq = 41) is a 16550A

So, I tried to open port - successful. But process of transmit/receive data - don't work at all.

Maybe I maked mistakes, or omit some operations for correct port setup?
And my question is - what can i do for correct config UART and how I can work with it?

  • Please note that only UART0 is enabled by default as other UARTS are pinmuxed with other hardware features (see data-sheet); hence you need to consider if you can give up those features before enabling other UARTs. 

    That said, what DVSDK version are you using; in DVSDK 1.30 there was a minor bug which can be resolved by modify the functions as shown below:

    File: arch/arm/mach-davinci/serial.c

    static inline unsigned int davinci_serial_in(struct plat_serial8250_port *up,
                                                 int offset)
    {
            offset <<= up->regshift;
            return (unsigned int)__raw_readw(up->membase + offset);
    }

    static inline void davinci_serial_outp(struct plat_serial8250_port *p,
                                           int offset, int value)
    {
            offset <<= p->regshift;
            __raw_writew(value, p->membase + offset);
    }

    Rebuild the kernel after modifying the above file.

    - create the device ttyS1 

    - Configure ttyS1 using stty command (optional)

    - check serial driver status

    root@156.117.95.55:~# cat /proc/tty/driver/serial
    serinfo:1.0 driver revision:
    0: uart:16550A mmio:0x01C20000 irq:40 tx:26461 rx:398 RTS|CTS|DTR|DSR
    1: uart:16550A mmio:0x01C20400 irq:41 tx:0 rx:0 CTS|DSR
    2: uart:16550A mmio:0x01E06000 irq:14 tx:0 rx:0 CTS|DSR
    3: uart:unknown port:00000000 irq:0
    root@156.117.95.55:~#

    - Write to UART1 "echo this > /dev/ttyS1

    - check serial driver status

    root@156.117.95.55:~# cat /proc/tty/driver/serial
    serinfo:1.0 driver revision:
    0: uart:16550A mmio:0x01C20000 irq:40 tx:26461 rx:398 RTS|CTS|DTR|DSR
    1: uart:16550A mmio:0x01C20400 irq:41 tx:5 rx:0 CTS|DSR
    2: uart:16550A mmio:0x01E06000 irq:14 tx:0 rx:0 CTS|DSR
    3: uart:unknown port:00000000 irq:0
    root@156.117.95.55:~#

    This shows the driver xmited 5 characters.

  • Irrefragable answer! Thanks a lot! All works correct!