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.

Am335x uart tx/rx line error status event detection from user space

Hi,

      I need a help on the UART module. We are using am3352BZC series processor  in our customized Hardware, with uart ports configured as below:

UAART0--> console

UART1,3,4 and 5 used for functionality test with following lines.

Tx,Rx and GND (Half duplex mode connction).

We are trying to detect UART line error events such as port removal (manual removal of uart tx/rx connection), invalid signal, etc, from user space. We are trying to get the error info from the registers like LSR, , but we are enot able to get anything respect to the port connection failure. Right now we are only detecting the "read" failure from the driver when there is a port disconnection, but not sure how to detect if this failure is due to port disconnection.

Can anyone help how to identify the exact error event from user space when there is a Tx/Rx failure happen?

Regrads,

Venkatesh

  • Hi,

    The AM335X UART has no hardware support for detection of line disconnected event. You will probably need to implement some sort of periodic "test" TX-RX message with timeout to do this.
  • Hi Biser,

       Thanks for your  support,  As of now iam  identifying rx line dropped based on the timeout logic.

    For example i have  connected uart 1 port to uart 3. uart 3 is rx mode and uart 1 is tx mode configuration, First I stared theuart 3  rx mode and timeout of 30s, then immediatly i stared the uart1 with tx .If uart1 not strted within 30 sec then rx got timeout and exit from the receive mode.

    Any register setting are available to detect this condition.

    Regards,

    Venkatesh

  • Another possibility: If you enable a pulldown resistor on the RX line (or place an external pulldown), respectively pullup resistor on the TX line (or place an external pullup), then you will get a BREAK condition on disconnect (bit RXBI in the LSR_UART Register).
  •  

    Hi Biser,

       Thanks for your update.

      I tested based on your sugesstion,In dts file i changed following uart1 and 3 settings

    uart1_pins:{

    0x180 (PIN_INPUT_PULLDOWN | MUX_MODE0)  //rx

    0x184 (PIN_OUTPUT_PULLUP | MUX_MODE0)  //tx

      }

    uart3_pins:{

    0x160 (PIN_INPUT_PULLDOWN | MUX_MODE0) //rx

    0x164 (PIN_OUTPUT_PULLUP | MUX_MODE0) //tx

      }

    After that i started the testing with uart3 in  rx and uart1 in  tx mode of operation,But i got LSR value as 0x60/0x61 only.

    In my hardware connection

    Uart1->Buffer chip->IP functional chip->Uart1 External connector( 3pin)->o/p

    o/p->Uart 3 External connector(3pin)->IP functional chip->BufferChip->Uart3

    Between these uarts of 1 and 3 i  used buffer chip and IP functional chip this will make any issue with this bit of LSR[4] (LSR_RXBI] logic.

     Regards,

    Venkatesh

  • If you are using an external RS-232 driver (IP functional chip?), probably it holds the RX line high and prevents break condition.
  • Hi Biser,

        Ya thanks for your reply, is it any other possible way or work around  to detect this condition by using my existing hardware setup.

    Regards,

    Venkatesh

  • I can't think of any other solution, sorry.
  • Hi Biser, Ya thanks for your support.Regards,Venkatesh