Is the maximum number of interrupts limited to 4?

Post Reply
Caleb P
Posts: 3
Joined: Sat May 16, 2020 5:29 pm
languages_spoken: english, spanish
ODROIDs: N2
Has thanked: 2 times
Been thanked: 0
Contact:

Is the maximum number of interrupts limited to 4?

Post by Caleb P » Sat May 16, 2020 6:16 pm

Hi,

Kindly asking for your help. :|

I need to detect an interrupt that could happen in any of the nine gpios I´m using as inputs. I want to catch both edge events (rising and falling). Working in Ubuntu 18.04.4

Using wiringpi I´m able to register both situations but not with all pins, so wiringPiISR (26, INT_EDGE_BOTH, &myFunction) gives both events but if I change the pin from 26 (gpio.472) to 5 (gpio.477) it doesn't do anything.

I tried from the terminal:

root@odroid:~# echo 477 > /sys/class/gpio/export

.....exported the pin, set the direction to input, but when I tried setting the edge to both:

Code: Select all

echo both > /sys/class/gpio/gpio477/edge    
error: -bash: echo: write error: Invalid argument 


However if I do the same with gpio472 it works fine, no error. Is it possible to configure this? Is it something limited to hardware like the Odroid C2..? I need to be able to catch both edge events on gpio477, gpio464, gpio495, gpio494 and gpio480. :?:

Code: Select all

root@RS03:~# sudo cat /sys/kernel/debug/gpio
gpiochip1: GPIOs 410-495, parent: platform/pinctrl@ff634480, periphs-banks:
 gpio-431 (                    |usb_hub             ) out hi
 gpio-432 (                    |usb_hub_en          ) out hi
 gpio-433 (                    |ffe09080.usb3phy    ) out lo
 gpio-448 (                    |amlsd               ) out hi
 gpio-458 (                    |amlsd               ) in  hi
 gpio-464 (                    |sysfs               ) in  hi
 gpio-472 (                    |sysfs               ) in  lo IRQ
 gpio-473 (                    |sysfs               ) in  lo IRQ
 gpio-476 (                    |sysfs               ) in  hi
 gpio-477 (                    |sysfs               ) in  lo
 gpio-478 (                    |sysfs               ) in  hi
 gpio-479 (                    |sysfs               ) in  lo IRQ
 gpio-480 (                    |sysfs               ) in  lo
 gpio-481 (                    |sysfs               ) in  hi
 gpio-482 (                    |sysfs               ) in  hi
 gpio-483 (                    |sysfs               ) in  hi
 gpio-484 (                    |sysfs               ) in  hi
 gpio-485 (                    |sysfs               ) in  hi
 gpio-486 (                    |sysfs               ) in  hi
 gpio-487 (                    |sysfs               ) in  hi
 gpio-488 (                    |sysfs               ) in  hi
 gpio-489 (                    |sysfs               ) in  hi
 gpio-490 (                    |sysfs               ) in  hi
 gpio-491 (                    |sysfs               ) in  hi
 gpio-492 (                    |sysfs               ) in  hi
 gpio-493 (                    |sysfs               ) in  hi IRQ
 gpio-494 (                    |sysfs               ) in  hi
 gpio-495 (                    |sysfs               ) in  lo

gpiochip0: GPIOs 496-511, parent: platform/pinctrl@ff800014, aobus-banks:
 gpio-498 (                    |line_mute           ) out hi
 gpio-506 (                    |pwm                 ) out lo
 gpio-507 (                    |?                   ) out hi
gpio 472, 473 and 479 seem to be the only pins that work (IRQ), 493 is IRQ too but doesn´t work.

Thanks.

User avatar
odroid
Site Admin
Posts: 34127
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 670 times
Been thanked: 614 times
Contact:

Re: Is the maximum number of interrupts limited to 4?

Post by odroid » Mon May 18, 2020 10:22 am

Right. The number of maximum GPIO interrupts is four if you need to detect polling and rising edges together.
All the Amlogic SoC based boards C1/C2/C4/N2 have this bad limitation. :(
Also note that the SD-card interface already occupied one of four interrupt for the card insert/removal detection.
These users thanked the author odroid for the post:
Caleb P (Mon May 18, 2020 11:10 am)

Caleb P
Posts: 3
Joined: Sat May 16, 2020 5:29 pm
languages_spoken: english, spanish
ODROIDs: N2
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Is the maximum number of interrupts limited to 4?

Post by Caleb P » Mon May 18, 2020 11:10 am

Thank you for your answer, since I´m using an eMMC card I´m triying to disable the SD function via modifying the DeviceTree.

As suggested by an odroid admin:

Code: Select all

compatible = "amlogic, aml_sd_emmc";
         dev_name = "aml_newsd.0";
         /*
         status = "okay";
         */
         status = "disabled";
Any recommendations to modify the Device Tree, I´m a bit lost..?, it would be great if you could come up with some command line like: fdtput -t s........ to be able to enable or disable the sd card.

User avatar
odroid
Site Admin
Posts: 34127
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 670 times
Been thanked: 614 times
Contact:

Re: Is the maximum number of interrupts limited to 4?

Post by odroid » Mon May 18, 2020 2:56 pm

I was wrong. N2 SD driver doesn't use any interrupt.
So you can use four GPIO interrupts without modifying the device tree. Sorry for the confusion caused.
These users thanked the author odroid for the post:
Caleb P (Mon May 18, 2020 3:04 pm)

Caleb P
Posts: 3
Joined: Sat May 16, 2020 5:29 pm
languages_spoken: english, spanish
ODROIDs: N2
Has thanked: 2 times
Been thanked: 0
Contact:

Re: Is the maximum number of interrupts limited to 4?

Post by Caleb P » Mon May 18, 2020 3:04 pm

Ok, thanks!

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 0 guests