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.

AM3358: UART RX bytes delayed

Part Number: AM3358

Hello Team

I have designed a custom board using AM335x and sdk 06.03.00.106

Currently I am having an issue with UART 

I have an UART communication with PIC Controller, with 115200 rate .

I have continuous transactions from PIC to processor . Most of the times , data is received without any loss.

My PIC Controller sends 54 bytes every one second and I am receiving the same in the  processor.

Certain tines it is observed that I miss one or two bytes or upto 6 bytes. 

It is observed that sometimes PIC sends 54 bytes and that are available in the wire (confirmed with oscilloscope) but processor receives only 48 bytes when it gets triggered uart rx interrupt.

The remaining 6 bytes are added in the next reception making the next rx as 60 bytes . This lead to the corruption of data for both the transactions.

The above scenario is occurring repeatedly and creating loss of data.

I could feel this may be a FIFO issue or something.

Kindly help me at the earliest.

Mad_hu

  • Hi Mad,

    It sounds the issue is related to RX timeout interrupt. The kernel UART driver sets the RX FIFO trigger to 48 bytes (this is why the first read is 48 bytes).

    The quick workaround would be to increase the TX trigger to 54 bytes which matches the data length from the PIC.

    diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c                              
    index 2bc6b982238f..be57b303ea7c 100644                                                                             
    --- a/drivers/tty/serial/8250/8250_omap.c                 
    +++ b/drivers/tty/serial/8250/8250_omap.c                                                                           
    @@ -87,7 +87,7 @@                                         
     #define OMAP_UART_TX_WAKEUP_EN (1 << 7)                                                                            
                                                                                                                        
     #define TX_TRIGGER     1                                 
    -#define RX_TRIGGER     48                                
    +#define RX_TRIGGER     54                                                                                          
                                                                                                                        
     #define OMAP_UART_TCR_RESTORE(x)       ((x / 4) << 4)                                                              
     #define OMAP_UART_TCR_HALT(x)          ((x / 4) << 0)

  • You might also want to test with the kernel v5.10 provided in the SDK8.2, to see if there is any UART driver update which fixes the issue.

  • Hello Bin Liu

    I am in the process of upgrading from sdk 6 to sdk 8 

    When it is fully done, will try the same workaround suggested above and let you know.

    Regards

    Mad_hu