GPIO IRQ edge
Baptiste
New Member Posts: 4 ✭
Hello,
I try to set the edge on an exported gpio pin on the UpSquare, OS is the official Linux debian ubilinux for UpSquare :
All commands are executed as root, without problem.
echo 402 > /sys/class/gpio/export
chmod 777 /sys/class/gpio/gpio402/*
echo "in" > /sys/class/gpio/gpio402/direction
Then, i try:
echo "rising" > /sys/class/gpio/gpio402/edge
I get: "echo: write error: Operation not permitted"
I check permissions: all files are root and have read/write/exec flags set.
I try to set the edge from a custom C program, executed as root. but I get the exact same error.
Any ideas ?
Maybe the pin do not support IRQ edge ?
How can I check if a pin support edge sense detection ?
Regards
Baptiste
I try to set the edge on an exported gpio pin on the UpSquare, OS is the official Linux debian ubilinux for UpSquare :
All commands are executed as root, without problem.
echo 402 > /sys/class/gpio/export
chmod 777 /sys/class/gpio/gpio402/*
echo "in" > /sys/class/gpio/gpio402/direction
Then, i try:
echo "rising" > /sys/class/gpio/gpio402/edge
I get: "echo: write error: Operation not permitted"
I check permissions: all files are root and have read/write/exec flags set.
I try to set the edge from a custom C program, executed as root. but I get the exact same error.
Any ideas ?
Maybe the pin do not support IRQ edge ?
How can I check if a pin support edge sense detection ?
Regards
Baptiste
Comments
-
Dear Baptiste
reboot the board and try the following
sudo -i
echo 402 > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio402/direction
cat /sys/class/gpio/gpio402/value
you can also check the script python that I've just added on the wiki
https://up-community.org/wiki/Pinout_UP2#Example_IRQ_test_using_Python_Periphery
If you want to access gpio with a common user you need to set an udev rule to change the default gpio user/group/permission.
If you still have problem please follow the istruction of this section of the wiki and submit the output of the sysinfo script
https://up-community.org/wiki/Software#Requesting_support_for_Linux_OS -
Hi Nicola,
After some testing, i found :
- On UpSquare Pentium 4, irq edge detection is working. No problem on this board.
- On UpSquare Celeron, irq edge detection is not working, got the message "write error: Operation not permitted"
Tested the Python script, got "There was some uncaught error".
I check the dmesg output on the Celeron board :
[ 300.235532] broxton-pinctrl INT3452:01: pin 45 cannot be used as IRQ
[ 300.235542] genirq: Setting trigger mode 1 for irq 245 failed (intel_gpio_irq_type+0x0/0x130)
Hope this helps to debug the Celeron device ;-)
Regards,
Baptiste -
Hi
do you have the latest bios (2.1)?
I just checked with a celeron board
please also send me the result of the sysinfo script
https://up-community.org/wiki/Software#Requesting_support_for_Linux_OS
Regards
Nicola Lunghi -
Hi Nicola,
Sorry to jump in on this one, but are you aware that the latest BIOS download page for the UP Squared board is completely 'empty' at the moment, and does not include anything at all?
This was mentioned in a few threads yesterday, but does not appear to have been resolved yet.
Thanks!
'Montala' -
Hi Nicola,
In attachement, the output of sysinfo script. -
Hi Montala,
The BIOS 2.1 has been temporarily disabled for download to update the upgrade process.
At the moment if you have BIOS 1.3 you should upgrade to BIOS 1.8 as described in the download page: https://up-community.org/downloads/download/29-uefi-bios/70-upa1am18
We will provide an update and re-enable the BIOS 2.1 download before the end of the week. -
Hi baptiste
now the situation is more clear.
[ol]
[li]You are running an old bios version (1.3) that has some problem with the interrupts. Update the bios to version 1.8
https://up-community.org/downloads/download/29-uefi-bios/70-upa1am18.
When the 2.1 bios will be available I suggest you to update to 2.1. For the interrupt to work the 1.8 is sufficient.[/li]
[li]You are running ubilinux-beta and a previous release of the kernel (4.9.18) .
I suggest that you update the system to the latest ubilinux 4 distro.
For now we don't support updating directly from the beta to the release version, so you need to reinstall the system from scratch.
After installing this version you will receive packages update via apt.
[ul]
[li]https://up-community.org/downloads/category/44-ubilinux[/li]
[li]https://up-community.org/wiki/Ubilinux[/li]
[/ul]
[/li]
[/ol] -
Hi Nicola,
Thanks for your support, i will test that on Celeron !
Regards,
Baptiste