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.
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.
- open yocto/kernel/drivers/gpio/sierra_gpio_wake_n.c
- 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)
***
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);
}
***
- rebuild yocto.cwe and download to module.
- the default state of GPIO23 will be output high.
- 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
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.
I used dmesg logging to check also.
I remember you can check also in the yocto source
yocto/kernel/driver/gpio/gpiolib-sysfs.c
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?
Yes, it is linux gpio
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
root@swi-mdm9x28-wp:~# legato version
19.11.2_625c7d1acfd1ca45b2dbe189b4cb1ce7_modified