Hi Experts,
I am getting ~3ms delay when I receive data (15 bytes or less) from UART in imx7d Linux. I am using kernel 3.0
Did lot of debugging, scope capture and I see data comes from outside is good & continuous without delay, but both poll or pselect waits for some timeout to give that data to application.
Could you please help me on this? I want to receive byte as soon as it arrives on UART RX.
cat /proc/version
Linux version 4.14.170-3.0.4+gbaa6c24240a4 (oe-user@oe-host) (gcc version 8.2.0 (GCC))
measurement is done through oscilloscope triggering from first byte to 8 bytes, and measure total time on oscilloscope and then receive data into code by adding printf using time.
Receiving 1 byte or 16 bytes takes same time either just polling using read() or pselect.
pselect(max_fds + 1, &read_fd, NULL, NULL, NULL, NULL);
len = read(fd, buf, UART_DATA_LEN);
value of len is not 1 byte. it’s always 16 bytes or there is delay to receive 16 bytes even when it’s just 1 byte.
I want to receive 1 byte at a time and read shouldn’t wait for more bytes.
Hi @neeraj.verma , do you successfully apply the device tree without DMA on uart2? The default one is imx7d-colibri-emmc-eval-v3.dtb. After you copy the device tree, you’d better to run sync to really flash it to eMMC. I do the same test and here is the code. SODIMM77 will be pulled low when bytes are read. 2 bytes of data are sent to ttymxc1. The yellow line is rxd of ttymxc1, the blue line is SODIMM77. The latency from last bit on rxd to the time when SODIMM77 is pulled low is 850us.
Hi @benjamin.tx
Thank you for the details, let me refer your code and see if I am missing something (uart settings), I see two things, I am checking with my project code and I didn’t set cpu clock.
Let me try and update you.
Thank you so much for your help.