# GPIO interrupt speed

**URL:** <https://forum.legato.io/t/gpio-interrupt-speed/6167>\
**Category:** Legato Application Framework\
**Created:** [April 4, 2022, 7:21am UTC](https://forum.legato.io/t/gpio-interrupt-speed/6167 "2022-04-04T07:21:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elmoo](https://avatars.discourse-cdn.com/v4/letter/e/ecae2f/32.png) [@Elmoo](https://forum.legato.io/u/Elmoo)\
**Post date:** [April 4, 2022, 7:21am UTC](https://forum.legato.io/t/gpio-interrupt-speed/6167/1 "2022-04-04T07:21:47Z")

</div>

Hi,  
how fast GPIO input pins react to interrupts? I have an interrupts coming with interval of ~500 microseconds and it seems that some of the inputs are lost. Is GPIO api capable of processing inputs happening that often?

-Elmo

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 4, 2022, 9:38am UTC](https://forum.legato.io/t/gpio-interrupt-speed/6167/2 "2022-04-04T09:38:52Z")

</div>

Try to use kernel driver for GPIO interrupt and see if it has improvement.

> **[Error while using Dataclock with GPIOs](https://mangoh.discourse.group/t/error-while-using-dataclock-with-gpios/9119)**
>
> Hi, I am currently trying to use Dataclock devices with my mangOH Red. I have an input clock signal on a GPIO and an input Data signal on another GPIO. When there is an interruption on the falling edge of the clock signal (every 1ms...

---

<div class="post-metadata">

**Author:** ![Elmoo](https://avatars.discourse-cdn.com/v4/letter/e/ecae2f/32.png) [@Elmoo](https://forum.legato.io/u/Elmoo)\
**Post date:** [April 4, 2022, 10:49am UTC](https://forum.legato.io/t/gpio-interrupt-speed/6167/3 "2022-04-04T10:49:35Z")

</div>

Thanks! I’m not too familiar with kernel drivers so is there any instructions to use provided gpio\_interrupt.rar with leaf environment and wp7607?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 4, 2022, 11:34am UTC](https://forum.legato.io/t/gpio-interrupt-speed/6167/4 "2022-04-04T11:34:17Z")

</div>

You need to edit the makefile to use the toolchain in leaf package to compile

You also need to see this:

> [@spiService and gpioService are not starting within an Application](https://forum.legato.io/t/spiservice-and-gpioservice-are-not-starting-within-an-application/5907/14):
>
> That’s what I did slight_smile Now it’s working. The problem seems to be in these lines: 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. Regards, Simon

---

<div class="post-metadata">

**Author:** ![Elmoo](https://avatars.discourse-cdn.com/v4/letter/e/ecae2f/32.png) [@Elmoo](https://forum.legato.io/u/Elmoo)\
**Post date:** [April 5, 2022, 1:36pm UTC](https://forum.legato.io/t/gpio-interrupt-speed/6167/5 "2022-04-05T13:36:34Z")

</div>

I managed to create and install kernel module. I was trying to use gpios 21 and 22 (60 and 61) when driver failed with error -16, saying gpios were already in use. I checked /proc/interrupts and there was no one using those pins. After I removed gpioService from default.sdef, it started working. Is it not possible to use driver at the same time with gpioService?

Elmo

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 5, 2022, 3:14pm UTC](https://forum.legato.io/t/gpio-interrupt-speed/6167/6 "2022-04-05T15:14:32Z")

</div>

you can check whether the gpio is in /sys/class/gpio/export
