How to configure interrupt on pin 25

Which system do you use? Android, Ubuntu, OOWOW or others?

Vim3 Ubuntu

Which version of system do you use? Please provide the version of the system here:

Ubuntu 20.04

Please describe your issue below:

Hi @numbqq @Gouwa ,

I want to configure physical pin 25 to an interrupt. I have 2 port expanders connected to an i2c and some of the pins on those port expanders can generate an interrupt on the i2c line. The i2c interrupt line is connected to pin 25 on the khadas 40 pin ribbon. However, when using the python wiringpi library to configure the interrupt 'GPIO.wiringPiISR(I2C_INTR_PIN, GPIO.INT_EDGE_RISING, i2c_intr)’, I get the error /sys/class/gpio/gpio498/value: No such file or directory. And then when trying to export pin 498, I get an ‘invalid argument’ error.

When doing gpio readall, I can see that pin 25 is mode alt0 instead of In/Out. Is that why I can’t attach an interrupt to it? If so, how can I change it to input output? In my device tree /boot/env.txt I only need to use the overlays i2c3, uart3, and watchdog. I don’t see any of the device tree peripherals using pin 25, so why is it in mode alt 0 and how can I free it?

Thank you.

Hello @ericz9002

Please check this documentation:

Hi @numbqq

The problem is pin 25 is in alt 0 mode instead of gpio, so I can’t export it. And in the device overlays /boot/env.txt, none of the peripherals are using pin 25 so I don’t know how to free it.

Thank you.

PIN25 & PIN26 are I2C bus, you cant use them as GPIO, please use other GPIOs.

Hi @numbqq

What is the difference between I2CM 3 and I2C AO or can you point me to the resource where it says it?

Thank you.

Hello @ericz9002

Please check the schematics here: