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).


On Fri, Nov 13, 2015 at 11:01 AM, Matteo Loda <[email protected]> wrote:

> I got the same problem, I am using this image :
> http://elinux.org/Beagleboard:BeagleBoneBlack_Debian
>
>  Anybody did it ?
>
> Il giorno mercoledì 2 aprile 2014 09:00:51 UTC+2, [email protected] ha
> scritto:
>>
>> 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
>>  *
>>  *  Created on: 26 mars 2014
>>  *      Author: daivymerlijs
>>  */
>>
>>
>> #include <stdio.h>
>> #include <sys/mman.h>
>> #include <xenomai/native/task.h>
>> #include <xenomai/native/intr.h>
>>
>>
>> static RT_INTR intr;
>>
>> int main() {
>> mlockall(MCL_CURRENT | MCL_FUTURE);
>> rt_task_shadow(NULL,NULL,90,0);
>> rt_intr_create(&intr,NULL,60,0); //not the correct value
>> rt_intr_enable(&intr);
>>
>> while(1){
>> printf("Waiting interruption... \n");
>> rt_intr_wait(&intr,TM_INFINITE);
>> printf("Interruption OK");
>>
>> }
>> return 0;
>> }
>>
>>
>> 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.
>>
>> Thanks,
>> Daivy
>>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "BeagleBoard" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/beagleboard/UGaVWPBx254/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to