gpio interrupt

Has anyone successfully set up a GPIO input as an interrupt? I can read/write to the GPIO pins via the /sys interface however I would like to get an interrupt rather than poll the pin.

I see the function gpio_to_irq(unsigned gpio) but I’m not sure what do do next. Do I need a driver to monitor the irq or can the interrupt be delivered to userland. does anyone have ideas on how to do this?

Thanks.

Like you, I've got to the GPIO 0-7 lines on Pins 3,5,7,9,11,13,15,17
of the expansion header but would rather not use polling.
I've spent a few hours looking just yesterday and there appears to be
a gpio_irq_interrupt() method one can use in native code(C or C++ ).
I've been looking for something to use in Python or even sh/bash and
haven't found it. I'm running Ubuntu ARM on Beagle now so my options
are looking like this:

write a script running as root and use the /sys/class/gpio method of
GPIO control with polling and push changes out a pipe.

write a Python server app running as root, polling /sys/class/gpio and
pushing changes out a UDP service

write a service in C, running as root, using the gpio_irq_interrupt()
method and provide userland messaging for scripting langs.

I want to demo my system soon so I'll probably just use polling for
now. I'll eventually create the qemu Ubuntu image and keep it this
time so I can try loading the compiler to see how easy it is to write
C code to do this. The Ubuntu for beagleboard build process uses qemu
to build an image and then create a tarball for the rootfs while the
boot image some from somewhere else. GPIO is enabled enough for me to
get/set some signals.

Doug

Hi Doug,

Myself trying to port Ubuntu-Desktop given in http://elinux.org/BeagleBoardUbuntu, but when i did the same i’m getting some errors as shown below. I tried increasing swap space and more; still i am able to only see cursor not any GUI after me entering user name in password in Ubuntu screen.

Error Message:

"
ubuntu@beagleboard:~$ mmcblk0: error -84 transferring data
end_request: I/O error, dev mmcblk0, sector 953874
end_request: I/O error, dev mmcblk0, sector 953882
end_request: I/O error, dev mmcblk0, sector 953890
end_request: I/O error, dev mmcblk0, sector 953898
end_request: I/O error, dev mmcblk0, sector 953906
end_request: I/O error, dev mmcblk0, sector 953914
end_request: I/O error, dev mmcblk0, sector 953922
end_request: I/O error, dev mmcblk0, sector 953930
end_request: I/O error, dev mmcblk0, sector 953938
end_request: I/O error, dev mmcblk0, sector 953946
end_request: I/O error, dev mmcblk0, sector 953954
end_request: I/O error, dev mmcblk0, sector 953962
end_request: I/O error, dev mmcblk0, sector 953970
end_request: I/O error, dev mmcblk0, sector 953978
end_request: I/O error, dev mmcblk0, sector 953986
end_request: I/O error, dev mmcblk0, sector 953994

"

Can you help me.

Thanks,
Suresh Kalidasan

Hi,

Can we get some support on this? I would like to know how to write an interrupt for the beaglebone. I’m using Angstrom as the OS.

Thanks!

Jack

Are you in kernel or userspace?

I can’t answer but a few things would help others to help.

Which BeagleBone?
Which version of Angstronm, 3.2 or 3.8?

Gerald