We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Showing results for 
Search instead for 
Did you mean: 
Visitor osamaamin
Registered: ‎04-28-2014

Zynq PS interrupt



I want to use the PS GPIO interrupt in my linux program. I am running Petalinux running on ZC702 Evaluation Kit. I am finding it difficult to use the interrupt in a linux based C code, as I am a beginner when it comes to linux programming. First I couldn't find much useful tutorial on a simple program that can handle interrupt from a PS GPIO pin. Eventually I found a program that uses "request_irq" to setup the interrupt handler. But now I am facing a problem that my default SDK include directory does not have "interrupt.h" file, which contains the "request_irq" function.


Can someone tell me how can I use request_irq to handle interrupts? Or is there some other way to deal with the interrupts which does not include modifications in DTS file or re-compiling the kernel?

0 Kudos
1 Reply
Xilinx Employee
Xilinx Employee
Registered: ‎03-13-2012

Re: Zynq PS interrupt

Properly handling interrupts from Linux userspace is not possible and discouraged (https://lkml.org/lkml/2014/7/8/241 ). The 'request_irq()' API you mention sounds like the kernel space interface you're most likely not able to use that from an userspace application.

The best way to do it from userspace, if you really want that, is probably through UIO (https://www.kernel.org/doc/htmldocs/uio-howto/index.html ; I don't know how up to date that document is, but seems like a good starting point).

0 Kudos