Developing LInux Kernel Module Drivers to handle interrupts on Jetson TK1

Hello everyone,

I’m a very beginner to tk1 and working on l4t. I want to develop kernel module drivers to handle interrupts created by the pressing of some buttons of a headset device connected to the board. I would like to start from a very simple kernel module to understand compiling with the l4t on the board and then carry on. Can anyone help out a beginner or direct me some reading or tutorials on this?

Thanks alot I appreciate it!

how this headset is connected to the board?

Thank you for your response.

I want to start with a sample button on a breadboad connected to tk1 board with GPIO. When the button is pressed how to handle the interrupts using a kernel module. Though, I cannot seem to compile even a simple kernel module at the moment. It gives an error as follows when i try to run the command “make”

make -C /lib/modules/3.10.40-grinch-21.3.4/build M=/home/ubuntu/Desktop/horus modules
make: *** /lib/modules/3.10.40-grinch-21.3.4/build: No such file or directory.  Stop.
make: *** [default] Error 2

There is a simpler method but you will need basic knoledge about kernel device tree.
Example: http://lxr.free-electrons.com/source/arch/arm/boot/dts/tegra124-jetson-tk1.dts#L1756

It looks like you’re facing a couple of issues in your attempt.
First, it appears as if you are trying to build for the Grinch Kernel. Do you have the sources for the Grinch Kernel (they are a little different than the default L4T Kernel sources) ?

I would suggest first trying to build a known module as practice. Here’s an example:

As an aside, here’s a couple of tutorials for dealing with GPIO in user space, which is somewhat simpler than compiling modules:

http://elinux.org/Jetson/Tutorials/GPIO

This is useful if you are dealing with some of the signals such as GPIO, UART and I2C that are brought out in the header. In general, modules are used for adding device drivers and such for hardware.