UART Problem: Receive fails until Transmit is done - Embedded

This is a discussion on UART Problem: Receive fails until Transmit is done - Embedded ; I'm running uCLinux and have a device connected to the RX line of one of my 16450-compatible UARTs. When my device is initialized (through another mechanism, not the serial port), the device sends about 16 bytes (at 9600-E-8-2) to the ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: UART Problem: Receive fails until Transmit is done

  1. UART Problem: Receive fails until Transmit is done

    I'm running uCLinux and have a device connected to the RX line of one
    of my 16450-compatible UARTs. When my device is initialized (through
    another mechanism, not the serial port), the device sends about 16
    bytes (at 9600-E-8-2) to the RX line, verified by an o'scope.

    The problem I'm seeing is that a read() will not return the received
    data until I transmit a byte. I modified the serial driver to return
    immediately in uart_tx_chars() to try get filling the FIFO out of the
    picture. Doing that and transmitting a byte in my application (the
    byte did not transmit, as shown by the scope) allowed the read() to
    work, whether the read() occurred 1 second later or 5 minutes later.

    I first saw this with my app, but tip (I tap a key and the data shows
    up) shows the same thing, so I don't think it's an initialization
    problem. I'm combing through the driver now, but does this condition
    look familiar to anyone? Any comments or suggestions would be
    appreciated.

    Thanks.


  2. Re: UART Problem: Receive fails until Transmit is done

    "hector" wrote:
    >I'm running uCLinux and have a device connected to the RX line of one
    >of my 16450-compatible UARTs. When my device is initialized (through
    >another mechanism, not the serial port), the device sends about 16
    >bytes (at 9600-E-8-2) to the RX line, verified by an o'scope.
    >
    >The problem I'm seeing is that a read() will not return the received
    >data until I transmit a byte.


    It should not work like that. I'm not sure how one would even get
    it to do that...

    >I modified the serial driver to return
    >immediately in uart_tx_chars() to try get filling the FIFO out of the
    >picture. Doing that and transmitting a byte in my application (the
    >byte did not transmit, as shown by the scope) allowed the read() to
    >work, whether the read() occurred 1 second later or 5 minutes later.
    >
    >I first saw this with my app, but tip (I tap a key and the data shows
    >up) shows the same thing, so I don't think it's an initialization
    >problem. I'm combing through the driver now, but does this condition
    >look familiar to anyone? Any comments or suggestions would be
    >appreciated.


    Something with your particular hardware???? Whatever, that is
    certainly wierd!

    Typically a serial port can be used in rx only (or tx only too)
    mode. The opposite functinality need not even be configured,
    much less used.

    --
    Floyd L. Davidson
    Ukpeagvik (Barrow, Alaska) floyd@barrow.com

  3. Re: UART Problem: Receive fails until Transmit is done

    hector wrote:
    > I'm running uCLinux and have a device connected to the RX line of one
    > of my 16450-compatible UARTs. When my device is initialized (through
    > another mechanism, not the serial port), the device sends about 16
    > bytes (at 9600-E-8-2) to the RX line, verified by an o'scope.
    >
    > The problem I'm seeing is that a read() will not return the received
    > data until I transmit a byte. I modified the serial driver to return
    > immediately in uart_tx_chars() to try get filling the FIFO out of the
    > picture. Doing that and transmitting a byte in my application (the
    > byte did not transmit, as shown by the scope) allowed the read() to
    > work, whether the read() occurred 1 second later or 5 minutes later.
    >
    > I first saw this with my app, but tip (I tap a key and the data shows
    > up) shows the same thing, so I don't think it's an initialization
    > problem. I'm combing through the driver now, but does this condition
    > look familiar to anyone? Any comments or suggestions would be
    > appreciated.
    >
    > Thanks.
    >


    Looks like a bug I've seen before. Who made the UART?

    The driver may have to do some gymnastics with the
    loopback at initialisation to get around this...

    Kind regards,

    Iwo

  4. Re: UART Problem: Receive fails until Transmit is done

    It looks familiar to me too, though it would've been years ago.

    Unfortunately I don't have the specifics on the UART, it's on-chip with
    an ARM, and not one I get to talk about yet. For what it's worth (not
    a whole lot, I know), UART port 0 is being used for the console, and it
    works as expected with incoming data.

    Iwo Mergler wrote:
    > hector wrote:
    > Looks like a bug I've seen before. Who made the UART?
    >
    > The driver may have to do some gymnastics with the
    > loopback at initialisation to get around this...
    >
    > Kind regards,
    >
    > Iwo



  5. Re: UART Problem: Receive fails until Transmit is done

    Sorry for the typo, it's a 16550-compatible, not a 16450. It has a 16
    byte FIFO.


+ Reply to Thread