Page 1 of 1

gpioset: error setting the GPIO line values: Device or resource busy

Posted: Fri Sep 06, 2019 1:06 pm
by Gaston
I am using Linux distribution on my SAMA5D27 embedded Board.I am also using LIBGPIOD library to manipulate GPIOS configurations of the board. First, I can list all the lines of specified gpiochips, their names, consumers, direction, active state with

Code: Select all

gpioinfo
command, and this shows me :

Code: Select all

gpiochip0 - 128 lines:
        line   0:        "PA0"       unused   input  active-high 
        line   1:        "PA1"       unused   input  active-high 
        line   2:        "PA2"       unused   input  active-high 
        line   3:        "PA3"       unused   input  active-high 
        line   4:        "PA4"       unused   input  active-high 
        line   5:        "PA5"       unused   input  active-high 
        line   6:        "PA6"       unused   input  active-high 
        line   7:        "PA7"       unused   input  active-high 
        line   8:        "PA8"       unused   input  active-high 
        line   9:        "PA9"       unused   input  active-high 
        line  10:       "PA10"        "red"  output  active-high [used]
        line  11:       "PA11"       unused   input  active-high 
...
For my work, I want to let "PA10" GPIO PIN for personal use, this pin referres to RED Led. But whatever command dedicated to manipulate "PA10" GPIO PIN it shows me :
error setting the GPIO line values: Device or resource busy
I Think that is beacause it's shown as [USED] in front of it's line.

Is there a way to make it UNUSED ? To make it free so i can manipulate it ?

Re: gpioset: error setting the GPIO line values: Device or resource busy

Posted: Sat Sep 07, 2019 1:08 am
by blue_z
Your post makes no sense.

If there is actually a red LED connected to that GPIO on your board, then (that aspect of) the board configuration is correct, and the Linux preference is to use the sysfs interface to control that LED (instead of a generic gpio API). A link to that Linux LED API was provided to you several weeks ago.
The preference is based on using a device name (that abstracts yet identifies the HW and is portable) rather than a hardware-based identifier/number that is board-specific. (The entire /dev directory is an abstraction for the hardware, yet some people still want to revert back to primitive board and HW-specific references!)

If there is no red LED connected to that GPIO on your "SAMA5D27 embedded Board", then you are using an incorrect board configuration!

Regards

Re: gpioset: error setting the GPIO line values: Device or resource busy

Posted: Tue Sep 10, 2019 5:23 pm
by Gaston
For those who are maybe stuck as i was in this problem. The solution is to make a patch to the device tree so you can edit it. Put what you want to make it unused into comments and rebuild your kernel. :D