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.

DM368 Uart0 Linux App

Expert 1840 points


Hi,

I am working with DM368 and software v2.6. In our camera, we used UART 1 for debug and UART0 for control an Sony Block Cam by Visca protocal.

But I don't know how to activate or use this UART0 for this requirement. Please hep me for an instruction.

  • I guess you can use read() and write() system calls to access /dev/ttyS0

  • hi,

    In the camera, root/dev/ don't have a note for ttyS0. I have already checked the ti_davinci/documentation/devices.txt and saw these:

    4 char    TTY devices
              0 = /dev/tty0        Current virtual console

              1 = /dev/tty1        First virtual console
                ...
             63 = /dev/tty63    63rd virtual console
             64 = /dev/ttyS0    First UART serial port
                ...
            255 = /dev/ttyS191    192nd UART serial port

            UART serial ports refer to 8250/16450/16550 series devices.

    I used command: mknod /dev/ttyS0 c 4 64 to create a node of Serial port. and then used

    fd = open(device_name, O_RDWR | O_NDELAY | O_NOCTTY);  // open device

    err = write(iface->port_fd, packet->bytes, packet->length); // write data to device

    // read data from device

    ioctl(iface->port_fd, FIONREAD, &(iface->bytes));

    bytes_read=read(iface->port_fd, &iface->ibuf[pos], 1);

    Actually, in camera, we have /dev/tts/0 and /dev/tts/1, I guess they are also present to UART0 and UART1 and I tried to do same process with them but no data responses.

    I also checked the board-dm368-ipnc.c and saw that UART has already initialized by serial ports 8250.

    If you have more idea please give me a hand, thanks.