Open chrishamm opened 9 months ago
Can you report the kernel version you are using?
Yes:
Linux ender5pro 6.1.74-12781-g74961fb0a5d2 #1 SMP PREEMPT_DYNAMIC Wed Jan 24 02:05:32 EST 2024 aarch64 GNU/Linux
So the hardware itself is only able to handle level based interrupts. The edge based interrupts are emulated and is not very good. We are checking to see if we can improve the emulation.
For hardware expansion, we recommend writing an hardware overlay attached to the GPIO binded to a gpio-key or some other driver with level-based sensing. This is more reliable in capturing GPIO voltage changes.
Thanks, an improvement would be helpful. This feature works flawlessly on Raspberry Pi boards.
Can you let us know what you're trying to do? Like PPS or something else?
I maintain software that is notified whenever it can start an SPI transaction using a GPIO pin. I observe changes to this pin using the gpiochip
device because that's pretty fast and way faster than the classic sysfs interface (which is now deprecated anyway AFAIR). These transactions are performed multiple times per second.
You can set static level-based interrupts in the device tree rather than software-emulated dual-edge GPIO via gpiod_to_irq function. Level-based interrupts are far more reliable on this platform than edge based ones, especially at high frequency.
I've been trying to get my application running on a Le Potato AML-S905X-CC but after some debugging I found out that the gpiochip driver does not report high -> low transitions correctly.
It's easy to reproduce e.g. for pin 22 on the main header:
When I play with a standard jumper cable, I get a few FALLING EDGE reports here and there but not always between RISING EDGE messages as I'd expect.
I'm using an up-to-date Debian 12 base image from Libre Computer.