# Gpio ChangeEventHandler stops working after a few hours

**URL:** <https://forum.legato.io/t/gpio-changeeventhandler-stops-working-after-a-few-hours/5809>\
**Category:** Legato Application Framework\
**Created:** [May 28, 2021, 6:12am UTC](https://forum.legato.io/t/gpio-changeeventhandler-stops-working-after-a-few-hours/5809 "2021-05-28T06:12:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Riegosalz](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@Riegosalz](https://forum.legato.io/u/Riegosalz)\
**Post date:** [May 28, 2021, 6:12am UTC](https://forum.legato.io/t/gpio-changeeventhandler-stops-working-after-a-few-hours/5809/1 "2021-05-28T06:12:49Z")

</div>

Hello!  
WP8548  
legato 18.06.4

In a simple test software:

 ![codigo](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/2X/a/a23fd30e65fcf89e824c547d88c2bada68bc3f4a.png)

In gpio36 I connect a 5Hz square signal. The program works OK but about 8 hours later, the signal is not detected. if I read the signal with “le\_w\_pulsos\_Read();” I see how this signal chages, but the callback function does not execute.  
when it works OK, I see in gpioservice log this:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/2X/2/26c2cae8788a55e0c1020c33f7b84653c8a93526.png)  
But when te program stop working properly, so the gpioservice logs also stop.

In this situation if I change the other GPIO38 (not gpio36), then all work OK again!

---

<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:** [May 28, 2021, 6:26am UTC](https://forum.legato.io/t/gpio-changeeventhandler-stops-working-after-a-few-hours/5809/2 "2021-05-28T06:26:37Z")

</div>

Does it work if restarting the application?

---

<div class="post-metadata">

**Author:** ![Riegosalz](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@Riegosalz](https://forum.legato.io/u/Riegosalz)\
**Post date:** [May 28, 2021, 6:31am UTC](https://forum.legato.io/t/gpio-changeeventhandler-stops-working-after-a-few-hours/5809/3 "2021-05-28T06:31:08Z")

</div>

mmm … I don’t remember …  
I try and tell you. But I have to wait for it to fail  
thanks

---

<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:** [May 28, 2021, 6:31am UTC](https://forum.legato.io/t/gpio-changeeventhandler-stops-working-after-a-few-hours/5809/4 "2021-05-28T06:31:49Z")

</div>

You might also consider to use gpio interrupt on kernel driver

> **[Error while using Dataclock with GPIOs](https://forum.mangoh.io/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:** ![Riegosalz](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@Riegosalz](https://forum.legato.io/u/Riegosalz)\
**Post date:** [May 31, 2021, 4:58am UTC](https://forum.legato.io/t/gpio-changeeventhandler-stops-working-after-a-few-hours/5809/5 "2021-05-31T04:58:40Z")

</div>

Yes, if retarting the application, it work fine.

---

<div class="post-metadata">

**Author:** ![Riegosalz](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@Riegosalz](https://forum.legato.io/u/Riegosalz)\
**Post date:** [May 31, 2021, 5:03am UTC](https://forum.legato.io/t/gpio-changeeventhandler-stops-working-after-a-few-hours/5809/6 "2021-05-31T05:03:38Z")

</div>

Okay I’ll try … I’m not a Linux expert.  
Is it also for extension GPIO or only for core GPIO?  
thanks

---

<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:** [May 31, 2021, 5:17am UTC](https://forum.legato.io/t/gpio-changeeventhandler-stops-working-after-a-few-hours/5809/7 "2021-05-31T05:17:21Z")

</div>

you might also see the sample application and see the callback function Pin22GpioSignal() :

> <https://github.com/legatoproject/legato-af/blob/master/apps/sample/gpioCf3Demo/gpioCf3PinComponent/gpioCf3Pin.c>

---

<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:** [May 31, 2021, 5:17am UTC](https://forum.legato.io/t/gpio-changeeventhandler-stops-working-after-a-few-hours/5809/8 "2021-05-31T05:17:44Z")

</div>

The kernel driver is for modem core GPIO only.
