Tool/software: Linux
Hi
I'm running on a custom board based on the beaglebone running kernel 4.4.19
root@am335x-evm:~/cm# uname -a Linux am335x-evm 4.4.19-gdb0b54cdad #238 PREEMPT Fri Aug 25 16:25:18 AEST 2017 armv7l GNU/Linux
I'm wondering what is the best way to get fast and efficient UART comms.
The board has been laid out such that there is a UART for comms between the am3352 and a DSP
There is also a GPIO that serves as a IRQ from the DSP to the am3352.
The process flow is as follows.
- DSP asserts IRQ GPIO line
- DSP sends 22 bytes on UART
- am3352 detects IRQ GPIO and sends 12bytes to DSP
- am3352 receives bytes from UART
There is an exchange like this every 10mS.
Presently I am calling poll watching on the file descriptors for both the GPIO and UART nodes.
The UART port is configured for 115k2 baud, raw mode and low latency.
With this configuration I find that the 22bytes is normally read in 3 blocks.
i.e. every 10ms the poll returns once for the GPIO and three times for the UART
Watching using top this process is using 93% of the CPU; which seems quite excessive.
Ideally I would be looking to specify that the UART notified of incoming bytes after a "timeout" of about 200uS; so that I could read the bytes out once
However VTIME in the termios struct only has resolution of 0.1S
- does anyone know of a way to configure the behaviour of a tty node in raw mode with finer resolution than this?
- or is there another way to do this?
Thanks for any suggestions.
All the best,
Richard