Random error while waiting for pin interrupts
See original GitHub issueDescribe the bug
Steps to reproduce
- Open Jacdac.sln in https://github.com/microsoft/jacdac-dotnet
- Deploy Jacdac.NET.Playground to a raspberry pi equipped with https://microsoft.github.io/jacdac-docs/devices/microsoft/research/jmspibridgev37v37
- launch
dotnet System.NET.Playground.dll spi devtools
Expected behavior
Don’t crash or provide a way to handle issue.
Actual behavior
Unhandled exception. System.IO.IOException: Error while waiting for pin interrupts.
at System.Device.Gpio.Drivers.SysFsDriver.WasEventDetected(Int32 pollFileDescriptor, Int32 valueFileDescriptor, Int32& pinNumber, CancellationToken cancellationToken)
at System.Device.Gpio.Drivers.SysFsDriver.DetectEvents()
at System.Threading.Thread.StartCallback()
Versions used
pi@raspberrypi:~/dotnet $ dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.101
Commit: ef49f6213a
Runtime Environment:
OS Name: raspbian
OS Version: 11
OS Platform: Linux
RID: linux-arm
Base Path: /home/pi/.dotnet/sdk/6.0.101/
Host (useful for support):
Version: 6.0.1
Commit: 3a25a7f1cc
.NET SDKs installed:
6.0.101 [/home/pi/.dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.1 [/home/pi/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.1 [/home/pi/.dotnet/shared/Microsoft.NETCore.App]
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Do not use interrupts in your programming (?)
I've read a few Forums about complications using Interrupts and most ... the interrupt pin alone still be enough for it to trigger...
Read more >Arduino Project Interrupt Error?
You are disabling interrupts for way too long. Interrupts are meant for handling time-critical tasks that cannot wait for a full loop ...
Read more >problem with timer interrupt - MSP low-power microcontrollers
I am configured timer A for interrupt for generating a square wave but ... + GIE); // Enter LPM0 w/interrupt so CPU sleep...
Read more >SPI Interrupt Bit-Offset / Too Early - Raspberry Pi Forums
I´m running an SPI Slave on my Pico and executing an interrupt when 16 bits of Data are received. I visualized the interrupt...
Read more >Arduino Interrupt won't ignore falling edge
You're attaching the handler to a pin change interrupt. That means, if the pin is not changed interrupt will not be called again....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pelikhan We’ve been having a few problems using SysFs in the past. I don’t remember exactly what we did there about that. I think catching the exception and retrying was normally working. However, since SysFs is deprecated and slow, we switched to using libgpiod as default low-level library when it’s available.
So just run
sudo apt install -y libgpiod-dev
and the library should pick it up automatically. I’ve never seen the above error with libgpiod and it is orders of magnitude faster (compare #1470).Try installing
libgpiod-dev
. That should work around the problem.