I’m currently using an existing code base (that has been working well on our Toradex iMx8X device) and have decided to begin actuating an additional GPIO.
The original GPIO Pins I’m using are still working correctly, yet when I attempt to OpenPin() on one of the new GPIO Pins, I get an error:
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: —> System.IO.IOException: Device or resource busy
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: at System.IO.FileStream.WriteNative(ReadOnlySpan`1 source)
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: at System.IO.FileStream.FlushWriteBuffer()
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: at System.IO.FileStream.Dispose(Boolean disposing)
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: at System.IO.Stream.Close()
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: at System.IO.StreamWriter.CloseStreamFromDispose(Boolean disposing)
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: at System.IO.StreamWriter.Dispose(Boolean disposing)
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: at System.IO.TextWriter.Dispose()
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: at System.IO.File.WriteAllText(String path, String contents)
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: at System.Device.Gpio.Drivers.SysFsDriver.OpenPin(Int32 pinNumber)
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: at System.Device.Gpio.GpioController.OpenPinCore(Int32 pinNumber)
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: at System.Device.Gpio.GpioController.OpenPin(Int32 pinNumber)
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: at System.Device.Gpio.GpioController.OpenPin(Int32 pinNumber, PinMode mode)
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: at HardwareController.Motor…ctor() in /source/hardware/Motor.cs:line 119
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: at HardwareController.Components…cctor() in /source/Components.cs:line 7
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: — End of inner exception stack trace —
Jan 01 00:00:34 colibri-imx8x-06995390 a0769e06741c[733]: at HardwareController.Program.Main(String args) in /source/Program.cs:line 33
…so What causes this fault?
System.IO.IOException: Device or resource busy
I’ve got udev rules in place for gpio 0-9
My docker-compse.yml maps the gpio chips to the container (which is privileged!)
Also, in point of fact, Pins for GPIO3 and GPIO5 are working as they always have. Only when I try to do OpenPin() on a pin in GPIO4 (the new pin!)
Do I see this error.
How can I verify that correct access & permissions have been granted?
Thx
Paul++