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.

UART digital loopback

Guru 20755 points

Hello,

I have configured all UART'S in OMAP L138 EVM in the same configuration, but encounter different behaviour between UART0 and the other UART'S on board (UART1 & UART2).

Although the configuration is the same (configured also in loopback mode), uart0 acts wrong:
when I send DWORD in UART0: 0x99887766, recieved DWORD is: 0x88776699.
As I said this behaviour is unique in UART0.
I have also checked the pin mux configuration again and again, but found no problem in the configuration.

Does Anyone have any ideas ?

Regards,

Ran

  • Ran,

     Could you please provide the configuration details?

    Regards,

    N.Sugumar

  • Hello Natarajan,

    Only in UART0 I can read more bits at the start  (after intialization). It can be from 10 to up to 22 chars of zero. Afterward the behaviour is the same as in UART1 and UART2.
    It is as if after initialization there are several bits waiting in the UART0, from unkown reason. I can "by-pass" this problem by reading all the "dummy" chararacters after initialization, though it is still strange that UART0 behaves different then other UART's.

    Thank you very much,

    Ran

    UART1 configuration:

    U-Boot > md 0x1d0c000 40
    01d0c000: 00000000 00000000 000000c1 00000003    ................
    01d0c010: 00000003 00000060 00000000 00000000    ....`...........
    01d0c020: 00000051 00000000 44141102 00000000    Q..........D....

    UART0 configuration:

    U-Boot > md 0x1c42000 40
    01c42000: 00000000 00000000 000000c1 00000003    ................
    01c42010: 00000003 000000fb 00000011 00000000    ................
    01c42020: 00000051 00000000 44141102 00000000    Q..........D....

  • Ran,

    ran shalit said:
    U-Boot > md 0x1c42000 40
    01c42000: 00000000 00000000 000000c1 00000003    ................
    01c42010: 00000003 000000fb 00000011 00000000    ................
    01c42020: 00000051 00000000 44141102 00000000    Q..........D....

    Line status register of UART0 shows overrun error[ @0x01c42014 = 0xFB] in FIFO  So, just before transmitting any data, make sure to clear  FIFO  by writing 1 to the TXCLR and RXCLR bit of FIFO control register. This should solve the issue.

    Regards,

    N.sugumar

  • Hi Natarajan,

    I tried to clear the Tx AND Rx FIFO, but it did not work ( also  in the initialization of the UART there is also clear of FIFO).
    It is also interesting to note that when dumping the UART0 registers to watch its values, the values of LSR change between 0x60 to 0xf9 (after initialization, in consecutive dumping on shell I see something else, as if something is not stable in that UART). It seems that reading the waiting characters after initilization can "by-pass" this problem, and after that the LSR value is stable (0x60), so I will probably just do that meanwhile (and hoping that there is not any other hidden problem here).

    Have a Good Day,

    Ran

  • Hi Natarajn,

    After analyzing and checking the code again, I noticed that setting the loopback mode was done, after intialization process. When doing it inside the initilization process the overrun problem is solved (though I did not find in the datasheet that it is said to set the digital loopback mode inside the initilization process)

    Thanks for the help,

    Ran