All of lore.kernel.org
 help / color / mirror / Atom feed
* UDD example for Pi 3 (GPIO / IRQ)
@ 2019-11-05 14:18 Pierre FICHEUX
  2019-11-05 14:54 ` Philippe Gerum
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre FICHEUX @ 2019-11-05 14:18 UTC (permalink / raw)
  To: xenomai

Hi all,

I try to write a simple UDD example for Raspberry Pi 3 in order to control
a led (GPIO out) and button (GPIO in, IRQ). Example is based on
https://xenomai.org/pipermail/xenomai/2017-February/037121.html (by
Philippe !).
It works fine for GPIO out (led is blinking)  but I can't get IRQ event
from user space (ioctl from UDD driver seems not to be not called).

# ./xenomai_udd_rpi_gpio
Using GPIO 4 and period 100000000 ns
IRQ thread starting
thread_irq: fd= 0
failed to enable signotify (-1)
failed to enable interrupt (-1)

It works fine in kernel space, irq_handler() function is registered and
called.

# cat /proc/xenomai/irq

  IRQ         CPU0        CPU1        CPU2        CPU3

   17:        1573        1587        1769         770         [timer/0]

  183:           0           0           0           0         rpi_gpio

 1032:           0           0           0           0         [sync]

 1033:           0           1           1           1         [timer-ipi]

 1034:           0           1           1           1         [reschedule]

 1035:           0           0           0           0         [virtual]

 1039:           0           0          17           0         [virtual]

# [  174.350733] Got IRQ !

[  174.437832] Got IRQ !

Source code is available from GitHub.

https://github.com/pficheux/xenomai_examples

Any Idea?

Thx by advance.

-- 

Pierre FICHEUX -/- CTO Smile ECS, France -\- pierre.ficheux@smile.fr
                             http://www.smile.fr
                             https://smile.eu/fr/offres/embarque-iot
I would love to change the world, but they won't give me the source code

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: UDD example for Pi 3 (GPIO / IRQ)
  2019-11-05 14:18 UDD example for Pi 3 (GPIO / IRQ) Pierre FICHEUX
@ 2019-11-05 14:54 ` Philippe Gerum
  2019-11-05 16:13   ` Pierre FICHEUX
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Gerum @ 2019-11-05 14:54 UTC (permalink / raw)
  To: Pierre FICHEUX, xenomai

On 2019-11-05 15:18, Pierre FICHEUX via Xenomai wrote:
> Hi all,
> 
> I try to write a simple UDD example for Raspberry Pi 3 in order to control
> a led (GPIO out) and button (GPIO in, IRQ). Example is based on
> https://xenomai.org/pipermail/xenomai/2017-February/037121.html (by
> Philippe !).
> It works fine for GPIO out (led is blinking)  but I can't get IRQ event
> from user space (ioctl from UDD driver seems not to be not called).
> 
> # ./xenomai_udd_rpi_gpio
> Using GPIO 4 and period 100000000 ns
> IRQ thread starting
> thread_irq: fd= 0
> failed to enable signotify (-1)
> failed to enable interrupt (-1)
> 
> It works fine in kernel space, irq_handler() function is registered and
> called.
> 
> # cat /proc/xenomai/irq
> 
>   IRQ         CPU0        CPU1        CPU2        CPU3
> 
>    17:        1573        1587        1769         770         [timer/0]
> 
>   183:           0           0           0           0         rpi_gpio
> 
>  1032:           0           0           0           0         [sync]
> 
>  1033:           0           1           1           1         [timer-ipi]
> 
>  1034:           0           1           1           1         [reschedule]
> 
>  1035:           0           0           0           0         [virtual]
> 
>  1039:           0           0          17           0         [virtual]
> 
> # [  174.350733] Got IRQ !
> 
> [  174.437832] Got IRQ !
> 
> Source code is available from GitHub.
> 
> https://github.com/pficheux/xenomai_examples
> 
> Any Idea?
> 

More coffee, louder rock, glasses with stronger correction for all of us, old cranky meatballs:

-  if ((fd = open("/dev/rtdm/rpi_gpio", O_RDWR) < 0)) {
+  if ((fd = open("/dev/rtdm/rpi_gpio", O_RDWR)) < 0) {

-- 
Philippe.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: UDD example for Pi 3 (GPIO / IRQ)
  2019-11-05 14:54 ` Philippe Gerum
@ 2019-11-05 16:13   ` Pierre FICHEUX
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre FICHEUX @ 2019-11-05 16:13 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

Thx a lot, "trust does not exclude control" (if using code from an
intern...) -:))

regards

Le mar. 5 nov. 2019 à 15:54, Philippe Gerum <rpm@xenomai.org> a écrit :

> On 2019-11-05 15:18, Pierre FICHEUX via Xenomai wrote:
> > Hi all,
> >
> > I try to write a simple UDD example for Raspberry Pi 3 in order to
> control
> > a led (GPIO out) and button (GPIO in, IRQ). Example is based on
> > https://xenomai.org/pipermail/xenomai/2017-February/037121.html (by
> > Philippe !).
> > It works fine for GPIO out (led is blinking)  but I can't get IRQ event
> > from user space (ioctl from UDD driver seems not to be not called).
> >
> > # ./xenomai_udd_rpi_gpio
> > Using GPIO 4 and period 100000000 ns
> > IRQ thread starting
> > thread_irq: fd= 0
> > failed to enable signotify (-1)
> > failed to enable interrupt (-1)
> >
> > It works fine in kernel space, irq_handler() function is registered and
> > called.
> >
> > # cat /proc/xenomai/irq
> >
> >   IRQ         CPU0        CPU1        CPU2        CPU3
> >
> >    17:        1573        1587        1769         770         [timer/0]
> >
> >   183:           0           0           0           0         rpi_gpio
> >
> >  1032:           0           0           0           0         [sync]
> >
> >  1033:           0           1           1           1
>  [timer-ipi]
> >
> >  1034:           0           1           1           1
>  [reschedule]
> >
> >  1035:           0           0           0           0         [virtual]
> >
> >  1039:           0           0          17           0         [virtual]
> >
> > # [  174.350733] Got IRQ !
> >
> > [  174.437832] Got IRQ !
> >
> > Source code is available from GitHub.
> >
> > https://github.com/pficheux/xenomai_examples
> >
> > Any Idea?
> >
>
> More coffee, louder rock, glasses with stronger correction for all of us,
> old cranky meatballs:
>
> -  if ((fd = open("/dev/rtdm/rpi_gpio", O_RDWR) < 0)) {
> +  if ((fd = open("/dev/rtdm/rpi_gpio", O_RDWR)) < 0) {
>
> --
> Philippe.
>


-- 

Pierre FICHEUX -/- CTO Smile ECS, France -\- pierre.ficheux@smile.fr
                             http://www.smile.fr
                             https://smile.eu/fr/offres/embarque-iot
I would love to change the world, but they won't give me the source code

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-05 16:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05 14:18 UDD example for Pi 3 (GPIO / IRQ) Pierre FICHEUX
2019-11-05 14:54 ` Philippe Gerum
2019-11-05 16:13   ` Pierre FICHEUX

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.