GPIO on Beaglebone Black using Xenomai

Hello,

I patched the linux kernel 3.8.13 with Xenomai 2.6.3 using Robert Nelson instructions : https://github.com/cdsteinkuehler/linux-dev/tree/3.8.13-xenomai/patches, and I want to capture interrupt GPIOs using the Xenomai API on the Pin 12 on the P9 header (gpio_1[28] ==> GPIO 60), using this code :

/*

  • main.cpp

Could you describe the process how you managed to get that image?

<snip>

I want to capture the interruption by using a button connected to that
GPIO, because BBB can capture 1-0 or 0-1 interruption. So, if everything is
alright and I press the button, "rt_intr_wait" will deblock (it's a
blocking fonction) and will print "Interruption OK".

The main problem is "rt_intr_create", where I don't know the correct value
to use, because the GPIO number is not the correct the value to use, the
value I need to know is the value used by the kernel ID that is linked with
the GPIO. However, I can't find this information anywhere. At the opposite
of some cards, like FOXG20, which tell me what is the ID number depending
of the kernel version :http://www.acmesystems.it/pinout_foxg20

So I think I should find a similar information in the BBB documentation
(and the Texas Instruement documentation too) , but I can't find it
anywhere. I need a lot of help on this, I hope you guys can help me.

I'd ask on the Xenomai list.

Hi Daivy, I am currently having the same problem, and I would like to know if you have solved it already. Even I am not using BBB I am pretty sure it must be almost the same procedure.

Thanks

Felipe

I got the same problem, I am using this image : http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

Anybody did it ?

Hi Matteo, actually I did solved it for the raspberry Pi. It should be a similar solution for your case:

To create interruptions in Xenomai is necessary the use of the function rt_intr_create that requires as a parameter the hardware interrupt channel associated with the interrupt object, this value is architecture dependent. To find the specified hardware interrupt channel it is necessary to download the linux header for the Raspberry Pi using the command: sudo apt-get install linux-headers-3.10-3-rpi. Once this headers are installed, the specified channel can be obtained, calling gpio_to_irq(PIN_NUMBER).