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.

TMDSCNCD263: Getting Overrun error for rx when Cdd Uart is configured in polling method

Part Number: TMDSCNCD263

Hii,

Currently I'm using MCAL_AM263x_08.06.02 version package in my project. 

I configured Uart1 in polling mode with 115200 baud rate .  Uart Transmission is working as expected. 

For receive , I'm getting overrun error .    timeout counter is configured to 20000.  On what basis, the timeout value to be chosen?

How to resolve this issue ?

Attached code snippet for you reference

  • Hi Palanikumar,

    The timeout is configured to a known value during developement which turned out to be 20000 ticks. It is just a value chosen which can be changed accordingly by users depending on the application's use. 

    I have forwarded the ticket to our MCAL SW team, they can help you more in case of any queries.

    Thanks

  • Hi ,

    Thank you for trying it out and reverting with the details.

    So, I see that your code snippet firstly tries to transmit a buffer using UART1 instance and then waits for reading characters in Polling mode, but for the same word length as specified with BUFFER_SIZE macro (possibly shared between transmission and receival). Please ensure whether that is the correct expected count of words for reading, and also ensure that the serial terminal configuration parameters viz., Baud Rate, Parity, Stop Bits, Data size, and any rest matches exactly with the configuration set for the UART instance in the configurator plugin. Usually when configuration would mismatch around baud rate or any data packet parameter that could cause an overrun will raise an overrun error during receival as reading is bound to fail for it.

    For Timeout value, it needs to be set accordingly as per the system clock tick duration and you can use a suitable value for it, it is internally used in the read/write APIs only for data transfer in Polling mode.

    Please ensure whether the remaining configurable parameters are set correctly and comment below if the issue still persists.

    Hope it helps.

    Thanks,

    Harshit

  • Hii Harshit,

    I verified the Uart configuration in both serial terminal and in EB.  both are same .

    I resolved the issue .  Actual problem is that In stub code , Transmission is triggered , right after immediately , go receive state . So it leads to overrun error.

    Modified the stub code such a way that Receive state will be called on next cycle after transmission completed to avoid overrun error.

    Do we have any interfaces to get status of both Tx and Rx completion in polling in Cdd uart module ?

  • Hi,

    Great that you were able to identify and resolve it by modifying the stub.

    Additionally, Mcal_CacheP based APIs used in your lines 46, 51 and 54 are applicable for Cache Coherence and are required only for DMA mode data transfer, so feel free to discard them for Polling mode-based application.

    After the transmission was triggered and before going to receive state, didn't the transmission complete (you should be able to see the starting message written on the terminal entirely in case of complete transmission)? Ideally, `Write()` API should complete the transfer of data before returning in Polling mode, please update in case of a deviation and let us have a further check on it.

    Thanks for the update on resolution.

    -Harshit