Latency receive on serial link wec2013

Hi everyone,
I test latency for receive datas on serial link.


You can see on this picture we have 2ms delay for read value on Wec2013 !

On wec6 we have 400µs.
I join my source code.
ConsoleApplication1.cpp (3.4 KB)

Can you help me please,


Colibri Imx6
Boot version 1.6
OS: 1.6
Uart 2

What are the Ch1 and the Ch2?

Yes,
CH1 = rx wire colibri
CH2 = tx wire colibri

To have
According to Microsoft documentation, to make ReadFile return after first byte received you shouold
" sets ReadIntervalTimeout and ReadTotalTimeoutMultiplier to MAXDWORD and sets ReadTotalTimeoutConstant to a value greater than zero and less than MAXDWORD"
But in you app you have only ReadIntervalTimeout set to MAXDWORD. All other timeouts are zero

	COMMTIMEOUTS newTimeouts = { MAXDWORD,0,0,0,0 };

	if (!SetCommTimeouts(*serialHandle, &newTimeouts))

Hi alex,
Thank your help.
I tried with the following instruction COMMTIMEOUTS newTimeouts = { MAXDWORD,MAXDWORD,1,0,0 };
unfortunatly, result is the same, I still have to 2ms delay on read.

Hi,
@alex.tx have you more information about this subject ?

Thank you?

Hi @alex.tx

We performed more test on this issue and I want to inform you about where we are.

We executed exactly the same appliaction on our legacy hardware, IMX27 and wince6 (home made BSP), delay mesured is arround 470µs (see attached snapshot).

So this is showing an issue with this application executed on Colibri IMX6 (Solo and Dual) with WEC2013.

Toradex help will be appreciated.

Could you try to set a higher thread priority (lower than 248) using CeSetThreadPriority() ?

Range Description
zero through 96 Reserved for real-time drivers.
97 through 152 Used by default device drivers.
153 through 247 Reserved for real-time below drivers.
248 through 255 Maps to non-real-time priorities for applications.

Hi, we made some test with different thread priority. We got the same result for all configuration. Thread priority changes does not reduce the latensy

Could you share a source code?

Hi,

I attach my source code on this reply

Thanks
ConsoleApplication1.cpp (4.9 KB)