Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12435 Discussions

how to write a costum gpio interrupt driver

Altera_Forum
Honored Contributor II
868 Views

I want to write a custom gpio interrupt driver. I just want to trigger the led in interrup handle function. 

In my probe function I register interrupt and initial the registers. 

I can see the interrupt number in /proc/interrupt after booting.  

Like below 

197: 0 0 GIC gpio_key 

but the interrupt handle function nerver execute. 

What is the problem with the driver?
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
153 Views
Altera_Forum
Honored Contributor II
153 Views

Thanks in advance. 

I'm having trouble compiling my custom device driver. I'm using the 14.1 tools.  

 

My compiled linux is in /home/user1/linux-socfpga  

My cross compiler is in /home/user1/gcc-linaro-arm-linux-gnueabihf-4.8-2013.12_linux/bin/arm-linux-gnueabihf- 

 

My device driver is in /home/user1/newDriver 

 

I'VE TRIED LOTS OF THINGS - and googled for a few hours  

 

One was -- from the newDriver directory I tried: 

# ] make ARCH=arm CROSS_COMPILE=/home/user1/gcc-linaro-arm-linux-gnueabihf-4.8-2013.12_linux/bin/arm-linux-gnueabihf- KERNEL_SRC=/home/user1/linux-socfpga 

 

IT TRIES BUT CAN'T FIND the kernel header files. 

 

Any help would be greatly appreicated.
Altera_Forum
Honored Contributor II
153 Views

 

--- Quote Start ---  

Thanks in advance. 

I'm having trouble compiling my custom device driver. I'm using the 14.1 tools.  

 

My compiled linux is in /home/user1/linux-socfpga  

My cross compiler is in /home/user1/gcc-linaro-arm-linux-gnueabihf-4.8-2013.12_linux/bin/arm-linux-gnueabihf- 

 

My device driver is in /home/user1/newDriver 

 

I'VE TRIED LOTS OF THINGS - and googled for a few hours  

 

One was -- from the newDriver directory I tried:# ] make ARCH=arm CROSS_COMPILE=/home/user1/gcc-linaro-arm-linux-gnueabihf-4.8-2013.12_linux/bin/arm-linux-gnueabihf- KERNEL_SRC=/home/user1/linux-socfpga 

 

IT TRIES BUT CAN'T FIND the kernel header files. 

 

Any help would be greatly appreicated. 

--- Quote End ---  

 

 

SOLUTION: Here is the Makefile 

 

 

KERNEL_DIR=/home/user1/linux-socfpga 

obj-m := testDriver.o 

PWD := $(shell pwd) 

default: 

$(MAKE) M=$(PWD) ARCH=arm CROSS_COMPILE=/home/user1/gcc-linaro-arm-linux-gnueabihf-4.8-2013.12_linux/bin/arm-linux-gnueabihf- -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules 

clean: 

$(MAKE) -C $(KERNEL_DIR) SUBDIRS=$(PWD) clean
Altera_Forum
Honored Contributor II
153 Views

Hey jpe1313, 

 

Can you please specify what is the content of your linux-socfpga? 

Is this : 

 

http://git.rocketboards.org/linux-socfpga.git
Altera_Forum
Honored Contributor II
153 Views

Yes, it is. There are instructions on how to get your Linux release and tools. 

 

http://www.rocketboards.org/foswiki/documentation/gsrd141compilinglinux 

 

and if you want to checkout a different kernel follow these instructions --> 

 

http://rocketboards.org/foswiki/documentation/alterasocltsirtkernel  

 

Hope that helps.
Reply