I do not have the exact statistic on the timing on these SPI,GPIO, IPC module.
But I can share my experience with you in this aspect.
I tried to write a legato application to toogle the GPIO state every 250 usec in order to generate a PWM signal of 2000Hz with IPC to GPIO service.
However, the result is that it can just generate about 950 Hz signal.
Not even meeting half of the requirement…
Later I tried to implement the PWM signal by kernel driver module with hardware kernel timer.
The performance is quite good that it can achieve 1.8KHz.
So to reduce latency, I would suggest you making a try on kernel driver module.
I haven’t changed anything from your code. The GPIO is 79, which should be le_gpio42, right?
I also already used it in my test code with the gpioService and was able to get an interrupt.
I just found out, that the request_irq doesn’t seem to be the problem. It’s crashing when I change the GPIO level. So something in calling ebbgpio_irq_handler seems to cause the problem
struct task_struct* t;
/* find the task with that pid */
t = pid_task(find_pid_ns(TargetPID, &init_pid_ns), PIDTYPE_PID);
send_sig(SIGINT, t, 0);
One of these functions crashed the module. Since I don’t need them, I don’t care, but maybe you can fix that before sending it to the next guy that also will waste time on that.
That part is originally used to wake up a legato application (e.g. hello2)
1. run the following command to find out the pid of hello2
ps aux | grep hello2
root 1899 0.0 0.5 2932 996 ? S 05:37 0:00 hello2
2. echo 1899 > /sys/module/helloworld/parameters/TargetPID