# GPIO active low push pull output glitches?

**URL:** <https://forum.legato.io/t/gpio-active-low-push-pull-output-glitches/5848>\
**Category:** Uncategorized\
**Created:** [June 18, 2021, 2:45pm UTC](https://forum.legato.io/t/gpio-active-low-push-pull-output-glitches/5848 "2021-06-18T14:45:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [June 18, 2021, 2:45pm UTC](https://forum.legato.io/t/gpio-active-low-push-pull-output-glitches/5848/1 "2021-06-18T14:45:48Z")

</div>

Anyone implementing active low push pull having problems with glitches, i.e. the signal going low and back up again upon initialization. Would be interested in hearing from anyone successfully using the le\_gpio\* routines or direct interface to Linux sysfs. 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:** [June 19, 2021, 2:39am UTC](https://forum.legato.io/t/gpio-active-low-push-pull-output-glitches/5848/2 "2021-06-19T02:39:11Z")

</div>

It has default state when reset.

I remember I have tried to change the default state of GPIO23(i.e. MDM\_GPIO\_10) of WP77 FW R9 in yocto/kernel/drivers/gpio/sierra\_gpio\_wake\_n.c.

1. open yocto/kernel/drivers/gpio/sierra\_gpio\_wake\_n.c
2. go to function wake\_n\_init(), around line 274, add the following: (Please note that I used 10 to be the gpio number, you need to change this according to your usage)

```auto
***
static int __init wake_n_init(void)
{

#if 1
gpio_request(10, "sysfs"); //GPIO23 = MDM_GPIO 10
gpio_direction_output(10, 1);   
gpio_set_value(10, 1); 

gpio_free(10); 

#endif

	return platform_driver_register(&wake_n_driver);
}
***

```

1. rebuild yocto.cwe and download to module.
2. the default state of GPIO23 will be output high.
3. after boot into console, you can use the following to control the GPIO23:

* * *

echo 23 \> /sys/class/gpio/export  
echo out \> /sys/class/gpio/gpio23/direction  
echo 0 \> /sys/class/gpio/gpio23/value  
echo 1 \> /sys/class/gpio/gpio23/value

* * *

---

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [June 22, 2021, 1:48pm UTC](https://forum.legato.io/t/gpio-active-low-push-pull-output-glitches/5848/3 "2021-06-22T13:48:20Z")

</div>

Thanks for the reply. Is there a reference matching the Linux GPIO numbers to the MDM\_GPIO numbers? I am using Linux GPIO21 which appears to be MDM\_GPIO 8 from the logging but I want to be sure.

---

<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:** [June 22, 2021, 3:21pm UTC](https://forum.legato.io/t/gpio-active-low-push-pull-output-glitches/5848/4 "2021-06-22T15:21:17Z")

</div>

I used dmesg logging to check also.

I remember you can check also in the yocto source

yocto/kernel/driver/gpio/gpiolib-sysfs.c

---

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [June 22, 2021, 6:00pm UTC](https://forum.legato.io/t/gpio-active-low-push-pull-output-glitches/5848/5 "2021-06-22T18:00:36Z")

</div>

Thanks for the suggestion. Regarding the documentation such as the mangOH schematics and the WP77xx tech reference, I assume the pin labels are the Linux GPIO numbers not MDM\_GPIO?

---

<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:** [June 22, 2021, 8:14pm UTC](https://forum.legato.io/t/gpio-active-low-push-pull-output-glitches/5848/6 "2021-06-22T20:14:38Z")

</div>

Yes, it is linux gpio

---

<div class="post-metadata">

**Author:** ![cchenry](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@cchenry](https://forum.legato.io/u/cchenry)\
**Post date:** [June 23, 2021, 6:13am UTC](https://forum.legato.io/t/gpio-active-low-push-pull-output-glitches/5848/7 "2021-06-23T06:13:02Z")

</div>

Hi @piinst,  
What version of Legato are you running? There was a bug that is fixed in 19.11 where a pulse was observed when calling le\_gpioPin\*\_Activate.  
BR,  
Chris

---

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [June 23, 2021, 2:10pm UTC](https://forum.legato.io/t/gpio-active-low-push-pull-output-glitches/5848/8 "2021-06-23T14:10:58Z")

</div>

```auto
root@swi-mdm9x28-wp:~# legato version
19.11.2_625c7d1acfd1ca45b2dbe189b4cb1ce7_modified

```
