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.

SK-AM62: UART Timeout

Part Number: SK-AM62

Tool/software:

Hi,

I want to understand more about _UART_TIMEOUT Registers mentioned in AM62x TRM. I am not able to see any references to it in kernel sources. 

I can see some reference to character timeout indication detection in UART_IIR. How can I set the timeout manually. Are there any samples present?

Thanks,

Chetana Patil

  • Hi Chetana,

    Please see the TRM section 12.2.4.4.8.1.3.7 "Time-Out and Break Condition".

  • Thanks Bin Liu,

    We are planning to use this register to manually set as 3.5 character with respect to baud rate , for time delimited messages. How reliable is it to generate interrupt? 

    As per errata sheet i2310  "The USART may erroneously clear or trigger the timeout interrupt when RHR/MSR/LSR registers are read"  

    In workaround it is mentioned to set timeout high, which we will not be able to manipulate.

  • Hi Chetana,

    We are planning to use this register to manually set as 3.5 character with respect to baud rate , for time delimited messages. How reliable is it to generate interrupt? 

    This has not been evaluated in Linux.

    In workaround it is mentioned to set timeout high, which we will not be able to manipulate.

    This workaround has been implemented in kernel v6.6 uart driver.

            if (priv->habit & UART_RX_TIMEOUT_QUIRK &&
                (iir & UART_IIR_RX_TIMEOUT) == UART_IIR_RX_TIMEOUT &&
                serial_port_in(port, UART_OMAP_RX_LVL) == 0) {
                    unsigned char efr2, timeout_h, timeout_l;
    
                    efr2 = serial_in(up, UART_OMAP_EFR2);
                    timeout_h = serial_in(up, UART_OMAP_TO_H);
                    timeout_l = serial_in(up, UART_OMAP_TO_L);
                    serial_out(up, UART_OMAP_TO_H, 0xFF);
                    serial_out(up, UART_OMAP_TO_L, 0xFF);
                    serial_out(up, UART_OMAP_EFR2, UART_OMAP_EFR2_TIMEOUT_BEHAVE);
                    serial_in(up, UART_IIR);
                    serial_out(up, UART_OMAP_EFR2, efr2);
                    serial_out(up, UART_OMAP_TO_H, timeout_h);
                    serial_out(up, UART_OMAP_TO_L, timeout_l);
            }

  • Thanks Bin Liu,

    where can I find the reference for code snippet that you have posted? is it available in latest SDK?

  • Hi Chetana,

    Yes it is in the SDK 10.0 kernel. Please check kernel file drivers/tty/serial/8250/8250_omap.c, line 668.